From 59f00e19a3597d2e4ad77cc07f772b992debdf13 Mon Sep 17 00:00:00 2001 From: gnoff Date: Fri, 28 Apr 2023 23:02:37 +0000 Subject: [PATCH] Preinits should support a nonce option (#26744) Currently there is no way to provide a nonce when using `ReactDOM.preinit(..., { as: 'script' })` This PR adds `nonce?: string` as an option While implementing this PR I added a test to also show you can pass `integrity`. This test isn't directly related to the nonce change. DiffTrain build for [b12bea62d9cfd9a925f28cb2c93daeda3865a64e](https://github.com/facebook/react/commit/b12bea62d9cfd9a925f28cb2c93daeda3865a64e) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 274 +++--- compiled/facebook-www/ReactART-dev.modern.js | 274 +++--- .../facebook-www/ReactART-prod.classic.js | 320 +++---- compiled/facebook-www/ReactART-prod.modern.js | 320 +++---- compiled/facebook-www/ReactDOM-dev.classic.js | 314 ++++--- compiled/facebook-www/ReactDOM-dev.modern.js | 482 ++++++----- .../facebook-www/ReactDOM-prod.classic.js | 647 ++++++++------- compiled/facebook-www/ReactDOM-prod.modern.js | 731 ++++++++-------- .../ReactDOM-profiling.classic.js | 691 ++++++++-------- .../facebook-www/ReactDOM-profiling.modern.js | 781 +++++++++--------- .../ReactDOMServer-dev.classic.js | 36 +- .../facebook-www/ReactDOMServer-dev.modern.js | 36 +- .../ReactDOMServer-prod.classic.js | 90 +- .../ReactDOMServer-prod.modern.js | 88 +- .../ReactDOMServerStreaming-dev.modern.js | 34 +- .../ReactDOMServerStreaming-prod.modern.js | 86 +- .../ReactDOMTesting-dev.classic.js | 314 ++++--- .../ReactDOMTesting-dev.modern.js | 482 ++++++----- .../ReactDOMTesting-prod.classic.js | 647 ++++++++------- .../ReactDOMTesting-prod.modern.js | 731 ++++++++-------- .../ReactTestRenderer-dev.classic.js | 262 +++--- .../ReactTestRenderer-dev.modern.js | 262 +++--- compiled/facebook-www/WARNINGS | 1 - 25 files changed, 4464 insertions(+), 3443 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 30e2f1820b..4f7cefe25f 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -f87e97a0a67fa7cfd7e6f2ec985621c0e825cb23 +b12bea62d9cfd9a925f28cb2c93daeda3865a64e diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 29c939942a..c12386d3e6 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-modern-bcc00dd5"; +var ReactVersion = "18.3.0-www-modern-3898c4ac"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 4998181069..dab458ffec 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-0a3d97ff"; +var ReactVersion = "18.3.0-www-classic-4e446d05"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -3847,7 +3847,7 @@ function isRootDehydrated(root) { var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a
) function requiredContext(c) { { @@ -3901,24 +3901,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches @@ -7714,8 +7711,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -7724,81 +7733,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -8258,6 +8320,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -8325,11 +8388,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -8339,7 +8403,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -8921,11 +8985,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -9795,14 +9859,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$2.transition = {}); if (enableTransitionTracing) { @@ -9818,16 +9888,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -9872,7 +9942,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -23900,9 +23970,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -24652,7 +24722,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -24709,10 +24779,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -25473,7 +25543,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -25519,7 +25589,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -26697,7 +26767,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 117a93606c..d7889814ca 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-modern-85c16289"; +var ReactVersion = "18.3.0-www-modern-c4f3054f"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -3603,7 +3603,7 @@ function isRootDehydrated(root) { var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -3657,24 +3657,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches @@ -7470,8 +7467,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -7480,81 +7489,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -8014,6 +8076,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -8081,11 +8144,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -8095,7 +8159,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -8677,11 +8741,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -9551,14 +9615,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$2.transition = {}); if (enableTransitionTracing) { @@ -9574,16 +9644,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -9628,7 +9698,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -23565,9 +23635,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -24317,7 +24387,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -24374,10 +24444,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -25133,7 +25203,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -25179,7 +25249,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -26357,7 +26427,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 173c933916..53a3ca5929 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -2462,57 +2462,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$28 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$28); - return asyncAction$28; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$29 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$29.status = "fulfilled"; + resultThenable$29.value = finishedState; + }); + return resultThenable$29; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -2583,6 +2606,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -2602,12 +2626,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -2842,12 +2870,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -2900,10 +2928,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -3130,13 +3158,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$2.transition = {}; enableTransitionTracing && void 0 !== options && @@ -3146,9 +3180,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -3359,7 +3393,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -5525,14 +5559,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$73 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode), + for (var lastTailNode$74 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$74 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$73 + null === lastTailNode$74 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$73.sibling = null); + : (lastTailNode$74.sibling = null); } } function bubbleProperties(completedWork) { @@ -5542,19 +5576,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$74 = completedWork.child; null !== child$74; ) - (newChildLanes |= child$74.lanes | child$74.childLanes), - (subtreeFlags |= child$74.subtreeFlags & 31457280), - (subtreeFlags |= child$74.flags & 31457280), - (child$74.return = completedWork), - (child$74 = child$74.sibling); + for (var child$75 = completedWork.child; null !== child$75; ) + (newChildLanes |= child$75.lanes | child$75.childLanes), + (subtreeFlags |= child$75.subtreeFlags & 31457280), + (subtreeFlags |= child$75.flags & 31457280), + (child$75.return = completedWork), + (child$75 = child$75.sibling); else - for (child$74 = completedWork.child; null !== child$74; ) - (newChildLanes |= child$74.lanes | child$74.childLanes), - (subtreeFlags |= child$74.subtreeFlags), - (subtreeFlags |= child$74.flags), - (child$74.return = completedWork), - (child$74 = child$74.sibling); + for (child$75 = completedWork.child; null !== child$75; ) + (newChildLanes |= child$75.lanes | child$75.childLanes), + (subtreeFlags |= child$75.subtreeFlags), + (subtreeFlags |= child$75.flags), + (child$75.return = completedWork), + (child$75 = child$75.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5736,11 +5770,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$78 = null; + var cache$79 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$78 = newProps.memoizedState.cachePool.pool); - cache$78 !== instance && (newProps.flags |= 2048); + (cache$79 = newProps.memoizedState.cachePool.pool); + cache$79 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -5770,8 +5804,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$78 = instance.rendering; - if (null === cache$78) + cache$79 = instance.rendering; + if (null === cache$79) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -5779,11 +5813,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$78 = findFirstSuspended(current); - if (null !== cache$78) { + cache$79 = findFirstSuspended(current); + if (null !== cache$79) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$78.updateQueue; + current = cache$79.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -5808,7 +5842,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$78)), null !== current)) { + if (((current = findFirstSuspended(cache$79)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -5818,7 +5852,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$78.alternate) + !cache$79.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -5830,13 +5864,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 8388608)); instance.isBackwards - ? ((cache$78.sibling = workInProgress.child), - (workInProgress.child = cache$78)) + ? ((cache$79.sibling = workInProgress.child), + (workInProgress.child = cache$79)) : ((current = instance.last), null !== current - ? (current.sibling = cache$78) - : (workInProgress.child = cache$78), - (instance.last = cache$78)); + ? (current.sibling = cache$79) + : (workInProgress.child = cache$79), + (instance.last = cache$79)); } if (null !== instance.tail) return ( @@ -6096,8 +6130,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$96) { - captureCommitPhaseError(current, nearestMountedAncestor, error$96); + } catch (error$97) { + captureCommitPhaseError(current, nearestMountedAncestor, error$97); } else ref.current = null; } @@ -6299,11 +6333,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$97) { + } catch (error$98) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$97 + error$98 ); } } @@ -6896,8 +6930,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$105) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$105); + } catch (error$106) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$106); } } break; @@ -6933,11 +6967,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null !== updatePayload || diffInCommitPhase) try { flags._applyProps(flags, newProps, current); - } catch (error$108) { + } catch (error$109) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$108 + error$109 ); } } @@ -6974,8 +7008,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$110) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$110); + } catch (error$111) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$111); } flags = finishedWork.updateQueue; null !== flags && @@ -7115,12 +7149,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$100 = JSCompiler_inline_result.stateNode.containerInfo, - before$101 = getHostSibling(finishedWork); + var parent$101 = JSCompiler_inline_result.stateNode.containerInfo, + before$102 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$101, - parent$100 + before$102, + parent$101 ); break; default: @@ -7581,9 +7615,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$119 = finishedWork.stateNode; + var instance$120 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$119._visibility & 4 + ? instance$120._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7596,7 +7630,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$119._visibility |= 4), + : ((instance$120._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7604,7 +7638,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$119._visibility |= 4), + : ((instance$120._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7617,7 +7651,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$119 + instance$120 ); break; case 24: @@ -8028,8 +8062,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$1.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; return 0 !== fiber ? fiber : 32; @@ -8122,16 +8156,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$129 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$128 && - ((lanes = errorRetryLanes$128), + 0 !== errorRetryLanes$129 && + ((lanes = errorRetryLanes$129), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$128 + errorRetryLanes$129 ))); } if (1 === exitStatus) @@ -8294,8 +8328,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -8333,6 +8368,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -8413,8 +8449,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$130) { - handleThrow(root, thrownValue$130); + } catch (thrownValue$131) { + handleThrow(root, thrownValue$131); } while (1); resetContextDependencies(); @@ -8518,8 +8554,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$132) { - handleThrow(root, thrownValue$132); + } catch (thrownValue$133) { + handleThrow(root, thrownValue$133); } while (1); resetContextDependencies(); @@ -8585,7 +8621,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -8600,7 +8636,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -8698,10 +8734,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$35 = offscreenQueue.retryQueue; - null === retryQueue$35 + var retryQueue$36 = offscreenQueue.retryQueue; + null === retryQueue$36 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$35.add(wakeable); + : retryQueue$36.add(wakeable); } } break; @@ -10046,19 +10082,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1170 = { + devToolsConfig$jscomp$inline_1173 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-classic-f817b2e4", + version: "18.3.0-www-classic-976d3052", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1335 = { - bundleType: devToolsConfig$jscomp$inline_1170.bundleType, - version: devToolsConfig$jscomp$inline_1170.version, - rendererPackageName: devToolsConfig$jscomp$inline_1170.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1170.rendererConfig, +var internals$jscomp$inline_1338 = { + bundleType: devToolsConfig$jscomp$inline_1173.bundleType, + version: devToolsConfig$jscomp$inline_1173.version, + rendererPackageName: devToolsConfig$jscomp$inline_1173.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1173.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10075,26 +10111,26 @@ var internals$jscomp$inline_1335 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1170.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1173.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-f817b2e4" + reconcilerVersion: "18.3.0-www-classic-976d3052" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1336 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1339 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1336.isDisabled && - hook$jscomp$inline_1336.supportsFiber + !hook$jscomp$inline_1339.isDisabled && + hook$jscomp$inline_1339.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1336.inject( - internals$jscomp$inline_1335 + (rendererID = hook$jscomp$inline_1339.inject( + internals$jscomp$inline_1338 )), - (injectedHook = hook$jscomp$inline_1336); + (injectedHook = hook$jscomp$inline_1339); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 0d7b91bf24..4d2678d10a 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -2268,57 +2268,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$28 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$28); - return asyncAction$28; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$29 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$29.status = "fulfilled"; + resultThenable$29.value = finishedState; + }); + return resultThenable$29; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -2389,6 +2412,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -2408,12 +2432,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -2648,12 +2676,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -2706,10 +2734,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -2936,13 +2964,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$2.transition = {}; enableTransitionTracing && void 0 !== options && @@ -2952,9 +2986,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -3165,7 +3199,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -5280,14 +5314,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$73 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode), + for (var lastTailNode$74 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$74 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$73 + null === lastTailNode$74 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$73.sibling = null); + : (lastTailNode$74.sibling = null); } } function bubbleProperties(completedWork) { @@ -5297,19 +5331,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$74 = completedWork.child; null !== child$74; ) - (newChildLanes |= child$74.lanes | child$74.childLanes), - (subtreeFlags |= child$74.subtreeFlags & 31457280), - (subtreeFlags |= child$74.flags & 31457280), - (child$74.return = completedWork), - (child$74 = child$74.sibling); + for (var child$75 = completedWork.child; null !== child$75; ) + (newChildLanes |= child$75.lanes | child$75.childLanes), + (subtreeFlags |= child$75.subtreeFlags & 31457280), + (subtreeFlags |= child$75.flags & 31457280), + (child$75.return = completedWork), + (child$75 = child$75.sibling); else - for (child$74 = completedWork.child; null !== child$74; ) - (newChildLanes |= child$74.lanes | child$74.childLanes), - (subtreeFlags |= child$74.subtreeFlags), - (subtreeFlags |= child$74.flags), - (child$74.return = completedWork), - (child$74 = child$74.sibling); + for (child$75 = completedWork.child; null !== child$75; ) + (newChildLanes |= child$75.lanes | child$75.childLanes), + (subtreeFlags |= child$75.subtreeFlags), + (subtreeFlags |= child$75.flags), + (child$75.return = completedWork), + (child$75 = child$75.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -5485,11 +5519,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$78 = null; + var cache$79 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$78 = newProps.memoizedState.cachePool.pool); - cache$78 !== instance && (newProps.flags |= 2048); + (cache$79 = newProps.memoizedState.cachePool.pool); + cache$79 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -5515,8 +5549,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$78 = instance.rendering; - if (null === cache$78) + cache$79 = instance.rendering; + if (null === cache$79) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -5524,11 +5558,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$78 = findFirstSuspended(current); - if (null !== cache$78) { + cache$79 = findFirstSuspended(current); + if (null !== cache$79) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$78.updateQueue; + current = cache$79.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -5553,7 +5587,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$78)), null !== current)) { + if (((current = findFirstSuspended(cache$79)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -5563,7 +5597,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$78.alternate) + !cache$79.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -5575,13 +5609,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 8388608)); instance.isBackwards - ? ((cache$78.sibling = workInProgress.child), - (workInProgress.child = cache$78)) + ? ((cache$79.sibling = workInProgress.child), + (workInProgress.child = cache$79)) : ((current = instance.last), null !== current - ? (current.sibling = cache$78) - : (workInProgress.child = cache$78), - (instance.last = cache$78)); + ? (current.sibling = cache$79) + : (workInProgress.child = cache$79), + (instance.last = cache$79)); } if (null !== instance.tail) return ( @@ -5832,8 +5866,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$95) { - captureCommitPhaseError(current, nearestMountedAncestor, error$95); + } catch (error$96) { + captureCommitPhaseError(current, nearestMountedAncestor, error$96); } else ref.current = null; } @@ -6035,11 +6069,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$96) { + } catch (error$97) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$96 + error$97 ); } } @@ -6632,8 +6666,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$104) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$104); + } catch (error$105) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$105); } } break; @@ -6669,11 +6703,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null !== updatePayload || diffInCommitPhase) try { flags._applyProps(flags, newProps, current); - } catch (error$107) { + } catch (error$108) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$107 + error$108 ); } } @@ -6710,8 +6744,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$109) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$109); + } catch (error$110) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$110); } flags = finishedWork.updateQueue; null !== flags && @@ -6851,12 +6885,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$99 = JSCompiler_inline_result.stateNode.containerInfo, - before$100 = getHostSibling(finishedWork); + var parent$100 = JSCompiler_inline_result.stateNode.containerInfo, + before$101 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$100, - parent$99 + before$101, + parent$100 ); break; default: @@ -7317,9 +7351,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$118 = finishedWork.stateNode; + var instance$119 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$118._visibility & 4 + ? instance$119._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7332,7 +7366,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$118._visibility |= 4), + : ((instance$119._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7340,7 +7374,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$118._visibility |= 4), + : ((instance$119._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -7353,7 +7387,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$118 + instance$119 ); break; case 24: @@ -7764,8 +7798,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$1.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; return 0 !== fiber ? fiber : 32; @@ -7858,16 +7892,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$127 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$127 && - ((lanes = errorRetryLanes$127), + 0 !== errorRetryLanes$128 && + ((lanes = errorRetryLanes$128), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$127 + errorRetryLanes$128 ))); } if (1 === exitStatus) @@ -8030,8 +8064,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -8069,6 +8104,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -8149,8 +8185,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$129) { - handleThrow(root, thrownValue$129); + } catch (thrownValue$130) { + handleThrow(root, thrownValue$130); } while (1); resetContextDependencies(); @@ -8254,8 +8290,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$131) { - handleThrow(root, thrownValue$131); + } catch (thrownValue$132) { + handleThrow(root, thrownValue$132); } while (1); resetContextDependencies(); @@ -8317,7 +8353,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -8332,7 +8368,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -8430,10 +8466,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$35 = offscreenQueue.retryQueue; - null === retryQueue$35 + var retryQueue$36 = offscreenQueue.retryQueue; + null === retryQueue$36 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$35.add(wakeable); + : retryQueue$36.add(wakeable); } } break; @@ -9711,19 +9747,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1150 = { + devToolsConfig$jscomp$inline_1153 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-modern-cbca888b", + version: "18.3.0-www-modern-f1029d9d", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1315 = { - bundleType: devToolsConfig$jscomp$inline_1150.bundleType, - version: devToolsConfig$jscomp$inline_1150.version, - rendererPackageName: devToolsConfig$jscomp$inline_1150.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1150.rendererConfig, +var internals$jscomp$inline_1318 = { + bundleType: devToolsConfig$jscomp$inline_1153.bundleType, + version: devToolsConfig$jscomp$inline_1153.version, + rendererPackageName: devToolsConfig$jscomp$inline_1153.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1153.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9740,26 +9776,26 @@ var internals$jscomp$inline_1315 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1150.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1153.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-cbca888b" + reconcilerVersion: "18.3.0-www-modern-f1029d9d" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1316 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1316.isDisabled && - hook$jscomp$inline_1316.supportsFiber + !hook$jscomp$inline_1319.isDisabled && + hook$jscomp$inline_1319.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1316.inject( - internals$jscomp$inline_1315 + (rendererID = hook$jscomp$inline_1319.inject( + internals$jscomp$inline_1318 )), - (injectedHook = hook$jscomp$inline_1316); + (injectedHook = hook$jscomp$inline_1319); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 1f8785def5..2431ef7863 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -974,6 +974,12 @@ function isReplayingEvent(event) { return event === currentReplayingEvent; } +function useFormStatus() { + { + throw new Error("Not implemented."); + } +} + var valueStack = []; var fiberStack; @@ -1027,7 +1033,7 @@ function push(cursor, value, fiber) { var contextStackCursor$1 = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -1085,24 +1091,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor$1.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor$1, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); } // This module only exists as an ESM wrapper around the external CommonJS @@ -12284,8 +12287,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -12294,81 +12309,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -12830,6 +12898,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -12905,11 +12974,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -12919,7 +12989,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -13502,11 +13572,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -14398,14 +14468,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$3.transition = {}); if (enableTransitionTracing) { @@ -14421,16 +14497,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -14475,7 +14551,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -29453,9 +29529,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -30261,7 +30337,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -30318,10 +30394,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -31082,7 +31158,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -31128,7 +31204,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -32353,7 +32429,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); @@ -33891,7 +33967,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-bb796e31"; +var ReactVersion = "18.3.0-www-classic-841db413"; function createPortal$1( children, @@ -43458,9 +43534,12 @@ function preload$1(href, options) { var as = options.as; var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href); - var preloadKey = - 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; - var key = preloadKey; + var preloadSelector = + 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for + // an arbitrary type. Other preloads are keyed under the resource key they represent a preload for. + // Here we figure out which key to use to determine if we have a preload already. + + var key = preloadSelector; switch (as) { case "style": @@ -43476,7 +43555,21 @@ function preload$1(href, options) { var preloadProps = preloadPropsFromPreloadOptions(href, as, options); preloadPropsMap.set(key, preloadProps); - if (null === ownerDocument.querySelector(preloadKey)) { + if (null === ownerDocument.querySelector(preloadSelector)) { + if ( + as === "style" && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } else if ( + as === "script" && + ownerDocument.querySelector(getScriptSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } + var instance = ownerDocument.createElement("link"); setInitialProperties(instance, "link", preloadProps); markNodeAsHoistable(instance); @@ -43638,7 +43731,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } // This function is called in begin work and we should always have a currentDocument set @@ -46566,12 +46660,6 @@ function preinit(href, options) { // so we favor silent bailout over warning or erroring. } -function useFormStatus() { - { - throw new Error("Not implemented."); - } -} - { if ( typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index ee38db781e..7bfe758b66 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -107,6 +107,51 @@ function printWarning(level, format, args) { var assign = Object.assign; +// Re-export dynamic flags from the www version. +var dynamicFeatureFlags = require("ReactFeatureFlags"); + +var disableInputAttributeSyncing = + dynamicFeatureFlags.disableInputAttributeSyncing, + disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, + enableTrustedTypesIntegration = + dynamicFeatureFlags.enableTrustedTypesIntegration, + replayFailedUnitOfWorkWithInvokeGuardedCallback = + dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, + enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, + enableLazyContextPropagation = + dynamicFeatureFlags.enableLazyContextPropagation, + enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, + enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableCustomElementPropertySupport = + dynamicFeatureFlags.enableCustomElementPropertySupport, + enableDeferRootSchedulingToMicrotask = + dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, + diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, + enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build. +var enableProfilerTimer = true; +var enableProfilerCommitHooks = true; +var enableProfilerNestedUpdatePhase = true; +var enableProfilerNestedUpdateScheduledHook = + dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook; +var createRootStrictEffectsByDefault = false; +var enableClientRenderFallbackOnTextMismatch = false; + +var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation. +var enableSuspenseCallback = true; + +var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function useFormStatus() { + { + throw new Error("Not implemented."); + } +} + var valueStack = []; var fiberStack; @@ -158,9 +203,54 @@ function push(cursor, value, fiber) { cursor.current = value; } +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. +var REACT_ELEMENT_TYPE = Symbol.for("react.element"); +var REACT_PORTAL_TYPE = Symbol.for("react.portal"); +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); +var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); +var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); +var REACT_CONTEXT_TYPE = Symbol.for("react.context"); +var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); +var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); +var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); +var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); +var REACT_MEMO_TYPE = Symbol.for("react.memo"); +var REACT_LAZY_TYPE = Symbol.for("react.lazy"); +var REACT_SCOPE_TYPE = Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); +var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); +var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); +var REACT_CACHE_TYPE = Symbol.for("react.cache"); +var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); +var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( + "react.default_value" +); +var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); +var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = "@@iterator"; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + + var maybeIterator = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === "function") { + return maybeIterator; + } + + return null; +} + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -218,62 +308,23 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } -// Re-export dynamic flags from the www version. -var dynamicFeatureFlags = require("ReactFeatureFlags"); - -var disableInputAttributeSyncing = - dynamicFeatureFlags.disableInputAttributeSyncing, - disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, - enableTrustedTypesIntegration = - dynamicFeatureFlags.enableTrustedTypesIntegration, - replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, - enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, - enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableCustomElementPropertySupport = - dynamicFeatureFlags.enableCustomElementPropertySupport, - enableDeferRootSchedulingToMicrotask = - dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, - enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build. -var enableProfilerTimer = true; -var enableProfilerCommitHooks = true; -var enableProfilerNestedUpdatePhase = true; -var enableProfilerNestedUpdateScheduledHook = - dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook; -var createRootStrictEffectsByDefault = false; -var enableClientRenderFallbackOnTextMismatch = false; - -var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation. -var enableSuspenseCallback = true; - var NoFlags$1 = /* */ 0; @@ -2745,54 +2796,6 @@ function setValueForPropertyOnCustomComponent(node, name, value) { setValueForAttribute(node, name, value); } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -var REACT_ELEMENT_TYPE = Symbol.for("react.element"); -var REACT_PORTAL_TYPE = Symbol.for("react.portal"); -var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); -var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); -var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); -var REACT_CONTEXT_TYPE = Symbol.for("react.context"); -var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); -var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); -var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); -var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); -var REACT_MEMO_TYPE = Symbol.for("react.memo"); -var REACT_LAZY_TYPE = Symbol.for("react.lazy"); -var REACT_SCOPE_TYPE = Symbol.for("react.scope"); -var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); -var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); -var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); -var REACT_CACHE_TYPE = Symbol.for("react.cache"); -var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); -var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( - "react.default_value" -); -var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); -var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = "@@iterator"; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - - var maybeIterator = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === "function") { - return maybeIterator; - } - - return null; -} - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { @@ -12225,8 +12228,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -12235,81 +12250,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -12771,6 +12839,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -12846,11 +12915,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -12860,7 +12930,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -13443,11 +13513,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -14339,14 +14409,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$3.transition = {}); if (enableTransitionTracing) { @@ -14362,16 +14438,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -14416,7 +14492,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -29303,9 +29379,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -30111,7 +30187,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -30168,10 +30244,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -30927,7 +31003,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -30973,7 +31049,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -32198,7 +32274,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); @@ -33736,7 +33812,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-cbca888b"; +var ReactVersion = "18.3.0-www-modern-f1029d9d"; function createPortal$1( children, @@ -43968,9 +44044,12 @@ function preload$1(href, options) { var as = options.as; var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href); - var preloadKey = - 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; - var key = preloadKey; + var preloadSelector = + 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for + // an arbitrary type. Other preloads are keyed under the resource key they represent a preload for. + // Here we figure out which key to use to determine if we have a preload already. + + var key = preloadSelector; switch (as) { case "style": @@ -43986,7 +44065,21 @@ function preload$1(href, options) { var preloadProps = preloadPropsFromPreloadOptions(href, as, options); preloadPropsMap.set(key, preloadProps); - if (null === ownerDocument.querySelector(preloadKey)) { + if (null === ownerDocument.querySelector(preloadSelector)) { + if ( + as === "style" && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } else if ( + as === "script" && + ownerDocument.querySelector(getScriptSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } + var instance = ownerDocument.createElement("link"); setInitialProperties(instance, "link", preloadProps); markNodeAsHoistable(instance); @@ -44148,7 +44241,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } // This function is called in begin work and we should always have a currentDocument set @@ -45655,12 +45749,6 @@ function preinit(href, options) { // so we favor silent bailout over warning or erroring. } -function useFormStatus() { - { - throw new Error("Not implemented."); - } -} - { if ( typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 069fad840f..a1f4faa91b 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -3274,57 +3274,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$45 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$45); - return asyncAction$45; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$46 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$46.status = "fulfilled"; + resultThenable$46.value = finishedState; + }); + return resultThenable$46; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3396,6 +3419,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3420,12 +3444,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3660,12 +3688,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3718,10 +3746,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -3948,13 +3976,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -3964,9 +3998,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -3989,14 +4023,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$51 = enqueueUpdate(provider, fiber, lane); - null !== root$51 && - (scheduleUpdateOnFiber(root$51, provider, lane), - entangleTransitions(root$51, provider, lane)); + var root$52 = enqueueUpdate(provider, fiber, lane); + null !== root$52 && + (scheduleUpdateOnFiber(root$52, provider, lane), + entangleTransitions(root$52, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$51 && + null !== root$52 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4177,7 +4211,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4199,15 +4233,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$47 = workInProgressRoot; - if (null === root$47) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$47, renderLanes$1) || + var root$48 = workInProgressRoot; + if (null === root$48) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$48, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$47 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$47; - mountEffect(subscribeToStore.bind(null, fiber, root$47, subscribe), [ + root$48 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$48; + mountEffect(subscribeToStore.bind(null, fiber, root$48, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4216,7 +4250,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$47, + root$48, getServerSnapshot, getSnapshot ), @@ -4721,10 +4755,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$62 = workInProgress.stateNode; + root$63 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$62.incompleteTransitions.has(transition)) { + if (!root$63.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4732,11 +4766,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$62.incompleteTransitions.set(transition, markerInstance); + root$63.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$62.incompleteTransitions.forEach(function (markerInstance) { + root$63.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5433,14 +5467,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$69 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$69) + var dehydrated$70 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$70) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$69, + dehydrated$70, JSCompiler_temp, renderLanes ); @@ -5450,7 +5484,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$69 = JSCompiler_temp.sibling; + dehydrated$70 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5459,8 +5493,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$69 - ? (showFallback = createWorkInProgress(dehydrated$69, showFallback)) + null !== dehydrated$70 + ? (showFallback = createWorkInProgress(dehydrated$70, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5479,10 +5513,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$69 = CacheContext._currentValue), + ? ((dehydrated$70 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$69 - ? { parent: dehydrated$69, pool: dehydrated$69 } + JSCompiler_temp.parent !== dehydrated$70 + ? { parent: dehydrated$70, pool: dehydrated$70 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5496,23 +5530,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$69 = showFallback.updateQueue), + (dehydrated$70 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$69 + null === dehydrated$70 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$69 === primaryChildProps + : dehydrated$70 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$69.transitions = didSuspend), - (dehydrated$69.markerInstances = JSCompiler_temp)))); + : ((dehydrated$70.transitions = didSuspend), + (dehydrated$70.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6579,14 +6613,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6596,19 +6630,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags & 31457280), + (subtreeFlags |= child$102.flags & 31457280), + (child$102.return = completedWork), + (child$102 = child$102.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags), + (subtreeFlags |= child$102.flags), + (child$102.return = completedWork), + (child$102 = child$102.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7354,8 +7388,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$131) { - captureCommitPhaseError(current, nearestMountedAncestor, error$131); + } catch (error$132) { + captureCommitPhaseError(current, nearestMountedAncestor, error$132); } else ref.current = null; } @@ -7392,7 +7426,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$187) { + } catch (e$188) { JSCompiler_temp = null; break a; } @@ -7658,11 +7692,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$133) { + } catch (error$134) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$133 + error$134 ); } } @@ -8342,8 +8376,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$146) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$146); + } catch (error$147) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$147); } } break; @@ -8525,11 +8559,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$147) { + } catch (error$148) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$147 + error$148 ); } break; @@ -8565,8 +8599,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$148) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$148); + } catch (error$149) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$149); } } if ( @@ -8591,8 +8625,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$151) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$151); + } catch (error$152) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$152); } break; case 6: @@ -8605,8 +8639,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); + } catch (error$153) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$153); } } break; @@ -8620,8 +8654,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$153) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$153); + } catch (error$154) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$154); } break; case 4: @@ -8651,8 +8685,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$155) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$155); + } catch (error$156) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$156); } current = finishedWork.updateQueue; null !== current && @@ -8730,11 +8764,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$136) { + } catch (error$137) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$136 + error$137 ); } } else if ( @@ -8809,21 +8843,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$137 = JSCompiler_inline_result.stateNode; + var parent$138 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$137, ""), + (setTextContent(parent$138, ""), (JSCompiler_inline_result.flags &= -33)); - var before$138 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$138, parent$137); + var before$139 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$139, parent$138); break; case 3: case 4: - var parent$139 = JSCompiler_inline_result.stateNode.containerInfo, - before$140 = getHostSibling(finishedWork); + var parent$140 = JSCompiler_inline_result.stateNode.containerInfo, + before$141 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$140, - parent$139 + before$141, + parent$140 ); break; default: @@ -9293,9 +9327,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$165 = finishedWork.stateNode; + var instance$166 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$165._visibility & 4 + ? instance$166._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9308,7 +9342,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$165._visibility |= 4), + : ((instance$166._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9316,7 +9350,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$165._visibility |= 4), + : ((instance$166._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9329,7 +9363,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$165 + instance$166 ); break; case 24: @@ -9760,8 +9794,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -9857,16 +9891,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$174 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$175 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$174 && - ((lanes = errorRetryLanes$174), + 0 !== errorRetryLanes$175 && + ((lanes = errorRetryLanes$175), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$174 + errorRetryLanes$175 ))); } if (1 === exitStatus) @@ -10075,8 +10109,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -10114,6 +10149,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10197,8 +10233,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$176) { - handleThrow(root, thrownValue$176); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); resetContextDependencies(); @@ -10302,8 +10338,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$178) { - handleThrow(root, thrownValue$178); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); resetContextDependencies(); @@ -10369,7 +10405,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -10384,7 +10420,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -10470,10 +10506,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$57 = offscreenQueue.retryQueue; - null === retryQueue$57 + var retryQueue$58 = offscreenQueue.retryQueue; + null === retryQueue$58 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$57.add(wakeable); + : retryQueue$58.add(wakeable); } } break; @@ -10657,12 +10693,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$182 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$183 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$182 && + shouldFireAfterActiveInstanceBlur$183 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -10741,7 +10777,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$183 = rootWithPendingPassiveEffects, + var root$184 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -10757,7 +10793,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$183, remainingLanes); + releaseRootPooledCache(root$184, remainingLanes); } } return !1; @@ -12053,12 +12089,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$185 = fiber.stateNode; - if (root$185.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$185.pendingLanes); + var root$186 = fiber.stateNode; + if (root$186.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$186.pendingLanes); 0 !== lanes && - (markRootEntangled(root$185, lanes | 2), - ensureRootIsScheduled(root$185), + (markRootEntangled(root$186, lanes | 2), + ensureRootIsScheduled(root$186), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -12624,19 +12660,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$373; + var JSCompiler_inline_result$jscomp$374; if (canUseDOM) { - var isSupported$jscomp$inline_1604 = "oninput" in document; - if (!isSupported$jscomp$inline_1604) { - var element$jscomp$inline_1605 = document.createElement("div"); - element$jscomp$inline_1605.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1604 = - "function" === typeof element$jscomp$inline_1605.oninput; + var isSupported$jscomp$inline_1607 = "oninput" in document; + if (!isSupported$jscomp$inline_1607) { + var element$jscomp$inline_1608 = document.createElement("div"); + element$jscomp$inline_1608.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1607 = + "function" === typeof element$jscomp$inline_1608.oninput; } - JSCompiler_inline_result$jscomp$373 = isSupported$jscomp$inline_1604; - } else JSCompiler_inline_result$jscomp$373 = !1; + JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1607; + } else JSCompiler_inline_result$jscomp$374 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$373 && + JSCompiler_inline_result$jscomp$374 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -12945,20 +12981,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1645 = 0; - i$jscomp$inline_1645 < simpleEventPluginEvents.length; - i$jscomp$inline_1645++ + var i$jscomp$inline_1648 = 0; + i$jscomp$inline_1648 < simpleEventPluginEvents.length; + i$jscomp$inline_1648++ ) { - var eventName$jscomp$inline_1646 = - simpleEventPluginEvents[i$jscomp$inline_1645], - domEventName$jscomp$inline_1647 = - eventName$jscomp$inline_1646.toLowerCase(), - capitalizedEvent$jscomp$inline_1648 = - eventName$jscomp$inline_1646[0].toUpperCase() + - eventName$jscomp$inline_1646.slice(1); + var eventName$jscomp$inline_1649 = + simpleEventPluginEvents[i$jscomp$inline_1648], + domEventName$jscomp$inline_1650 = + eventName$jscomp$inline_1649.toLowerCase(), + capitalizedEvent$jscomp$inline_1651 = + eventName$jscomp$inline_1649[0].toUpperCase() + + eventName$jscomp$inline_1649.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1647, - "on" + capitalizedEvent$jscomp$inline_1648 + domEventName$jscomp$inline_1650, + "on" + capitalizedEvent$jscomp$inline_1651 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14374,14 +14410,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$214 in nextProps) { - var propKey = nextProps[propKey$214]; - lastProp = lastProps[propKey$214]; + for (var propKey$215 in nextProps) { + var propKey = nextProps[propKey$215]; + lastProp = lastProps[propKey$215]; if ( - nextProps.hasOwnProperty(propKey$214) && + nextProps.hasOwnProperty(propKey$215) && (null != propKey || null != lastProp) ) - switch (propKey$214) { + switch (propKey$215) { case "type": type = propKey; break; @@ -14410,7 +14446,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$214, + propKey$215, propKey, nextProps, lastProp @@ -14429,7 +14465,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$214 = null; + defaultValue = value = propKey = propKey$215 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14460,7 +14496,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$214 = type; + propKey$215 = type; break; case "defaultValue": propKey = type; @@ -14478,10 +14514,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$214, propKey, value, defaultValue); + updateSelect(domElement, propKey$215, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$214 = null; + propKey = propKey$215 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14505,7 +14541,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$214 = name; + propKey$215 = name; break; case "defaultValue": propKey = name; @@ -14519,17 +14555,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$214, propKey); + updateTextarea(domElement, propKey$215, propKey); return; case "option": - for (var propKey$230 in lastProps) + for (var propKey$231 in lastProps) if ( - ((propKey$214 = lastProps[propKey$230]), - lastProps.hasOwnProperty(propKey$230) && - null != propKey$214 && - !nextProps.hasOwnProperty(propKey$230)) + ((propKey$215 = lastProps[propKey$231]), + lastProps.hasOwnProperty(propKey$231) && + null != propKey$215 && + !nextProps.hasOwnProperty(propKey$231)) ) - switch (propKey$230) { + switch (propKey$231) { case "selected": domElement.selected = !1; break; @@ -14537,33 +14573,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$230, + propKey$231, null, nextProps, - propKey$214 + propKey$215 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$214 = nextProps[lastDefaultValue]), + ((propKey$215 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$214 !== propKey && - (null != propKey$214 || null != propKey)) + propKey$215 !== propKey && + (null != propKey$215 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$214 && - "function" !== typeof propKey$214 && - "symbol" !== typeof propKey$214; + propKey$215 && + "function" !== typeof propKey$215 && + "symbol" !== typeof propKey$215; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$214, + propKey$215, nextProps, propKey ); @@ -14584,24 +14620,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$235 in lastProps) - (propKey$214 = lastProps[propKey$235]), - lastProps.hasOwnProperty(propKey$235) && - null != propKey$214 && - !nextProps.hasOwnProperty(propKey$235) && - setProp(domElement, tag, propKey$235, null, nextProps, propKey$214); + for (var propKey$236 in lastProps) + (propKey$215 = lastProps[propKey$236]), + lastProps.hasOwnProperty(propKey$236) && + null != propKey$215 && + !nextProps.hasOwnProperty(propKey$236) && + setProp(domElement, tag, propKey$236, null, nextProps, propKey$215); for (checked in nextProps) if ( - ((propKey$214 = nextProps[checked]), + ((propKey$215 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$214 !== propKey && - (null != propKey$214 || null != propKey)) + propKey$215 !== propKey && + (null != propKey$215 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$214) + if (null != propKey$215) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14609,7 +14645,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$214, + propKey$215, nextProps, propKey ); @@ -14617,49 +14653,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$240 in lastProps) - (propKey$214 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && - null != propKey$214 && - !nextProps.hasOwnProperty(propKey$240) && + for (var propKey$241 in lastProps) + (propKey$215 = lastProps[propKey$241]), + lastProps.hasOwnProperty(propKey$241) && + null != propKey$215 && + !nextProps.hasOwnProperty(propKey$241) && setPropOnCustomElement( domElement, tag, - propKey$240, + propKey$241, null, nextProps, - propKey$214 + propKey$215 ); for (defaultChecked in nextProps) - (propKey$214 = nextProps[defaultChecked]), + (propKey$215 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$214 === propKey || - (null == propKey$214 && null == propKey) || + propKey$215 === propKey || + (null == propKey$215 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$214, + propKey$215, nextProps, propKey ); return; } } - for (var propKey$245 in lastProps) - (propKey$214 = lastProps[propKey$245]), - lastProps.hasOwnProperty(propKey$245) && - null != propKey$214 && - !nextProps.hasOwnProperty(propKey$245) && - setProp(domElement, tag, propKey$245, null, nextProps, propKey$214); + for (var propKey$246 in lastProps) + (propKey$215 = lastProps[propKey$246]), + lastProps.hasOwnProperty(propKey$246) && + null != propKey$215 && + !nextProps.hasOwnProperty(propKey$246) && + setProp(domElement, tag, propKey$246, null, nextProps, propKey$215); for (lastProp in nextProps) - (propKey$214 = nextProps[lastProp]), + (propKey$215 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$214 === propKey || - (null == propKey$214 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$214, nextProps, propKey); + propKey$215 === propKey || + (null == propKey$215 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$215, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15177,11 +15213,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -15250,7 +15290,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -15294,17 +15335,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$279 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$280 = styles$279.get(type); - resource$280 || + var styles$280 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$281 = styles$280.get(type); + resource$281 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$280 = { + (resource$281 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$279.set(type, resource$280), + styles$280.set(type, resource$281), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15319,9 +15360,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$280.state + resource$281.state )); - return resource$280; + return resource$281; } return null; case "script": @@ -15401,36 +15442,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$284 = hoistableRoot.querySelector( + var instance$285 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$284) + if (instance$285) return ( - (resource.instance = instance$284), - markNodeAsHoistable(instance$284), - instance$284 + (resource.instance = instance$285), + markNodeAsHoistable(instance$285), + instance$285 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$284 = ( + instance$285 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$284); - var linkInstance = instance$284; + markNodeAsHoistable(instance$285); + var linkInstance = instance$285; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$284, "link", instance); + setInitialProperties(instance$285, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$284, props.precedence, hoistableRoot); - return (resource.instance = instance$284); + insertStylesheet(instance$285, props.precedence, hoistableRoot); + return (resource.instance = instance$285); case "script": - instance$284 = getScriptKey(props.src); + instance$285 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$284 + "script[async]" + instance$285 )) ) return ( @@ -15439,7 +15480,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$284))) + if ((styleProps = preloadPropsMap.get(instance$285))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16391,11 +16432,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$304); + var instance = getPublicRootInstance(root$305); originalCallback.call(instance); }; } - var root$304 = createHydrationContainer( + var root$305 = createHydrationContainer( initialChildren, callback, container, @@ -16407,23 +16448,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$304; - container[internalContainerInstanceKey] = root$304.current; + container._reactRootContainer = root$305; + container[internalContainerInstanceKey] = root$305.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$304; + return root$305; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$305 = callback; + var originalCallback$306 = callback; callback = function () { - var instance = getPublicRootInstance(root$306); - originalCallback$305.call(instance); + var instance = getPublicRootInstance(root$307); + originalCallback$306.call(instance); }; } - var root$306 = createFiberRoot( + var root$307 = createFiberRoot( container, 0, !1, @@ -16435,15 +16476,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$306; - container[internalContainerInstanceKey] = root$306.current; + container._reactRootContainer = root$307; + container[internalContainerInstanceKey] = root$307.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$306, parentComponent, callback); + updateContainer(initialChildren, root$307, parentComponent, callback); }); - return root$306; + return root$307; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -16503,17 +16544,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1855 = { +var devToolsConfig$jscomp$inline_1858 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-030d47ad", + version: "18.3.0-www-classic-d13e8404", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2219 = { - bundleType: devToolsConfig$jscomp$inline_1855.bundleType, - version: devToolsConfig$jscomp$inline_1855.version, - rendererPackageName: devToolsConfig$jscomp$inline_1855.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1855.rendererConfig, +var internals$jscomp$inline_2222 = { + bundleType: devToolsConfig$jscomp$inline_1858.bundleType, + version: devToolsConfig$jscomp$inline_1858.version, + rendererPackageName: devToolsConfig$jscomp$inline_1858.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1858.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16529,26 +16570,26 @@ var internals$jscomp$inline_2219 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1855.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1858.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-030d47ad" + reconcilerVersion: "18.3.0-www-classic-d13e8404" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2220 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2223 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2220.isDisabled && - hook$jscomp$inline_2220.supportsFiber + !hook$jscomp$inline_2223.isDisabled && + hook$jscomp$inline_2223.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2220.inject( - internals$jscomp$inline_2219 + (rendererID = hook$jscomp$inline_2223.inject( + internals$jscomp$inline_2222 )), - (injectedHook = hook$jscomp$inline_2220); + (injectedHook = hook$jscomp$inline_2223); } catch (err) {} } assign(Internals, { @@ -16779,4 +16820,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-030d47ad"; +exports.version = "18.3.0-www-classic-d13e8404"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 8746a13c1d..442eaca59a 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -38,6 +38,29 @@ function formatProdErrorMessage(code) { ); } var assign = Object.assign, + dynamicFeatureFlags = require("ReactFeatureFlags"), + disableInputAttributeSyncing = + dynamicFeatureFlags.disableInputAttributeSyncing, + disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, + enableTrustedTypesIntegration = + dynamicFeatureFlags.enableTrustedTypesIntegration, + enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, + enableLazyContextPropagation = + dynamicFeatureFlags.enableLazyContextPropagation, + enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, + enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableCustomElementPropertySupport = + dynamicFeatureFlags.enableCustomElementPropertySupport, + enableDeferRootSchedulingToMicrotask = + dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, + diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, + enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -52,6 +75,37 @@ function push(cursor, value) { valueStack[index] = cursor.current; cursor.current = value; } +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( + "react.default_value" + ), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null); @@ -108,28 +162,7 @@ function popHostContext(fiber) { contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor)); } -var dynamicFeatureFlags = require("ReactFeatureFlags"), - disableInputAttributeSyncing = - dynamicFeatureFlags.disableInputAttributeSyncing, - disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, - enableTrustedTypesIntegration = - dynamicFeatureFlags.enableTrustedTypesIntegration, - enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, - enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableCustomElementPropertySupport = - dynamicFeatureFlags.enableCustomElementPropertySupport, - enableDeferRootSchedulingToMicrotask = - dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, - enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -140,8 +173,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, - ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null; function onCommitRoot(root) { @@ -601,37 +632,6 @@ function setValueForNamespacedAttribute(node, namespace, name, value) { ); } } -var REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_CACHE_TYPE = Symbol.for("react.cache"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( - "react.default_value" - ), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} var prefix; function describeBuiltInComponentFrame(name) { if (void 0 === prefix) @@ -3167,57 +3167,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$45 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$45); - return asyncAction$45; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$46 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$46.status = "fulfilled"; + resultThenable$46.value = finishedState; + }); + return resultThenable$46; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3289,6 +3312,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3313,12 +3337,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3553,12 +3581,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3611,10 +3639,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -3841,13 +3869,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -3857,9 +3891,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -3882,14 +3916,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$51 = enqueueUpdate(provider, fiber, lane); - null !== root$51 && - (scheduleUpdateOnFiber(root$51, provider, lane), - entangleTransitions(root$51, provider, lane)); + var root$52 = enqueueUpdate(provider, fiber, lane); + null !== root$52 && + (scheduleUpdateOnFiber(root$52, provider, lane), + entangleTransitions(root$52, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$51 && + null !== root$52 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4070,7 +4104,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4092,15 +4126,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$47 = workInProgressRoot; - if (null === root$47) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$47, renderLanes$1) || + var root$48 = workInProgressRoot; + if (null === root$48) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$48, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$47 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$47; - mountEffect(subscribeToStore.bind(null, fiber, root$47, subscribe), [ + root$48 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$48; + mountEffect(subscribeToStore.bind(null, fiber, root$48, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4109,7 +4143,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$47, + root$48, getServerSnapshot, getSnapshot ), @@ -4599,10 +4633,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$62 = workInProgress.stateNode; + root$63 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$62.incompleteTransitions.has(transition)) { + if (!root$63.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4610,11 +4644,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$62.incompleteTransitions.set(transition, markerInstance); + root$63.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$62.incompleteTransitions.forEach(function (markerInstance) { + root$63.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5279,14 +5313,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$69 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$69) + var dehydrated$70 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$70) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$69, + dehydrated$70, JSCompiler_temp, renderLanes ); @@ -5296,7 +5330,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$69 = JSCompiler_temp.sibling; + dehydrated$70 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5305,8 +5339,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$69 - ? (showFallback = createWorkInProgress(dehydrated$69, showFallback)) + null !== dehydrated$70 + ? (showFallback = createWorkInProgress(dehydrated$70, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5325,10 +5359,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$69 = CacheContext._currentValue), + ? ((dehydrated$70 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$69 - ? { parent: dehydrated$69, pool: dehydrated$69 } + JSCompiler_temp.parent !== dehydrated$70 + ? { parent: dehydrated$70, pool: dehydrated$70 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5342,23 +5376,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$69 = showFallback.updateQueue), + (dehydrated$70 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$69 + null === dehydrated$70 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$69 === primaryChildProps + : dehydrated$70 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$69.transitions = didSuspend), - (dehydrated$69.markerInstances = JSCompiler_temp)))); + : ((dehydrated$70.transitions = didSuspend), + (dehydrated$70.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6421,14 +6455,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6438,19 +6472,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags & 31457280), + (subtreeFlags |= child$102.flags & 31457280), + (child$102.return = completedWork), + (child$102 = child$102.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags), + (subtreeFlags |= child$102.flags), + (child$102.return = completedWork), + (child$102 = child$102.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7177,8 +7211,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$130) { - captureCommitPhaseError(current, nearestMountedAncestor, error$130); + } catch (error$131) { + captureCommitPhaseError(current, nearestMountedAncestor, error$131); } else ref.current = null; } @@ -7215,7 +7249,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$191) { + } catch (e$192) { JSCompiler_temp = null; break a; } @@ -7494,11 +7528,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$132) { + } catch (error$133) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$132 + error$133 ); } } @@ -8178,8 +8212,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$145) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$145); + } catch (error$146) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$146); } } break; @@ -8361,11 +8395,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$146) { + } catch (error$147) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$146 + error$147 ); } break; @@ -8401,8 +8435,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$147) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$147); + } catch (error$148) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$148); } } if ( @@ -8427,8 +8461,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$150) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$150); + } catch (error$151) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$151); } break; case 6: @@ -8441,8 +8475,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$151) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$151); + } catch (error$152) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$152); } } break; @@ -8456,8 +8490,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); + } catch (error$153) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$153); } break; case 4: @@ -8487,8 +8521,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$154) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$154); + } catch (error$155) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$155); } current = finishedWork.updateQueue; null !== current && @@ -8566,11 +8600,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$135) { + } catch (error$136) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$135 + error$136 ); } } else if ( @@ -8645,21 +8679,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$136 = JSCompiler_inline_result.stateNode; + var parent$137 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$136, ""), + (setTextContent(parent$137, ""), (JSCompiler_inline_result.flags &= -33)); - var before$137 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$137, parent$136); + var before$138 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$138, parent$137); break; case 3: case 4: - var parent$138 = JSCompiler_inline_result.stateNode.containerInfo, - before$139 = getHostSibling(finishedWork); + var parent$139 = JSCompiler_inline_result.stateNode.containerInfo, + before$140 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$139, - parent$138 + before$140, + parent$139 ); break; default: @@ -9129,9 +9163,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$164 = finishedWork.stateNode; + var instance$165 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$164._visibility & 4 + ? instance$165._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9144,7 +9178,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$164._visibility |= 4), + : ((instance$165._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9152,7 +9186,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$164._visibility |= 4), + : ((instance$165._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9165,7 +9199,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$164 + instance$165 ); break; case 24: @@ -9596,8 +9630,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -9693,16 +9727,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$173 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$174 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$173 && - ((lanes = errorRetryLanes$173), + 0 !== errorRetryLanes$174 && + ((lanes = errorRetryLanes$174), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$173 + errorRetryLanes$174 ))); } if (1 === exitStatus) @@ -9911,8 +9945,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -9950,6 +9985,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10033,8 +10069,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$175) { - handleThrow(root, thrownValue$175); + } catch (thrownValue$176) { + handleThrow(root, thrownValue$176); } while (1); resetContextDependencies(); @@ -10138,8 +10174,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$177) { - handleThrow(root, thrownValue$177); + } catch (thrownValue$178) { + handleThrow(root, thrownValue$178); } while (1); resetContextDependencies(); @@ -10201,7 +10237,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -10216,7 +10252,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -10302,10 +10338,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$57 = offscreenQueue.retryQueue; - null === retryQueue$57 + var retryQueue$58 = offscreenQueue.retryQueue; + null === retryQueue$58 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$57.add(wakeable); + : retryQueue$58.add(wakeable); } } break; @@ -10489,12 +10525,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$181 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$182 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$181 && + shouldFireAfterActiveInstanceBlur$182 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -10573,7 +10609,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$182 = rootWithPendingPassiveEffects, + var root$183 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -10589,7 +10625,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$182, remainingLanes); + releaseRootPooledCache(root$183, remainingLanes); } } return !1; @@ -11772,12 +11808,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$184 = fiber.stateNode; - if (root$184.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$184.pendingLanes); + var root$185 = fiber.stateNode; + if (root$185.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$185.pendingLanes); 0 !== lanes && - (markRootEntangled(root$184, lanes | 2), - ensureRootIsScheduled(root$184), + (markRootEntangled(root$185, lanes | 2), + ensureRootIsScheduled(root$185), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -12867,19 +12903,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$371; + var JSCompiler_inline_result$jscomp$372; if (canUseDOM) { - var isSupported$jscomp$inline_1603 = "oninput" in document; - if (!isSupported$jscomp$inline_1603) { - var element$jscomp$inline_1604 = document.createElement("div"); - element$jscomp$inline_1604.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1603 = - "function" === typeof element$jscomp$inline_1604.oninput; + var isSupported$jscomp$inline_1606 = "oninput" in document; + if (!isSupported$jscomp$inline_1606) { + var element$jscomp$inline_1607 = document.createElement("div"); + element$jscomp$inline_1607.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1606 = + "function" === typeof element$jscomp$inline_1607.oninput; } - JSCompiler_inline_result$jscomp$371 = isSupported$jscomp$inline_1603; - } else JSCompiler_inline_result$jscomp$371 = !1; + JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1606; + } else JSCompiler_inline_result$jscomp$372 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$371 && + JSCompiler_inline_result$jscomp$372 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13188,20 +13224,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1644 = 0; - i$jscomp$inline_1644 < simpleEventPluginEvents.length; - i$jscomp$inline_1644++ + var i$jscomp$inline_1647 = 0; + i$jscomp$inline_1647 < simpleEventPluginEvents.length; + i$jscomp$inline_1647++ ) { - var eventName$jscomp$inline_1645 = - simpleEventPluginEvents[i$jscomp$inline_1644], - domEventName$jscomp$inline_1646 = - eventName$jscomp$inline_1645.toLowerCase(), - capitalizedEvent$jscomp$inline_1647 = - eventName$jscomp$inline_1645[0].toUpperCase() + - eventName$jscomp$inline_1645.slice(1); + var eventName$jscomp$inline_1648 = + simpleEventPluginEvents[i$jscomp$inline_1647], + domEventName$jscomp$inline_1649 = + eventName$jscomp$inline_1648.toLowerCase(), + capitalizedEvent$jscomp$inline_1650 = + eventName$jscomp$inline_1648[0].toUpperCase() + + eventName$jscomp$inline_1648.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1646, - "on" + capitalizedEvent$jscomp$inline_1647 + domEventName$jscomp$inline_1649, + "on" + capitalizedEvent$jscomp$inline_1650 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14616,14 +14652,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$218 in nextProps) { - var propKey = nextProps[propKey$218]; - lastProp = lastProps[propKey$218]; + for (var propKey$219 in nextProps) { + var propKey = nextProps[propKey$219]; + lastProp = lastProps[propKey$219]; if ( - nextProps.hasOwnProperty(propKey$218) && + nextProps.hasOwnProperty(propKey$219) && (null != propKey || null != lastProp) ) - switch (propKey$218) { + switch (propKey$219) { case "type": type = propKey; break; @@ -14652,7 +14688,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$218, + propKey$219, propKey, nextProps, lastProp @@ -14671,7 +14707,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$218 = null; + defaultValue = value = propKey = propKey$219 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14702,7 +14738,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$218 = type; + propKey$219 = type; break; case "defaultValue": propKey = type; @@ -14720,10 +14756,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$218, propKey, value, defaultValue); + updateSelect(domElement, propKey$219, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$218 = null; + propKey = propKey$219 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14747,7 +14783,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$218 = name; + propKey$219 = name; break; case "defaultValue": propKey = name; @@ -14761,17 +14797,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$218, propKey); + updateTextarea(domElement, propKey$219, propKey); return; case "option": - for (var propKey$234 in lastProps) + for (var propKey$235 in lastProps) if ( - ((propKey$218 = lastProps[propKey$234]), - lastProps.hasOwnProperty(propKey$234) && - null != propKey$218 && - !nextProps.hasOwnProperty(propKey$234)) + ((propKey$219 = lastProps[propKey$235]), + lastProps.hasOwnProperty(propKey$235) && + null != propKey$219 && + !nextProps.hasOwnProperty(propKey$235)) ) - switch (propKey$234) { + switch (propKey$235) { case "selected": domElement.selected = !1; break; @@ -14779,33 +14815,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$234, + propKey$235, null, nextProps, - propKey$218 + propKey$219 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$218 = nextProps[lastDefaultValue]), + ((propKey$219 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$218 !== propKey && - (null != propKey$218 || null != propKey)) + propKey$219 !== propKey && + (null != propKey$219 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$218 && - "function" !== typeof propKey$218 && - "symbol" !== typeof propKey$218; + propKey$219 && + "function" !== typeof propKey$219 && + "symbol" !== typeof propKey$219; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$218, + propKey$219, nextProps, propKey ); @@ -14826,24 +14862,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$239 in lastProps) - (propKey$218 = lastProps[propKey$239]), - lastProps.hasOwnProperty(propKey$239) && - null != propKey$218 && - !nextProps.hasOwnProperty(propKey$239) && - setProp(domElement, tag, propKey$239, null, nextProps, propKey$218); + for (var propKey$240 in lastProps) + (propKey$219 = lastProps[propKey$240]), + lastProps.hasOwnProperty(propKey$240) && + null != propKey$219 && + !nextProps.hasOwnProperty(propKey$240) && + setProp(domElement, tag, propKey$240, null, nextProps, propKey$219); for (checked in nextProps) if ( - ((propKey$218 = nextProps[checked]), + ((propKey$219 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$218 !== propKey && - (null != propKey$218 || null != propKey)) + propKey$219 !== propKey && + (null != propKey$219 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$218) + if (null != propKey$219) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14851,7 +14887,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$218, + propKey$219, nextProps, propKey ); @@ -14859,49 +14895,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$244 in lastProps) - (propKey$218 = lastProps[propKey$244]), - lastProps.hasOwnProperty(propKey$244) && - null != propKey$218 && - !nextProps.hasOwnProperty(propKey$244) && + for (var propKey$245 in lastProps) + (propKey$219 = lastProps[propKey$245]), + lastProps.hasOwnProperty(propKey$245) && + null != propKey$219 && + !nextProps.hasOwnProperty(propKey$245) && setPropOnCustomElement( domElement, tag, - propKey$244, + propKey$245, null, nextProps, - propKey$218 + propKey$219 ); for (defaultChecked in nextProps) - (propKey$218 = nextProps[defaultChecked]), + (propKey$219 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$218 === propKey || - (null == propKey$218 && null == propKey) || + propKey$219 === propKey || + (null == propKey$219 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$218, + propKey$219, nextProps, propKey ); return; } } - for (var propKey$249 in lastProps) - (propKey$218 = lastProps[propKey$249]), - lastProps.hasOwnProperty(propKey$249) && - null != propKey$218 && - !nextProps.hasOwnProperty(propKey$249) && - setProp(domElement, tag, propKey$249, null, nextProps, propKey$218); + for (var propKey$250 in lastProps) + (propKey$219 = lastProps[propKey$250]), + lastProps.hasOwnProperty(propKey$250) && + null != propKey$219 && + !nextProps.hasOwnProperty(propKey$250) && + setProp(domElement, tag, propKey$250, null, nextProps, propKey$219); for (lastProp in nextProps) - (propKey$218 = nextProps[lastProp]), + (propKey$219 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$218 === propKey || - (null == propKey$218 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$218, nextProps, propKey); + propKey$219 === propKey || + (null == propKey$219 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$219, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15405,11 +15441,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -15478,7 +15518,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -15522,17 +15563,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$283 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$284 = styles$283.get(type); - resource$284 || + var styles$284 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$285 = styles$284.get(type); + resource$285 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$284 = { + (resource$285 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$283.set(type, resource$284), + styles$284.set(type, resource$285), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15547,9 +15588,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$284.state + resource$285.state )); - return resource$284; + return resource$285; } return null; case "script": @@ -15629,36 +15670,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$288 = hoistableRoot.querySelector( + var instance$289 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$288) + if (instance$289) return ( - (resource.instance = instance$288), - markNodeAsHoistable(instance$288), - instance$288 + (resource.instance = instance$289), + markNodeAsHoistable(instance$289), + instance$289 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$288 = ( + instance$289 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$288); - var linkInstance = instance$288; + markNodeAsHoistable(instance$289); + var linkInstance = instance$289; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$288, "link", instance); + setInitialProperties(instance$289, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$288, props.precedence, hoistableRoot); - return (resource.instance = instance$288); + insertStylesheet(instance$289, props.precedence, hoistableRoot); + return (resource.instance = instance$289); case "script": - instance$288 = getScriptKey(props.src); + instance$289 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$288 + "script[async]" + instance$289 )) ) return ( @@ -15667,7 +15708,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$288))) + if ((styleProps = preloadPropsMap.get(instance$289))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16030,17 +16071,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1814 = { +var devToolsConfig$jscomp$inline_1817 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-a0706321", + version: "18.3.0-www-modern-800ed34d", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2183 = { - bundleType: devToolsConfig$jscomp$inline_1814.bundleType, - version: devToolsConfig$jscomp$inline_1814.version, - rendererPackageName: devToolsConfig$jscomp$inline_1814.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1814.rendererConfig, +var internals$jscomp$inline_2186 = { + bundleType: devToolsConfig$jscomp$inline_1817.bundleType, + version: devToolsConfig$jscomp$inline_1817.version, + rendererPackageName: devToolsConfig$jscomp$inline_1817.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1817.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16057,26 +16098,26 @@ var internals$jscomp$inline_2183 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1814.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1817.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-a0706321" + reconcilerVersion: "18.3.0-www-modern-800ed34d" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2184 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2187 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2184.isDisabled && - hook$jscomp$inline_2184.supportsFiber + !hook$jscomp$inline_2187.isDisabled && + hook$jscomp$inline_2187.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2184.inject( - internals$jscomp$inline_2183 + (rendererID = hook$jscomp$inline_2187.inject( + internals$jscomp$inline_2186 )), - (injectedHook = hook$jscomp$inline_2184); + (injectedHook = hook$jscomp$inline_2187); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16235,4 +16276,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-a0706321"; +exports.version = "18.3.0-www-modern-800ed34d"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 0911598a73..49d47dcddc 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -3420,57 +3420,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$48 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$48); - return asyncAction$48; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$49 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$49.status = "fulfilled"; + resultThenable$49.value = finishedState; + }); + return resultThenable$49; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3542,6 +3565,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3566,12 +3590,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3806,12 +3834,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3864,10 +3892,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -4094,13 +4122,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -4110,9 +4144,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -4135,14 +4169,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$54 = enqueueUpdate(provider, fiber, lane); - null !== root$54 && - (scheduleUpdateOnFiber(root$54, provider, lane), - entangleTransitions(root$54, provider, lane)); + var root$55 = enqueueUpdate(provider, fiber, lane); + null !== root$55 && + (scheduleUpdateOnFiber(root$55, provider, lane), + entangleTransitions(root$55, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$54 && + null !== root$55 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4325,7 +4359,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4347,15 +4381,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$50 = workInProgressRoot; - if (null === root$50) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$50, renderLanes$1) || + var root$51 = workInProgressRoot; + if (null === root$51) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$51, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$50 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$50; - mountEffect(subscribeToStore.bind(null, fiber, root$50, subscribe), [ + root$51 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$51; + mountEffect(subscribeToStore.bind(null, fiber, root$51, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4364,7 +4398,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$50, + root$51, getServerSnapshot, getSnapshot ), @@ -4938,10 +4972,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$67 = workInProgress.stateNode; + root$68 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$67.incompleteTransitions.has(transition)) { + if (!root$68.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4949,11 +4983,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$67.incompleteTransitions.set(transition, markerInstance); + root$68.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$67.incompleteTransitions.forEach(function (markerInstance) { + root$68.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5663,14 +5697,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$74 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$74) + var dehydrated$75 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$75) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$74, + dehydrated$75, JSCompiler_temp, renderLanes ); @@ -5680,7 +5714,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$74 = JSCompiler_temp.sibling; + dehydrated$75 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5694,8 +5728,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$74 - ? (showFallback = createWorkInProgress(dehydrated$74, showFallback)) + null !== dehydrated$75 + ? (showFallback = createWorkInProgress(dehydrated$75, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5714,10 +5748,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$74 = CacheContext._currentValue), + ? ((dehydrated$75 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$74 - ? { parent: dehydrated$74, pool: dehydrated$74 } + JSCompiler_temp.parent !== dehydrated$75 + ? { parent: dehydrated$75, pool: dehydrated$75 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5731,23 +5765,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$74 = showFallback.updateQueue), + (dehydrated$75 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$74 + null === dehydrated$75 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$74 === primaryChildProps + : dehydrated$75 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$74.transitions = didSuspend), - (dehydrated$74.markerInstances = JSCompiler_temp)))); + : ((dehydrated$75.transitions = didSuspend), + (dehydrated$75.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6827,14 +6861,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$106 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode), + for (var lastTailNode$107 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$107 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$106 + null === lastTailNode$107 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$106.sibling = null); + : (lastTailNode$107.sibling = null); } } function bubbleProperties(completedWork) { @@ -6846,53 +6880,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$108 = completedWork.selfBaseDuration, - child$109 = completedWork.child; - null !== child$109; + var treeBaseDuration$109 = completedWork.selfBaseDuration, + child$110 = completedWork.child; + null !== child$110; ) - (newChildLanes |= child$109.lanes | child$109.childLanes), - (subtreeFlags |= child$109.subtreeFlags & 31457280), - (subtreeFlags |= child$109.flags & 31457280), - (treeBaseDuration$108 += child$109.treeBaseDuration), - (child$109 = child$109.sibling); - completedWork.treeBaseDuration = treeBaseDuration$108; + (newChildLanes |= child$110.lanes | child$110.childLanes), + (subtreeFlags |= child$110.subtreeFlags & 31457280), + (subtreeFlags |= child$110.flags & 31457280), + (treeBaseDuration$109 += child$110.treeBaseDuration), + (child$110 = child$110.sibling); + completedWork.treeBaseDuration = treeBaseDuration$109; } else for ( - treeBaseDuration$108 = completedWork.child; - null !== treeBaseDuration$108; + treeBaseDuration$109 = completedWork.child; + null !== treeBaseDuration$109; ) (newChildLanes |= - treeBaseDuration$108.lanes | treeBaseDuration$108.childLanes), - (subtreeFlags |= treeBaseDuration$108.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$108.flags & 31457280), - (treeBaseDuration$108.return = completedWork), - (treeBaseDuration$108 = treeBaseDuration$108.sibling); + treeBaseDuration$109.lanes | treeBaseDuration$109.childLanes), + (subtreeFlags |= treeBaseDuration$109.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$109.flags & 31457280), + (treeBaseDuration$109.return = completedWork), + (treeBaseDuration$109 = treeBaseDuration$109.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$108 = completedWork.actualDuration; - child$109 = completedWork.selfBaseDuration; + treeBaseDuration$109 = completedWork.actualDuration; + child$110 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$108 += child.actualDuration), - (child$109 += child.treeBaseDuration), + (treeBaseDuration$109 += child.actualDuration), + (child$110 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$108; - completedWork.treeBaseDuration = child$109; + completedWork.actualDuration = treeBaseDuration$109; + completedWork.treeBaseDuration = child$110; } else for ( - treeBaseDuration$108 = completedWork.child; - null !== treeBaseDuration$108; + treeBaseDuration$109 = completedWork.child; + null !== treeBaseDuration$109; ) (newChildLanes |= - treeBaseDuration$108.lanes | treeBaseDuration$108.childLanes), - (subtreeFlags |= treeBaseDuration$108.subtreeFlags), - (subtreeFlags |= treeBaseDuration$108.flags), - (treeBaseDuration$108.return = completedWork), - (treeBaseDuration$108 = treeBaseDuration$108.sibling); + treeBaseDuration$109.lanes | treeBaseDuration$109.childLanes), + (subtreeFlags |= treeBaseDuration$109.subtreeFlags), + (subtreeFlags |= treeBaseDuration$109.flags), + (treeBaseDuration$109.return = completedWork), + (treeBaseDuration$109 = treeBaseDuration$109.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7704,8 +7738,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$142) { - captureCommitPhaseError(current, nearestMountedAncestor, error$142); + } catch (error$143) { + captureCommitPhaseError(current, nearestMountedAncestor, error$143); } else ref.current = null; } @@ -7742,7 +7776,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$208) { + } catch (e$209) { JSCompiler_temp = null; break a; } @@ -7999,11 +8033,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$144 = commitTime, + var commitTime$145 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$144); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$145); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -8030,8 +8064,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$146) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$146); + } catch (error$147) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$147); } } function commitClassCallbacks(finishedWork) { @@ -8130,11 +8164,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$147) { + } catch (error$148) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$147 + error$148 ); } else { @@ -8151,11 +8185,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$148) { + } catch (error$149) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$148 + error$149 ); } recordLayoutEffectDuration(finishedWork); @@ -8166,11 +8200,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$149) { + } catch (error$150) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$149 + error$150 ); } } @@ -8876,22 +8910,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$164) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$165 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$165) { + } catch (error$166) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$165 + error$166 ); } } @@ -9074,11 +9108,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$166) { + } catch (error$167) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$166 + error$167 ); } break; @@ -9114,8 +9148,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$167) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$167); + } catch (error$168) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$168); } } if ( @@ -9140,8 +9174,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$170) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$170); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } break; case 6: @@ -9154,8 +9188,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$172) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$172); } } break; @@ -9169,8 +9203,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$172) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$172); + } catch (error$173) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$173); } break; case 4: @@ -9200,8 +9234,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$174) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$174); + } catch (error$175) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$175); } current = finishedWork.updateQueue; null !== current && @@ -9279,11 +9313,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$154) { + } catch (error$155) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$154 + error$155 ); } } else if ( @@ -9358,21 +9392,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$155 = JSCompiler_inline_result.stateNode; + var parent$156 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$155, ""), + (setTextContent(parent$156, ""), (JSCompiler_inline_result.flags &= -33)); - var before$156 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$156, parent$155); + var before$157 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$157, parent$156); break; case 3: case 4: - var parent$157 = JSCompiler_inline_result.stateNode.containerInfo, - before$158 = getHostSibling(finishedWork); + var parent$158 = JSCompiler_inline_result.stateNode.containerInfo, + before$159 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$158, - parent$157 + before$159, + parent$158 ); break; default: @@ -9564,8 +9598,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$180) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$180); + } catch (error$181) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$181); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -9864,9 +9898,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$185 = finishedWork.stateNode; + var instance$186 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$185._visibility & 4 + ? instance$186._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9879,7 +9913,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$185._visibility |= 4), + : ((instance$186._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9887,7 +9921,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$185._visibility |= 4), + : ((instance$186._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9900,7 +9934,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$185 + instance$186 ); break; case 24: @@ -10352,8 +10386,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -10466,16 +10500,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$194 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$195 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$194 && - ((lanes = errorRetryLanes$194), + 0 !== errorRetryLanes$195 && + ((lanes = errorRetryLanes$195), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$194 + errorRetryLanes$195 ))); } if (1 === exitStatus) @@ -10684,8 +10718,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -10723,6 +10758,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10845,8 +10881,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$196) { - handleThrow(root, thrownValue$196); + } catch (thrownValue$197) { + handleThrow(root, thrownValue$197); } while (1); resetContextDependencies(); @@ -10961,8 +10997,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$198) { - handleThrow(root, thrownValue$198); + } catch (thrownValue$199) { + handleThrow(root, thrownValue$199); } while (1); resetContextDependencies(); @@ -11046,7 +11082,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -11062,7 +11098,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -11149,10 +11185,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$62 = offscreenQueue.retryQueue; - null === retryQueue$62 + var retryQueue$63 = offscreenQueue.retryQueue; + null === retryQueue$63 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$62.add(wakeable); + : retryQueue$63.add(wakeable); } } break; @@ -11350,7 +11386,7 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$202 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$203 = commitBeforeMutationEffects( root, finishedWork ); @@ -11358,7 +11394,7 @@ function commitRootImpl( enableProfilerNestedUpdateScheduledHook && (rootCommittingMutationOrLayoutEffects = root); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$202 && + shouldFireAfterActiveInstanceBlur$203 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11452,7 +11488,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$203 = rootWithPendingPassiveEffects, + var root$204 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -11468,7 +11504,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$203, remainingLanes); + releaseRootPooledCache(root$204, remainingLanes); } } return !1; @@ -12827,12 +12863,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$206 = fiber.stateNode; - if (root$206.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$206.pendingLanes); + var root$207 = fiber.stateNode; + if (root$207.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$207.pendingLanes); 0 !== lanes && - (markRootEntangled(root$206, lanes | 2), - ensureRootIsScheduled(root$206), + (markRootEntangled(root$207, lanes | 2), + ensureRootIsScheduled(root$207), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13398,19 +13434,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$394; + var JSCompiler_inline_result$jscomp$395; if (canUseDOM) { - var isSupported$jscomp$inline_1685 = "oninput" in document; - if (!isSupported$jscomp$inline_1685) { - var element$jscomp$inline_1686 = document.createElement("div"); - element$jscomp$inline_1686.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1685 = - "function" === typeof element$jscomp$inline_1686.oninput; + var isSupported$jscomp$inline_1688 = "oninput" in document; + if (!isSupported$jscomp$inline_1688) { + var element$jscomp$inline_1689 = document.createElement("div"); + element$jscomp$inline_1689.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1688 = + "function" === typeof element$jscomp$inline_1689.oninput; } - JSCompiler_inline_result$jscomp$394 = isSupported$jscomp$inline_1685; - } else JSCompiler_inline_result$jscomp$394 = !1; + JSCompiler_inline_result$jscomp$395 = isSupported$jscomp$inline_1688; + } else JSCompiler_inline_result$jscomp$395 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$394 && + JSCompiler_inline_result$jscomp$395 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13719,20 +13755,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1726 = 0; - i$jscomp$inline_1726 < simpleEventPluginEvents.length; - i$jscomp$inline_1726++ + var i$jscomp$inline_1729 = 0; + i$jscomp$inline_1729 < simpleEventPluginEvents.length; + i$jscomp$inline_1729++ ) { - var eventName$jscomp$inline_1727 = - simpleEventPluginEvents[i$jscomp$inline_1726], - domEventName$jscomp$inline_1728 = - eventName$jscomp$inline_1727.toLowerCase(), - capitalizedEvent$jscomp$inline_1729 = - eventName$jscomp$inline_1727[0].toUpperCase() + - eventName$jscomp$inline_1727.slice(1); + var eventName$jscomp$inline_1730 = + simpleEventPluginEvents[i$jscomp$inline_1729], + domEventName$jscomp$inline_1731 = + eventName$jscomp$inline_1730.toLowerCase(), + capitalizedEvent$jscomp$inline_1732 = + eventName$jscomp$inline_1730[0].toUpperCase() + + eventName$jscomp$inline_1730.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1728, - "on" + capitalizedEvent$jscomp$inline_1729 + domEventName$jscomp$inline_1731, + "on" + capitalizedEvent$jscomp$inline_1732 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15148,14 +15184,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$235 in nextProps) { - var propKey = nextProps[propKey$235]; - lastProp = lastProps[propKey$235]; + for (var propKey$236 in nextProps) { + var propKey = nextProps[propKey$236]; + lastProp = lastProps[propKey$236]; if ( - nextProps.hasOwnProperty(propKey$235) && + nextProps.hasOwnProperty(propKey$236) && (null != propKey || null != lastProp) ) - switch (propKey$235) { + switch (propKey$236) { case "type": type = propKey; break; @@ -15184,7 +15220,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$235, + propKey$236, propKey, nextProps, lastProp @@ -15203,7 +15239,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$235 = null; + defaultValue = value = propKey = propKey$236 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15234,7 +15270,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$235 = type; + propKey$236 = type; break; case "defaultValue": propKey = type; @@ -15252,10 +15288,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$235, propKey, value, defaultValue); + updateSelect(domElement, propKey$236, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$235 = null; + propKey = propKey$236 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15279,7 +15315,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$235 = name; + propKey$236 = name; break; case "defaultValue": propKey = name; @@ -15293,17 +15329,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$235, propKey); + updateTextarea(domElement, propKey$236, propKey); return; case "option": - for (var propKey$251 in lastProps) + for (var propKey$252 in lastProps) if ( - ((propKey$235 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$251)) + ((propKey$236 = lastProps[propKey$252]), + lastProps.hasOwnProperty(propKey$252) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$252)) ) - switch (propKey$251) { + switch (propKey$252) { case "selected": domElement.selected = !1; break; @@ -15311,33 +15347,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$251, + propKey$252, null, nextProps, - propKey$235 + propKey$236 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$235 = nextProps[lastDefaultValue]), + ((propKey$236 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$235 !== propKey && - (null != propKey$235 || null != propKey)) + propKey$236 !== propKey && + (null != propKey$236 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$235 && - "function" !== typeof propKey$235 && - "symbol" !== typeof propKey$235; + propKey$236 && + "function" !== typeof propKey$236 && + "symbol" !== typeof propKey$236; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$235, + propKey$236, nextProps, propKey ); @@ -15358,24 +15394,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$256 in lastProps) - (propKey$235 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$256) && - setProp(domElement, tag, propKey$256, null, nextProps, propKey$235); + for (var propKey$257 in lastProps) + (propKey$236 = lastProps[propKey$257]), + lastProps.hasOwnProperty(propKey$257) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$257) && + setProp(domElement, tag, propKey$257, null, nextProps, propKey$236); for (checked in nextProps) if ( - ((propKey$235 = nextProps[checked]), + ((propKey$236 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$235 !== propKey && - (null != propKey$235 || null != propKey)) + propKey$236 !== propKey && + (null != propKey$236 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$235) + if (null != propKey$236) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15383,7 +15419,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$235, + propKey$236, nextProps, propKey ); @@ -15391,49 +15427,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$261 in lastProps) - (propKey$235 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$261) && + for (var propKey$262 in lastProps) + (propKey$236 = lastProps[propKey$262]), + lastProps.hasOwnProperty(propKey$262) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$262) && setPropOnCustomElement( domElement, tag, - propKey$261, + propKey$262, null, nextProps, - propKey$235 + propKey$236 ); for (defaultChecked in nextProps) - (propKey$235 = nextProps[defaultChecked]), + (propKey$236 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$235 === propKey || - (null == propKey$235 && null == propKey) || + propKey$236 === propKey || + (null == propKey$236 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$235, + propKey$236, nextProps, propKey ); return; } } - for (var propKey$266 in lastProps) - (propKey$235 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$266) && - setProp(domElement, tag, propKey$266, null, nextProps, propKey$235); + for (var propKey$267 in lastProps) + (propKey$236 = lastProps[propKey$267]), + lastProps.hasOwnProperty(propKey$267) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$267) && + setProp(domElement, tag, propKey$267, null, nextProps, propKey$236); for (lastProp in nextProps) - (propKey$235 = nextProps[lastProp]), + (propKey$236 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$235 === propKey || - (null == propKey$235 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$235, nextProps, propKey); + propKey$236 === propKey || + (null == propKey$236 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$236, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15951,11 +15987,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -16024,7 +16064,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -16068,17 +16109,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$300 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$301 = styles$300.get(type); - resource$301 || + var styles$301 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$302 = styles$301.get(type); + resource$302 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$301 = { + (resource$302 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$300.set(type, resource$301), + styles$301.set(type, resource$302), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16093,9 +16134,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$301.state + resource$302.state )); - return resource$301; + return resource$302; } return null; case "script": @@ -16175,36 +16216,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$305 = hoistableRoot.querySelector( + var instance$306 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$305) + if (instance$306) return ( - (resource.instance = instance$305), - markNodeAsHoistable(instance$305), - instance$305 + (resource.instance = instance$306), + markNodeAsHoistable(instance$306), + instance$306 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$305 = ( + instance$306 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$305); - var linkInstance = instance$305; + markNodeAsHoistable(instance$306); + var linkInstance = instance$306; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$305, "link", instance); + setInitialProperties(instance$306, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$305, props.precedence, hoistableRoot); - return (resource.instance = instance$305); + insertStylesheet(instance$306, props.precedence, hoistableRoot); + return (resource.instance = instance$306); case "script": - instance$305 = getScriptKey(props.src); + instance$306 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$305 + "script[async]" + instance$306 )) ) return ( @@ -16213,7 +16254,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$305))) + if ((styleProps = preloadPropsMap.get(instance$306))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17165,11 +17206,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$325); + var instance = getPublicRootInstance(root$326); originalCallback.call(instance); }; } - var root$325 = createHydrationContainer( + var root$326 = createHydrationContainer( initialChildren, callback, container, @@ -17181,23 +17222,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$325; - container[internalContainerInstanceKey] = root$325.current; + container._reactRootContainer = root$326; + container[internalContainerInstanceKey] = root$326.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$325; + return root$326; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$326 = callback; + var originalCallback$327 = callback; callback = function () { - var instance = getPublicRootInstance(root$327); - originalCallback$326.call(instance); + var instance = getPublicRootInstance(root$328); + originalCallback$327.call(instance); }; } - var root$327 = createFiberRoot( + var root$328 = createFiberRoot( container, 0, !1, @@ -17209,15 +17250,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$327; - container[internalContainerInstanceKey] = root$327.current; + container._reactRootContainer = root$328; + container[internalContainerInstanceKey] = root$328.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$327, parentComponent, callback); + updateContainer(initialChildren, root$328, parentComponent, callback); }); - return root$327; + return root$328; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17277,10 +17318,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1936 = { +var devToolsConfig$jscomp$inline_1939 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-03cae78d", + version: "18.3.0-www-classic-a10cf370", rendererPackageName: "react-dom" }; (function (internals) { @@ -17298,10 +17339,10 @@ var devToolsConfig$jscomp$inline_1936 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1936.bundleType, - version: devToolsConfig$jscomp$inline_1936.version, - rendererPackageName: devToolsConfig$jscomp$inline_1936.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1936.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1939.bundleType, + version: devToolsConfig$jscomp$inline_1939.version, + rendererPackageName: devToolsConfig$jscomp$inline_1939.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1939.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17317,14 +17358,14 @@ var devToolsConfig$jscomp$inline_1936 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1936.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1939.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-03cae78d" + reconcilerVersion: "18.3.0-www-classic-a10cf370" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17554,7 +17595,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-03cae78d"; +exports.version = "18.3.0-www-classic-a10cf370"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 1e78c0a4e4..c908056447 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -49,6 +49,32 @@ function formatProdErrorMessage(code) { ); } var assign = Object.assign, + dynamicFeatureFlags = require("ReactFeatureFlags"), + disableInputAttributeSyncing = + dynamicFeatureFlags.disableInputAttributeSyncing, + disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, + enableTrustedTypesIntegration = + dynamicFeatureFlags.enableTrustedTypesIntegration, + enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, + enableLazyContextPropagation = + dynamicFeatureFlags.enableLazyContextPropagation, + enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, + enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableCustomElementPropertySupport = + dynamicFeatureFlags.enableCustomElementPropertySupport, + enableDeferRootSchedulingToMicrotask = + dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, + diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, + enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + enableProfilerNestedUpdateScheduledHook = + dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook, + enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -63,6 +89,37 @@ function push(cursor, value) { valueStack[index] = cursor.current; cursor.current = value; } +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( + "react.default_value" + ), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null); @@ -119,31 +176,7 @@ function popHostContext(fiber) { contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor)); } -var dynamicFeatureFlags = require("ReactFeatureFlags"), - disableInputAttributeSyncing = - dynamicFeatureFlags.disableInputAttributeSyncing, - disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, - enableTrustedTypesIntegration = - dynamicFeatureFlags.enableTrustedTypesIntegration, - enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, - enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableCustomElementPropertySupport = - dynamicFeatureFlags.enableCustomElementPropertySupport, - enableDeferRootSchedulingToMicrotask = - dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, - enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, - enableProfilerNestedUpdateScheduledHook = - dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook, - enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -154,8 +187,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, - ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null, injectedProfilingHooks = null, @@ -745,37 +776,6 @@ function setValueForNamespacedAttribute(node, namespace, name, value) { ); } } -var REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_CACHE_TYPE = Symbol.for("react.cache"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( - "react.default_value" - ), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} var prefix; function describeBuiltInComponentFrame(name) { if (void 0 === prefix) @@ -3313,57 +3313,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$48 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$48); - return asyncAction$48; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$49 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$49.status = "fulfilled"; + resultThenable$49.value = finishedState; + }); + return resultThenable$49; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3435,6 +3458,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3459,12 +3483,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3699,12 +3727,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3757,10 +3785,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -3987,13 +4015,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -4003,9 +4037,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -4028,14 +4062,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$54 = enqueueUpdate(provider, fiber, lane); - null !== root$54 && - (scheduleUpdateOnFiber(root$54, provider, lane), - entangleTransitions(root$54, provider, lane)); + var root$55 = enqueueUpdate(provider, fiber, lane); + null !== root$55 && + (scheduleUpdateOnFiber(root$55, provider, lane), + entangleTransitions(root$55, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$54 && + null !== root$55 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4218,7 +4252,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4240,15 +4274,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$50 = workInProgressRoot; - if (null === root$50) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$50, renderLanes$1) || + var root$51 = workInProgressRoot; + if (null === root$51) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$51, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$50 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$50; - mountEffect(subscribeToStore.bind(null, fiber, root$50, subscribe), [ + root$51 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$51; + mountEffect(subscribeToStore.bind(null, fiber, root$51, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4257,7 +4291,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$50, + root$51, getServerSnapshot, getSnapshot ), @@ -4816,10 +4850,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$67 = workInProgress.stateNode; + root$68 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$67.incompleteTransitions.has(transition)) { + if (!root$68.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4827,11 +4861,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$67.incompleteTransitions.set(transition, markerInstance); + root$68.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$67.incompleteTransitions.forEach(function (markerInstance) { + root$68.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5503,14 +5537,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$74 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$74) + var dehydrated$75 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$75) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$74, + dehydrated$75, JSCompiler_temp, renderLanes ); @@ -5520,7 +5554,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$74 = JSCompiler_temp.sibling; + dehydrated$75 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5534,8 +5568,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$74 - ? (showFallback = createWorkInProgress(dehydrated$74, showFallback)) + null !== dehydrated$75 + ? (showFallback = createWorkInProgress(dehydrated$75, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5554,10 +5588,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$74 = CacheContext._currentValue), + ? ((dehydrated$75 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$74 - ? { parent: dehydrated$74, pool: dehydrated$74 } + JSCompiler_temp.parent !== dehydrated$75 + ? { parent: dehydrated$75, pool: dehydrated$75 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5571,23 +5605,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$74 = showFallback.updateQueue), + (dehydrated$75 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$74 + null === dehydrated$75 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$74 === primaryChildProps + : dehydrated$75 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$74.transitions = didSuspend), - (dehydrated$74.markerInstances = JSCompiler_temp)))); + : ((dehydrated$75.transitions = didSuspend), + (dehydrated$75.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6663,14 +6697,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$106 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode), + for (var lastTailNode$107 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$107 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$106 + null === lastTailNode$107 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$106.sibling = null); + : (lastTailNode$107.sibling = null); } } function bubbleProperties(completedWork) { @@ -6682,53 +6716,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$108 = completedWork.selfBaseDuration, - child$109 = completedWork.child; - null !== child$109; + var treeBaseDuration$109 = completedWork.selfBaseDuration, + child$110 = completedWork.child; + null !== child$110; ) - (newChildLanes |= child$109.lanes | child$109.childLanes), - (subtreeFlags |= child$109.subtreeFlags & 31457280), - (subtreeFlags |= child$109.flags & 31457280), - (treeBaseDuration$108 += child$109.treeBaseDuration), - (child$109 = child$109.sibling); - completedWork.treeBaseDuration = treeBaseDuration$108; + (newChildLanes |= child$110.lanes | child$110.childLanes), + (subtreeFlags |= child$110.subtreeFlags & 31457280), + (subtreeFlags |= child$110.flags & 31457280), + (treeBaseDuration$109 += child$110.treeBaseDuration), + (child$110 = child$110.sibling); + completedWork.treeBaseDuration = treeBaseDuration$109; } else for ( - treeBaseDuration$108 = completedWork.child; - null !== treeBaseDuration$108; + treeBaseDuration$109 = completedWork.child; + null !== treeBaseDuration$109; ) (newChildLanes |= - treeBaseDuration$108.lanes | treeBaseDuration$108.childLanes), - (subtreeFlags |= treeBaseDuration$108.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$108.flags & 31457280), - (treeBaseDuration$108.return = completedWork), - (treeBaseDuration$108 = treeBaseDuration$108.sibling); + treeBaseDuration$109.lanes | treeBaseDuration$109.childLanes), + (subtreeFlags |= treeBaseDuration$109.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$109.flags & 31457280), + (treeBaseDuration$109.return = completedWork), + (treeBaseDuration$109 = treeBaseDuration$109.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$108 = completedWork.actualDuration; - child$109 = completedWork.selfBaseDuration; + treeBaseDuration$109 = completedWork.actualDuration; + child$110 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$108 += child.actualDuration), - (child$109 += child.treeBaseDuration), + (treeBaseDuration$109 += child.actualDuration), + (child$110 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$108; - completedWork.treeBaseDuration = child$109; + completedWork.actualDuration = treeBaseDuration$109; + completedWork.treeBaseDuration = child$110; } else for ( - treeBaseDuration$108 = completedWork.child; - null !== treeBaseDuration$108; + treeBaseDuration$109 = completedWork.child; + null !== treeBaseDuration$109; ) (newChildLanes |= - treeBaseDuration$108.lanes | treeBaseDuration$108.childLanes), - (subtreeFlags |= treeBaseDuration$108.subtreeFlags), - (subtreeFlags |= treeBaseDuration$108.flags), - (treeBaseDuration$108.return = completedWork), - (treeBaseDuration$108 = treeBaseDuration$108.sibling); + treeBaseDuration$109.lanes | treeBaseDuration$109.childLanes), + (subtreeFlags |= treeBaseDuration$109.subtreeFlags), + (subtreeFlags |= treeBaseDuration$109.flags), + (treeBaseDuration$109.return = completedWork), + (treeBaseDuration$109 = treeBaseDuration$109.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7521,8 +7555,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$141) { - captureCommitPhaseError(current, nearestMountedAncestor, error$141); + } catch (error$142) { + captureCommitPhaseError(current, nearestMountedAncestor, error$142); } else ref.current = null; } @@ -7559,7 +7593,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$212) { + } catch (e$213) { JSCompiler_temp = null; break a; } @@ -7829,11 +7863,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$143 = commitTime, + var commitTime$144 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$143); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$144); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -7860,8 +7894,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$145) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$145); + } catch (error$146) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$146); } } function commitClassCallbacks(finishedWork) { @@ -7960,11 +7994,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$146) { + } catch (error$147) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$146 + error$147 ); } else { @@ -7981,11 +8015,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$147) { + } catch (error$148) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$147 + error$148 ); } recordLayoutEffectDuration(finishedWork); @@ -7996,11 +8030,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$148) { + } catch (error$149) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$148 + error$149 ); } } @@ -8706,22 +8740,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$163) { + } catch (error$164) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$164 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$164) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$165 ); } } @@ -8904,11 +8938,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$165) { + } catch (error$166) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$165 + error$166 ); } break; @@ -8944,8 +8978,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$166) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$166); + } catch (error$167) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$167); } } if ( @@ -8970,8 +9004,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$169) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$169); + } catch (error$170) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$170); } break; case 6: @@ -8984,8 +9018,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$170) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$170); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } } break; @@ -8999,8 +9033,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$172) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$172); } break; case 4: @@ -9030,8 +9064,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$173) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$173); + } catch (error$174) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$174); } current = finishedWork.updateQueue; null !== current && @@ -9109,11 +9143,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$153) { + } catch (error$154) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$153 + error$154 ); } } else if ( @@ -9188,21 +9222,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$154 = JSCompiler_inline_result.stateNode; + var parent$155 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$154, ""), + (setTextContent(parent$155, ""), (JSCompiler_inline_result.flags &= -33)); - var before$155 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$155, parent$154); + var before$156 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$156, parent$155); break; case 3: case 4: - var parent$156 = JSCompiler_inline_result.stateNode.containerInfo, - before$157 = getHostSibling(finishedWork); + var parent$157 = JSCompiler_inline_result.stateNode.containerInfo, + before$158 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$157, - parent$156 + before$158, + parent$157 ); break; default: @@ -9394,8 +9428,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + } catch (error$180) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$180); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -9694,9 +9728,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$184 = finishedWork.stateNode; + var instance$185 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$184._visibility & 4 + ? instance$185._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9709,7 +9743,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$184._visibility |= 4), + : ((instance$185._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9717,7 +9751,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$184._visibility |= 4), + : ((instance$185._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9730,7 +9764,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$184 + instance$185 ); break; case 24: @@ -10182,8 +10216,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -10296,16 +10330,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$193 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$194 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$193 && - ((lanes = errorRetryLanes$193), + 0 !== errorRetryLanes$194 && + ((lanes = errorRetryLanes$194), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$193 + errorRetryLanes$194 ))); } if (1 === exitStatus) @@ -10514,8 +10548,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -10553,6 +10588,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10675,8 +10711,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$195) { - handleThrow(root, thrownValue$195); + } catch (thrownValue$196) { + handleThrow(root, thrownValue$196); } while (1); resetContextDependencies(); @@ -10791,8 +10827,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$197) { - handleThrow(root, thrownValue$197); + } catch (thrownValue$198) { + handleThrow(root, thrownValue$198); } while (1); resetContextDependencies(); @@ -10872,7 +10908,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -10888,7 +10924,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -10975,10 +11011,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$62 = offscreenQueue.retryQueue; - null === retryQueue$62 + var retryQueue$63 = offscreenQueue.retryQueue; + null === retryQueue$63 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$62.add(wakeable); + : retryQueue$63.add(wakeable); } } break; @@ -11176,7 +11212,7 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$201 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$202 = commitBeforeMutationEffects( root, finishedWork ); @@ -11184,7 +11220,7 @@ function commitRootImpl( enableProfilerNestedUpdateScheduledHook && (rootCommittingMutationOrLayoutEffects = root); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$201 && + shouldFireAfterActiveInstanceBlur$202 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11278,7 +11314,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$202 = rootWithPendingPassiveEffects, + var root$203 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -11294,7 +11330,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$202, remainingLanes); + releaseRootPooledCache(root$203, remainingLanes); } } return !1; @@ -12540,12 +12576,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$205 = fiber.stateNode; - if (root$205.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$205.pendingLanes); + var root$206 = fiber.stateNode; + if (root$206.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$206.pendingLanes); 0 !== lanes && - (markRootEntangled(root$205, lanes | 2), - ensureRootIsScheduled(root$205), + (markRootEntangled(root$206, lanes | 2), + ensureRootIsScheduled(root$206), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13635,19 +13671,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$392; + var JSCompiler_inline_result$jscomp$393; if (canUseDOM) { - var isSupported$jscomp$inline_1684 = "oninput" in document; - if (!isSupported$jscomp$inline_1684) { - var element$jscomp$inline_1685 = document.createElement("div"); - element$jscomp$inline_1685.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1684 = - "function" === typeof element$jscomp$inline_1685.oninput; + var isSupported$jscomp$inline_1687 = "oninput" in document; + if (!isSupported$jscomp$inline_1687) { + var element$jscomp$inline_1688 = document.createElement("div"); + element$jscomp$inline_1688.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1687 = + "function" === typeof element$jscomp$inline_1688.oninput; } - JSCompiler_inline_result$jscomp$392 = isSupported$jscomp$inline_1684; - } else JSCompiler_inline_result$jscomp$392 = !1; + JSCompiler_inline_result$jscomp$393 = isSupported$jscomp$inline_1687; + } else JSCompiler_inline_result$jscomp$393 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$392 && + JSCompiler_inline_result$jscomp$393 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13956,20 +13992,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1725 = 0; - i$jscomp$inline_1725 < simpleEventPluginEvents.length; - i$jscomp$inline_1725++ + var i$jscomp$inline_1728 = 0; + i$jscomp$inline_1728 < simpleEventPluginEvents.length; + i$jscomp$inline_1728++ ) { - var eventName$jscomp$inline_1726 = - simpleEventPluginEvents[i$jscomp$inline_1725], - domEventName$jscomp$inline_1727 = - eventName$jscomp$inline_1726.toLowerCase(), - capitalizedEvent$jscomp$inline_1728 = - eventName$jscomp$inline_1726[0].toUpperCase() + - eventName$jscomp$inline_1726.slice(1); + var eventName$jscomp$inline_1729 = + simpleEventPluginEvents[i$jscomp$inline_1728], + domEventName$jscomp$inline_1730 = + eventName$jscomp$inline_1729.toLowerCase(), + capitalizedEvent$jscomp$inline_1731 = + eventName$jscomp$inline_1729[0].toUpperCase() + + eventName$jscomp$inline_1729.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1727, - "on" + capitalizedEvent$jscomp$inline_1728 + domEventName$jscomp$inline_1730, + "on" + capitalizedEvent$jscomp$inline_1731 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15384,14 +15420,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$239 in nextProps) { - var propKey = nextProps[propKey$239]; - lastProp = lastProps[propKey$239]; + for (var propKey$240 in nextProps) { + var propKey = nextProps[propKey$240]; + lastProp = lastProps[propKey$240]; if ( - nextProps.hasOwnProperty(propKey$239) && + nextProps.hasOwnProperty(propKey$240) && (null != propKey || null != lastProp) ) - switch (propKey$239) { + switch (propKey$240) { case "type": type = propKey; break; @@ -15420,7 +15456,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$239, + propKey$240, propKey, nextProps, lastProp @@ -15439,7 +15475,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$239 = null; + defaultValue = value = propKey = propKey$240 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15470,7 +15506,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$239 = type; + propKey$240 = type; break; case "defaultValue": propKey = type; @@ -15488,10 +15524,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$239, propKey, value, defaultValue); + updateSelect(domElement, propKey$240, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$239 = null; + propKey = propKey$240 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15515,7 +15551,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$239 = name; + propKey$240 = name; break; case "defaultValue": propKey = name; @@ -15529,17 +15565,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$239, propKey); + updateTextarea(domElement, propKey$240, propKey); return; case "option": - for (var propKey$255 in lastProps) + for (var propKey$256 in lastProps) if ( - ((propKey$239 = lastProps[propKey$255]), - lastProps.hasOwnProperty(propKey$255) && - null != propKey$239 && - !nextProps.hasOwnProperty(propKey$255)) + ((propKey$240 = lastProps[propKey$256]), + lastProps.hasOwnProperty(propKey$256) && + null != propKey$240 && + !nextProps.hasOwnProperty(propKey$256)) ) - switch (propKey$255) { + switch (propKey$256) { case "selected": domElement.selected = !1; break; @@ -15547,33 +15583,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$255, + propKey$256, null, nextProps, - propKey$239 + propKey$240 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$239 = nextProps[lastDefaultValue]), + ((propKey$240 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$239 !== propKey && - (null != propKey$239 || null != propKey)) + propKey$240 !== propKey && + (null != propKey$240 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$239 && - "function" !== typeof propKey$239 && - "symbol" !== typeof propKey$239; + propKey$240 && + "function" !== typeof propKey$240 && + "symbol" !== typeof propKey$240; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$239, + propKey$240, nextProps, propKey ); @@ -15594,24 +15630,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$260 in lastProps) - (propKey$239 = lastProps[propKey$260]), - lastProps.hasOwnProperty(propKey$260) && - null != propKey$239 && - !nextProps.hasOwnProperty(propKey$260) && - setProp(domElement, tag, propKey$260, null, nextProps, propKey$239); + for (var propKey$261 in lastProps) + (propKey$240 = lastProps[propKey$261]), + lastProps.hasOwnProperty(propKey$261) && + null != propKey$240 && + !nextProps.hasOwnProperty(propKey$261) && + setProp(domElement, tag, propKey$261, null, nextProps, propKey$240); for (checked in nextProps) if ( - ((propKey$239 = nextProps[checked]), + ((propKey$240 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$239 !== propKey && - (null != propKey$239 || null != propKey)) + propKey$240 !== propKey && + (null != propKey$240 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$239) + if (null != propKey$240) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15619,7 +15655,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$239, + propKey$240, nextProps, propKey ); @@ -15627,49 +15663,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$265 in lastProps) - (propKey$239 = lastProps[propKey$265]), - lastProps.hasOwnProperty(propKey$265) && - null != propKey$239 && - !nextProps.hasOwnProperty(propKey$265) && + for (var propKey$266 in lastProps) + (propKey$240 = lastProps[propKey$266]), + lastProps.hasOwnProperty(propKey$266) && + null != propKey$240 && + !nextProps.hasOwnProperty(propKey$266) && setPropOnCustomElement( domElement, tag, - propKey$265, + propKey$266, null, nextProps, - propKey$239 + propKey$240 ); for (defaultChecked in nextProps) - (propKey$239 = nextProps[defaultChecked]), + (propKey$240 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$239 === propKey || - (null == propKey$239 && null == propKey) || + propKey$240 === propKey || + (null == propKey$240 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$239, + propKey$240, nextProps, propKey ); return; } } - for (var propKey$270 in lastProps) - (propKey$239 = lastProps[propKey$270]), - lastProps.hasOwnProperty(propKey$270) && - null != propKey$239 && - !nextProps.hasOwnProperty(propKey$270) && - setProp(domElement, tag, propKey$270, null, nextProps, propKey$239); + for (var propKey$271 in lastProps) + (propKey$240 = lastProps[propKey$271]), + lastProps.hasOwnProperty(propKey$271) && + null != propKey$240 && + !nextProps.hasOwnProperty(propKey$271) && + setProp(domElement, tag, propKey$271, null, nextProps, propKey$240); for (lastProp in nextProps) - (propKey$239 = nextProps[lastProp]), + (propKey$240 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$239 === propKey || - (null == propKey$239 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$239, nextProps, propKey); + propKey$240 === propKey || + (null == propKey$240 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$240, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -16173,11 +16209,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -16246,7 +16286,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -16290,17 +16331,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$304 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$305 = styles$304.get(type); - resource$305 || + var styles$305 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$306 = styles$305.get(type); + resource$306 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$305 = { + (resource$306 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$304.set(type, resource$305), + styles$305.set(type, resource$306), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16315,9 +16356,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$305.state + resource$306.state )); - return resource$305; + return resource$306; } return null; case "script": @@ -16397,36 +16438,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$309 = hoistableRoot.querySelector( + var instance$310 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$309) + if (instance$310) return ( - (resource.instance = instance$309), - markNodeAsHoistable(instance$309), - instance$309 + (resource.instance = instance$310), + markNodeAsHoistable(instance$310), + instance$310 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$309 = ( + instance$310 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$309); - var linkInstance = instance$309; + markNodeAsHoistable(instance$310); + var linkInstance = instance$310; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$309, "link", instance); + setInitialProperties(instance$310, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$309, props.precedence, hoistableRoot); - return (resource.instance = instance$309); + insertStylesheet(instance$310, props.precedence, hoistableRoot); + return (resource.instance = instance$310); case "script": - instance$309 = getScriptKey(props.src); + instance$310 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$309 + "script[async]" + instance$310 )) ) return ( @@ -16435,7 +16476,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$309))) + if ((styleProps = preloadPropsMap.get(instance$310))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16798,10 +16839,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1895 = { +var devToolsConfig$jscomp$inline_1898 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-7d0a1105", + version: "18.3.0-www-modern-c017caef", rendererPackageName: "react-dom" }; (function (internals) { @@ -16819,10 +16860,10 @@ var devToolsConfig$jscomp$inline_1895 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1895.bundleType, - version: devToolsConfig$jscomp$inline_1895.version, - rendererPackageName: devToolsConfig$jscomp$inline_1895.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1895.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1898.bundleType, + version: devToolsConfig$jscomp$inline_1898.version, + rendererPackageName: devToolsConfig$jscomp$inline_1898.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1898.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16839,14 +16880,14 @@ var devToolsConfig$jscomp$inline_1895 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1895.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1898.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-7d0a1105" + reconcilerVersion: "18.3.0-www-modern-c017caef" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -17004,7 +17045,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-7d0a1105"; +exports.version = "18.3.0-www-modern-c017caef"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index 18bfc4ff64..4107a8d5b8 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-classic-86d152c3"; +var ReactVersion = "18.3.0-www-classic-40ef305a"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -2329,6 +2329,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) { return description; } +var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -4084,6 +4087,7 @@ function pushLink( if (!_resource) { var resourceProps = stylesheetPropsFromRawProps(props); var preloadResource = resources.preloadsMap.get(key); + var state = NoState; if (preloadResource) { // If we already had a preload we don't want that resource to flush directly. @@ -4093,12 +4097,16 @@ function pushLink( resourceProps, preloadResource.props ); + + if (preloadResource.state & Flushed) { + state = PreloadFlushed; + } } _resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: resourceProps }; resources.stylesMap.set(key, _resource); @@ -6129,12 +6137,9 @@ function flushAllStylesInPreamble(set, precedence) { } function preloadLateStyle(resource) { - { - if (resource.state & PreloadFlushed) { - error( - "React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React." - ); - } + if (resource.state & PreloadFlushed) { + // This resource has already had a preload flushed + return; } if (resource.type === "style") { @@ -7241,10 +7246,17 @@ function preinit(href, options) { } if (!resource) { + var state = NoState; + var preloadResource = resources.preloadsMap.get(key); + + if (preloadResource && preloadResource.state & Flushed) { + state = PreloadFlushed; + } + resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: stylesheetPropsFromPreinitOptions(href, precedence, options) }; resources.stylesMap.set(key, resource); @@ -7487,7 +7499,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } @@ -7944,9 +7957,6 @@ function reenableLogs() { } } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 11aea754d4..39a27f75f6 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-modern-a23c15ee"; +var ReactVersion = "18.3.0-www-modern-b7ba1a13"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -2329,6 +2329,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) { return description; } +var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -4084,6 +4087,7 @@ function pushLink( if (!_resource) { var resourceProps = stylesheetPropsFromRawProps(props); var preloadResource = resources.preloadsMap.get(key); + var state = NoState; if (preloadResource) { // If we already had a preload we don't want that resource to flush directly. @@ -4093,12 +4097,16 @@ function pushLink( resourceProps, preloadResource.props ); + + if (preloadResource.state & Flushed) { + state = PreloadFlushed; + } } _resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: resourceProps }; resources.stylesMap.set(key, _resource); @@ -6129,12 +6137,9 @@ function flushAllStylesInPreamble(set, precedence) { } function preloadLateStyle(resource) { - { - if (resource.state & PreloadFlushed) { - error( - "React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React." - ); - } + if (resource.state & PreloadFlushed) { + // This resource has already had a preload flushed + return; } if (resource.type === "style") { @@ -7241,10 +7246,17 @@ function preinit(href, options) { } if (!resource) { + var state = NoState; + var preloadResource = resources.preloadsMap.get(key); + + if (preloadResource && preloadResource.state & Flushed) { + state = PreloadFlushed; + } + resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: stylesheetPropsFromPreinitOptions(href, precedence, options) }; resources.stylesMap.set(key, resource); @@ -7487,7 +7499,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } @@ -7944,9 +7957,6 @@ function reenableLogs() { } } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 4446e95e3c..c6ef083a99 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -184,6 +184,8 @@ function sanitizeURL(url) { : url; } var isArrayImpl = Array.isArray, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactDOMCurrentDispatcher = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher, ReactDOMServerDispatcher = { @@ -531,19 +533,29 @@ function pushLink( pushLinkImpl(target, props) ); href = resources.stylesMap.get(responseState); - if (!href) { - props = assign({}, props, { + href || + ((props = assign({}, props, { "data-precedence": props.precedence, precedence: null - }); - if ((href = resources.preloadsMap.get(responseState))) - (href.state |= 4), - (href = href.props), - null == props.crossOrigin && (props.crossOrigin = href.crossOrigin), - null == props.integrity && (props.integrity = href.integrity); - href = { type: "stylesheet", chunks: [], state: 0, props: props }; - resources.stylesMap.set(responseState, href); - props = resources.precedences.get(precedence); + })), + (href = resources.preloadsMap.get(responseState)), + (insertionMode = 0), + href && + ((href.state |= 4), + (noscriptTagInScope = href.props), + null == props.crossOrigin && + (props.crossOrigin = noscriptTagInScope.crossOrigin), + null == props.integrity && + (props.integrity = noscriptTagInScope.integrity), + href.state & 3 && (insertionMode = 8)), + (href = { + type: "stylesheet", + chunks: [], + state: insertionMode, + props: props + }), + resources.stylesMap.set(responseState, href), + (props = resources.precedences.get(precedence)), props || ((props = new Set()), resources.precedences.set(precedence, props), @@ -554,9 +566,8 @@ function pushLink( props: { precedence: precedence, hrefs: [] } }), props.add(responseState), - resources.stylePrecedences.set(precedence, responseState)); - props.add(href); - } + resources.stylePrecedences.set(precedence, responseState)), + props.add(href)); resources.boundaryResources && resources.boundaryResources.add(href); textEmbedded && target.push("\x3c!-- --\x3e"); return null; @@ -1587,7 +1598,7 @@ function flushAllStylesInPreamble(set, precedence) { } } function preloadLateStyle(resource) { - if ("style" !== resource.type) { + if (!(resource.state & 8) && "style" !== resource.type) { var chunks = resource.chunks, preloadProps = preloadAsStylePropsFromProps( resource.props.href, @@ -2011,49 +2022,54 @@ function preinit(href, options) { var as = options.as; switch (as) { case "style": - var key = "[" + as + "]" + href; - as = resources.stylesMap.get(key); - var precedence = options.precedence || "default"; - as || - ((as = { + var key = "[" + as + "]" + href, + resource = resources.stylesMap.get(key); + as = options.precedence || "default"; + if (!resource) { + resource = 0; + var preloadResource = resources.preloadsMap.get(key); + preloadResource && preloadResource.state & 3 && (resource = 8); + resource = { type: "stylesheet", chunks: [], - state: 0, + state: resource, props: { rel: "stylesheet", href: href, - "data-precedence": precedence, + "data-precedence": as, crossOrigin: options.crossOrigin, integrity: options.integrity } - }), - resources.stylesMap.set(key, as), - (href = resources.precedences.get(precedence)), + }; + resources.stylesMap.set(key, resource); + href = resources.precedences.get(as); href || ((href = new Set()), - resources.precedences.set(precedence, href), + resources.precedences.set(as, href), (options = { type: "style", chunks: [], state: 0, - props: { precedence: precedence, hrefs: [] } + props: { precedence: as, hrefs: [] } }), href.add(options), - resources.stylePrecedences.set(precedence, options)), - href.add(as), - enqueueFlush(request)); + resources.stylePrecedences.set(as, options)); + href.add(resource); + enqueueFlush(request); + } break; case "script": - (precedence = "[" + as + "]" + href), - (as = resources.scriptsMap.get(precedence)), + (key = "[" + as + "]" + href), + (as = resources.scriptsMap.get(key)), as || ((as = { type: "script", chunks: [], state: 0, props: null }), - resources.scriptsMap.set(precedence, as), + resources.scriptsMap.set(key, as), (href = { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), resources.scripts.add(as), pushScriptImpl(as.chunks, href), @@ -2215,9 +2231,7 @@ function getComponentNameFromType(type) { } return null; } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - emptyContextObject = {}; +var emptyContextObject = {}; function getMaskedContext(type, unmaskedContext) { type = type.contextTypes; if (!type) return emptyContextObject; @@ -3960,4 +3974,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-classic-c76bb5a5"; +exports.version = "18.3.0-www-classic-dcd0808f"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index edf83d00af..47717988b9 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -182,6 +182,8 @@ function sanitizeURL(url) { : url; } var isArrayImpl = Array.isArray, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactDOMCurrentDispatcher = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher, ReactDOMServerDispatcher = { @@ -529,19 +531,29 @@ function pushLink( pushLinkImpl(target, props) ); href = resources.stylesMap.get(responseState); - if (!href) { - props = assign({}, props, { + href || + ((props = assign({}, props, { "data-precedence": props.precedence, precedence: null - }); - if ((href = resources.preloadsMap.get(responseState))) - (href.state |= 4), - (href = href.props), - null == props.crossOrigin && (props.crossOrigin = href.crossOrigin), - null == props.integrity && (props.integrity = href.integrity); - href = { type: "stylesheet", chunks: [], state: 0, props: props }; - resources.stylesMap.set(responseState, href); - props = resources.precedences.get(precedence); + })), + (href = resources.preloadsMap.get(responseState)), + (insertionMode = 0), + href && + ((href.state |= 4), + (noscriptTagInScope = href.props), + null == props.crossOrigin && + (props.crossOrigin = noscriptTagInScope.crossOrigin), + null == props.integrity && + (props.integrity = noscriptTagInScope.integrity), + href.state & 3 && (insertionMode = 8)), + (href = { + type: "stylesheet", + chunks: [], + state: insertionMode, + props: props + }), + resources.stylesMap.set(responseState, href), + (props = resources.precedences.get(precedence)), props || ((props = new Set()), resources.precedences.set(precedence, props), @@ -552,9 +564,8 @@ function pushLink( props: { precedence: precedence, hrefs: [] } }), props.add(responseState), - resources.stylePrecedences.set(precedence, responseState)); - props.add(href); - } + resources.stylePrecedences.set(precedence, responseState)), + props.add(href)); resources.boundaryResources && resources.boundaryResources.add(href); textEmbedded && target.push("\x3c!-- --\x3e"); return null; @@ -1585,7 +1596,7 @@ function flushAllStylesInPreamble(set, precedence) { } } function preloadLateStyle(resource) { - if ("style" !== resource.type) { + if (!(resource.state & 8) && "style" !== resource.type) { var chunks = resource.chunks, preloadProps = preloadAsStylePropsFromProps( resource.props.href, @@ -2009,49 +2020,54 @@ function preinit(href, options) { var as = options.as; switch (as) { case "style": - var key = "[" + as + "]" + href; - as = resources.stylesMap.get(key); - var precedence = options.precedence || "default"; - as || - ((as = { + var key = "[" + as + "]" + href, + resource = resources.stylesMap.get(key); + as = options.precedence || "default"; + if (!resource) { + resource = 0; + var preloadResource = resources.preloadsMap.get(key); + preloadResource && preloadResource.state & 3 && (resource = 8); + resource = { type: "stylesheet", chunks: [], - state: 0, + state: resource, props: { rel: "stylesheet", href: href, - "data-precedence": precedence, + "data-precedence": as, crossOrigin: options.crossOrigin, integrity: options.integrity } - }), - resources.stylesMap.set(key, as), - (href = resources.precedences.get(precedence)), + }; + resources.stylesMap.set(key, resource); + href = resources.precedences.get(as); href || ((href = new Set()), - resources.precedences.set(precedence, href), + resources.precedences.set(as, href), (options = { type: "style", chunks: [], state: 0, - props: { precedence: precedence, hrefs: [] } + props: { precedence: as, hrefs: [] } }), href.add(options), - resources.stylePrecedences.set(precedence, options)), - href.add(as), - enqueueFlush(request)); + resources.stylePrecedences.set(as, options)); + href.add(resource); + enqueueFlush(request); + } break; case "script": - (precedence = "[" + as + "]" + href), - (as = resources.scriptsMap.get(precedence)), + (key = "[" + as + "]" + href), + (as = resources.scriptsMap.get(key)), as || ((as = { type: "script", chunks: [], state: 0, props: null }), - resources.scriptsMap.set(precedence, as), + resources.scriptsMap.set(key, as), (href = { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), resources.scripts.add(as), pushScriptImpl(as.chunks, href), @@ -2156,8 +2172,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"), ), REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, emptyContextObject = {}, currentActiveSnapshot = null; function popToNearestCommonAncestor(prev, next) { @@ -3857,4 +3871,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-modern-86ff718c"; +exports.version = "18.3.0-www-modern-9c1f7368"; diff --git a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js index e08643e2e5..40fb3d403d 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js @@ -2326,6 +2326,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) { return description; } +var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -4091,6 +4094,7 @@ function pushLink( if (!_resource) { var resourceProps = stylesheetPropsFromRawProps(props); var preloadResource = resources.preloadsMap.get(key); + var state = NoState; if (preloadResource) { // If we already had a preload we don't want that resource to flush directly. @@ -4100,12 +4104,16 @@ function pushLink( resourceProps, preloadResource.props ); + + if (preloadResource.state & Flushed) { + state = PreloadFlushed; + } } _resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: resourceProps }; resources.stylesMap.set(key, _resource); @@ -6136,12 +6144,9 @@ function flushAllStylesInPreamble(set, precedence) { } function preloadLateStyle(resource) { - { - if (resource.state & PreloadFlushed) { - error( - "React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React." - ); - } + if (resource.state & PreloadFlushed) { + // This resource has already had a preload flushed + return; } if (resource.type === "style") { @@ -7248,10 +7253,17 @@ function preinit(href, options) { } if (!resource) { + var state = NoState; + var preloadResource = resources.preloadsMap.get(key); + + if (preloadResource && preloadResource.state & Flushed) { + state = PreloadFlushed; + } + resource = { type: "stylesheet", chunks: [], - state: NoState, + state: state, props: stylesheetPropsFromPreinitOptions(href, precedence, options) }; resources.stylesMap.set(key, resource); @@ -7494,7 +7506,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } @@ -7836,9 +7849,6 @@ function reenableLogs() { } } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { diff --git a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js index d2d4793167..902ed56a35 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js @@ -170,6 +170,8 @@ function sanitizeURL(url) { : url; } var isArrayImpl = Array.isArray, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactDOMCurrentDispatcher = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher, ReactDOMServerDispatcher = { @@ -535,19 +537,29 @@ function pushLink( pushLinkImpl(target, props) ); href = resources.stylesMap.get(responseState); - if (!href) { - props = assign({}, props, { + href || + ((props = assign({}, props, { "data-precedence": props.precedence, precedence: null - }); - if ((href = resources.preloadsMap.get(responseState))) - (href.state |= 4), - (href = href.props), - null == props.crossOrigin && (props.crossOrigin = href.crossOrigin), - null == props.integrity && (props.integrity = href.integrity); - href = { type: "stylesheet", chunks: [], state: 0, props: props }; - resources.stylesMap.set(responseState, href); - props = resources.precedences.get(precedence); + })), + (href = resources.preloadsMap.get(responseState)), + (insertionMode = 0), + href && + ((href.state |= 4), + (noscriptTagInScope = href.props), + null == props.crossOrigin && + (props.crossOrigin = noscriptTagInScope.crossOrigin), + null == props.integrity && + (props.integrity = noscriptTagInScope.integrity), + href.state & 3 && (insertionMode = 8)), + (href = { + type: "stylesheet", + chunks: [], + state: insertionMode, + props: props + }), + resources.stylesMap.set(responseState, href), + (props = resources.precedences.get(precedence)), props || ((props = new Set()), resources.precedences.set(precedence, props), @@ -558,9 +570,8 @@ function pushLink( props: { precedence: precedence, hrefs: [] } }), props.add(responseState), - resources.stylePrecedences.set(precedence, responseState)); - props.add(href); - } + resources.stylePrecedences.set(precedence, responseState)), + props.add(href)); resources.boundaryResources && resources.boundaryResources.add(href); textEmbedded && target.push("\x3c!-- --\x3e"); return null; @@ -1616,7 +1627,7 @@ function flushAllStylesInPreamble(set, precedence) { } } function preloadLateStyle(resource) { - if ("style" !== resource.type) { + if (!(resource.state & 8) && "style" !== resource.type) { var chunks = resource.chunks, preloadProps = preloadAsStylePropsFromProps( resource.props.href, @@ -2061,49 +2072,54 @@ function preinit(href, options) { var as = options.as; switch (as) { case "style": - var key = "[" + as + "]" + href; - as = resources.stylesMap.get(key); - var precedence = options.precedence || "default"; - as || - ((as = { + var key = "[" + as + "]" + href, + resource = resources.stylesMap.get(key); + as = options.precedence || "default"; + if (!resource) { + resource = 0; + var preloadResource = resources.preloadsMap.get(key); + preloadResource && preloadResource.state & 3 && (resource = 8); + resource = { type: "stylesheet", chunks: [], - state: 0, + state: resource, props: { rel: "stylesheet", href: href, - "data-precedence": precedence, + "data-precedence": as, crossOrigin: options.crossOrigin, integrity: options.integrity } - }), - resources.stylesMap.set(key, as), - (href = resources.precedences.get(precedence)), + }; + resources.stylesMap.set(key, resource); + href = resources.precedences.get(as); href || ((href = new Set()), - resources.precedences.set(precedence, href), + resources.precedences.set(as, href), (options = { type: "style", chunks: [], state: 0, - props: { precedence: precedence, hrefs: [] } + props: { precedence: as, hrefs: [] } }), href.add(options), - resources.stylePrecedences.set(precedence, options)), - href.add(as), - enqueueFlush(request)); + resources.stylePrecedences.set(as, options)); + href.add(resource); + enqueueFlush(request); + } break; case "script": - (precedence = "[" + as + "]" + href), - (as = resources.scriptsMap.get(precedence)), + (key = "[" + as + "]" + href), + (as = resources.scriptsMap.get(key)), as || ((as = { type: "script", chunks: [], state: 0, props: null }), - resources.scriptsMap.set(precedence, as), + resources.scriptsMap.set(key, as), (href = { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), resources.scripts.add(as), pushScriptImpl(as.chunks, href), @@ -2162,8 +2178,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"), ), REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, emptyContextObject = {}, currentActiveSnapshot = null; function popToNearestCommonAncestor(prev, next) { diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index c4ba0514eb..e9baf1d374 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -963,6 +963,12 @@ function isReplayingEvent(event) { return event === currentReplayingEvent; } +function useFormStatus() { + { + throw new Error("Not implemented."); + } +} + var valueStack = []; var fiberStack; @@ -1016,7 +1022,7 @@ function push(cursor, value, fiber) { var contextStackCursor$1 = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -1074,24 +1080,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor$1.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor$1, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); } // This module only exists as an ESM wrapper around the external CommonJS @@ -12418,8 +12421,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -12428,81 +12443,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -12964,6 +13032,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -13039,11 +13108,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -13053,7 +13123,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -13636,11 +13706,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -14532,14 +14602,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$3.transition = {}); if (enableTransitionTracing) { @@ -14555,16 +14631,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -14609,7 +14685,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -30070,9 +30146,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -30878,7 +30954,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -30935,10 +31011,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -31699,7 +31775,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -31745,7 +31821,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -32970,7 +33046,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); @@ -34508,7 +34584,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-cbba93aa"; +var ReactVersion = "18.3.0-www-classic-03a5fb2c"; function createPortal$1( children, @@ -44207,9 +44283,12 @@ function preload$1(href, options) { var as = options.as; var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href); - var preloadKey = - 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; - var key = preloadKey; + var preloadSelector = + 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for + // an arbitrary type. Other preloads are keyed under the resource key they represent a preload for. + // Here we figure out which key to use to determine if we have a preload already. + + var key = preloadSelector; switch (as) { case "style": @@ -44225,7 +44304,21 @@ function preload$1(href, options) { var preloadProps = preloadPropsFromPreloadOptions(href, as, options); preloadPropsMap.set(key, preloadProps); - if (null === ownerDocument.querySelector(preloadKey)) { + if (null === ownerDocument.querySelector(preloadSelector)) { + if ( + as === "style" && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } else if ( + as === "script" && + ownerDocument.querySelector(getScriptSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } + var instance = ownerDocument.createElement("link"); setInitialProperties(instance, "link", preloadProps); markNodeAsHoistable(instance); @@ -44387,7 +44480,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } // This function is called in begin work and we should always have a currentDocument set @@ -47317,12 +47411,6 @@ function preinit(href, options) { // so we favor silent bailout over warning or erroring. } -function useFormStatus() { - { - throw new Error("Not implemented."); - } -} - { if ( typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 923eb1cd5f..33cdd6e755 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -96,6 +96,51 @@ function printWarning(level, format, args) { var assign = Object.assign; +// Re-export dynamic flags from the www version. +var dynamicFeatureFlags = require("ReactFeatureFlags"); + +var disableInputAttributeSyncing = + dynamicFeatureFlags.disableInputAttributeSyncing, + disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, + enableTrustedTypesIntegration = + dynamicFeatureFlags.enableTrustedTypesIntegration, + replayFailedUnitOfWorkWithInvokeGuardedCallback = + dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, + enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, + enableLazyContextPropagation = + dynamicFeatureFlags.enableLazyContextPropagation, + enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, + enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableCustomElementPropertySupport = + dynamicFeatureFlags.enableCustomElementPropertySupport, + enableDeferRootSchedulingToMicrotask = + dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, + diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, + enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build. +var enableProfilerTimer = true; +var enableProfilerCommitHooks = true; +var enableProfilerNestedUpdatePhase = true; +var enableProfilerNestedUpdateScheduledHook = + dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook; +var createRootStrictEffectsByDefault = false; +var enableClientRenderFallbackOnTextMismatch = false; + +var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation. +var enableSuspenseCallback = true; + +var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function useFormStatus() { + { + throw new Error("Not implemented."); + } +} + var valueStack = []; var fiberStack; @@ -147,9 +192,54 @@ function push(cursor, value, fiber) { cursor.current = value; } +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. +var REACT_ELEMENT_TYPE = Symbol.for("react.element"); +var REACT_PORTAL_TYPE = Symbol.for("react.portal"); +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); +var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); +var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); +var REACT_CONTEXT_TYPE = Symbol.for("react.context"); +var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); +var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); +var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); +var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); +var REACT_MEMO_TYPE = Symbol.for("react.memo"); +var REACT_LAZY_TYPE = Symbol.for("react.lazy"); +var REACT_SCOPE_TYPE = Symbol.for("react.scope"); +var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); +var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); +var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); +var REACT_CACHE_TYPE = Symbol.for("react.cache"); +var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); +var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( + "react.default_value" +); +var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); +var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = "@@iterator"; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + + var maybeIterator = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === "function") { + return maybeIterator; + } + + return null; +} + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -207,62 +297,23 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } -// Re-export dynamic flags from the www version. -var dynamicFeatureFlags = require("ReactFeatureFlags"); - -var disableInputAttributeSyncing = - dynamicFeatureFlags.disableInputAttributeSyncing, - disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, - enableTrustedTypesIntegration = - dynamicFeatureFlags.enableTrustedTypesIntegration, - replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, - enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, - enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableCustomElementPropertySupport = - dynamicFeatureFlags.enableCustomElementPropertySupport, - enableDeferRootSchedulingToMicrotask = - dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, - enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build. -var enableProfilerTimer = true; -var enableProfilerCommitHooks = true; -var enableProfilerNestedUpdatePhase = true; -var enableProfilerNestedUpdateScheduledHook = - dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook; -var createRootStrictEffectsByDefault = false; -var enableClientRenderFallbackOnTextMismatch = false; - -var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation. -var enableSuspenseCallback = true; - var NoFlags$1 = /* */ 0; @@ -2879,54 +2930,6 @@ function setValueForPropertyOnCustomComponent(node, name, value) { setValueForAttribute(node, name, value); } -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -var REACT_ELEMENT_TYPE = Symbol.for("react.element"); -var REACT_PORTAL_TYPE = Symbol.for("react.portal"); -var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); -var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); -var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); -var REACT_CONTEXT_TYPE = Symbol.for("react.context"); -var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); -var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); -var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); -var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); -var REACT_MEMO_TYPE = Symbol.for("react.memo"); -var REACT_LAZY_TYPE = Symbol.for("react.lazy"); -var REACT_SCOPE_TYPE = Symbol.for("react.scope"); -var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); -var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); -var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); -var REACT_CACHE_TYPE = Symbol.for("react.cache"); -var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); -var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( - "react.default_value" -); -var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); -var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = "@@iterator"; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - - var maybeIterator = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === "function") { - return maybeIterator; - } - - return null; -} - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { @@ -12359,8 +12362,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -12369,81 +12384,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -12905,6 +12973,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -12980,11 +13049,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -12994,7 +13064,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -13577,11 +13647,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -14473,14 +14543,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$3.transition = {}); if (enableTransitionTracing) { @@ -14496,16 +14572,16 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { - var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`, - // depending on whether the action scope is an async function. In the - // async case, the resulting render will suspend until the async action - // scope has finished. + var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to + // `finishedState`, depending on whether the action scope is an async + // function. In the async case, the resulting render will suspend until + // the async action scope has finished. - var isPending = requestAsyncActionContext(returnValue); - setPending(isPending); + var maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); } else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -14550,7 +14626,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -29920,9 +29996,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -30728,7 +30804,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -30785,10 +30861,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -31544,7 +31620,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -31590,7 +31666,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -32815,7 +32891,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { // same fiber again. // Unwind the failed stack frame - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); @@ -34353,7 +34429,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-c0c40983"; +var ReactVersion = "18.3.0-www-modern-cf89ed45"; function createPortal$1( children, @@ -44717,9 +44793,12 @@ function preload$1(href, options) { var as = options.as; var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href); - var preloadKey = - 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; - var key = preloadKey; + var preloadSelector = + 'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for + // an arbitrary type. Other preloads are keyed under the resource key they represent a preload for. + // Here we figure out which key to use to determine if we have a preload already. + + var key = preloadSelector; switch (as) { case "style": @@ -44735,7 +44814,21 @@ function preload$1(href, options) { var preloadProps = preloadPropsFromPreloadOptions(href, as, options); preloadPropsMap.set(key, preloadProps); - if (null === ownerDocument.querySelector(preloadKey)) { + if (null === ownerDocument.querySelector(preloadSelector)) { + if ( + as === "style" && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } else if ( + as === "script" && + ownerDocument.querySelector(getScriptSelectorFromKey(key)) + ) { + // We already have a stylesheet for this key. We don't need to preload it. + return; + } + var instance = ownerDocument.createElement("link"); setInitialProperties(instance, "link", preloadProps); markNodeAsHoistable(instance); @@ -44897,7 +44990,8 @@ function scriptPropsFromPreinitOptions(src, options) { src: src, async: true, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }; } // This function is called in begin work and we should always have a currentDocument set @@ -46406,12 +46500,6 @@ function preinit(href, options) { // so we favor silent bailout over warning or erroring. } -function useFormStatus() { - { - throw new Error("Not implemented."); - } -} - { if ( typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 092c3d925a..02d22820ba 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -3360,57 +3360,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$45 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$45); - return asyncAction$45; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$46 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$46.status = "fulfilled"; + resultThenable$46.value = finishedState; + }); + return resultThenable$46; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3482,6 +3505,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3506,12 +3530,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3746,12 +3774,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3804,10 +3832,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -4034,13 +4062,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -4050,9 +4084,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -4075,14 +4109,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$51 = enqueueUpdate(provider, fiber, lane); - null !== root$51 && - (scheduleUpdateOnFiber(root$51, provider, lane), - entangleTransitions(root$51, provider, lane)); + var root$52 = enqueueUpdate(provider, fiber, lane); + null !== root$52 && + (scheduleUpdateOnFiber(root$52, provider, lane), + entangleTransitions(root$52, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$51 && + null !== root$52 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4263,7 +4297,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4285,15 +4319,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$47 = workInProgressRoot; - if (null === root$47) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$47, renderLanes$1) || + var root$48 = workInProgressRoot; + if (null === root$48) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$48, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$47 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$47; - mountEffect(subscribeToStore.bind(null, fiber, root$47, subscribe), [ + root$48 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$48; + mountEffect(subscribeToStore.bind(null, fiber, root$48, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4302,7 +4336,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$47, + root$48, getServerSnapshot, getSnapshot ), @@ -4807,10 +4841,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$62 = workInProgress.stateNode; + root$63 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$62.incompleteTransitions.has(transition)) { + if (!root$63.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4818,11 +4852,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$62.incompleteTransitions.set(transition, markerInstance); + root$63.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$62.incompleteTransitions.forEach(function (markerInstance) { + root$63.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5519,14 +5553,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$69 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$69) + var dehydrated$70 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$70) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$69, + dehydrated$70, JSCompiler_temp, renderLanes ); @@ -5536,7 +5570,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$69 = JSCompiler_temp.sibling; + dehydrated$70 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5545,8 +5579,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$69 - ? (showFallback = createWorkInProgress(dehydrated$69, showFallback)) + null !== dehydrated$70 + ? (showFallback = createWorkInProgress(dehydrated$70, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5565,10 +5599,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$69 = CacheContext._currentValue), + ? ((dehydrated$70 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$69 - ? { parent: dehydrated$69, pool: dehydrated$69 } + JSCompiler_temp.parent !== dehydrated$70 + ? { parent: dehydrated$70, pool: dehydrated$70 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5582,23 +5616,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$69 = showFallback.updateQueue), + (dehydrated$70 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$69 + null === dehydrated$70 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$69 === primaryChildProps + : dehydrated$70 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$69.transitions = didSuspend), - (dehydrated$69.markerInstances = JSCompiler_temp)))); + : ((dehydrated$70.transitions = didSuspend), + (dehydrated$70.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6665,14 +6699,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6682,19 +6716,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags & 31457280), + (subtreeFlags |= child$102.flags & 31457280), + (child$102.return = completedWork), + (child$102 = child$102.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags), + (subtreeFlags |= child$102.flags), + (child$102.return = completedWork), + (child$102 = child$102.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7440,8 +7474,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$131) { - captureCommitPhaseError(current, nearestMountedAncestor, error$131); + } catch (error$132) { + captureCommitPhaseError(current, nearestMountedAncestor, error$132); } else ref.current = null; } @@ -7478,7 +7512,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$188) { + } catch (e$189) { JSCompiler_temp = null; break a; } @@ -7744,11 +7778,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$133) { + } catch (error$134) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$133 + error$134 ); } } @@ -8428,8 +8462,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$146) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$146); + } catch (error$147) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$147); } } break; @@ -8611,11 +8645,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$147) { + } catch (error$148) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$147 + error$148 ); } break; @@ -8651,8 +8685,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$148) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$148); + } catch (error$149) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$149); } } if ( @@ -8677,8 +8711,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$151) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$151); + } catch (error$152) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$152); } break; case 6: @@ -8691,8 +8725,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); + } catch (error$153) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$153); } } break; @@ -8706,8 +8740,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$153) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$153); + } catch (error$154) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$154); } break; case 4: @@ -8737,8 +8771,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$155) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$155); + } catch (error$156) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$156); } current = finishedWork.updateQueue; null !== current && @@ -8816,11 +8850,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$136) { + } catch (error$137) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$136 + error$137 ); } } else if ( @@ -8895,21 +8929,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$137 = JSCompiler_inline_result.stateNode; + var parent$138 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$137, ""), + (setTextContent(parent$138, ""), (JSCompiler_inline_result.flags &= -33)); - var before$138 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$138, parent$137); + var before$139 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$139, parent$138); break; case 3: case 4: - var parent$139 = JSCompiler_inline_result.stateNode.containerInfo, - before$140 = getHostSibling(finishedWork); + var parent$140 = JSCompiler_inline_result.stateNode.containerInfo, + before$141 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$140, - parent$139 + before$141, + parent$140 ); break; default: @@ -9379,9 +9413,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$165 = finishedWork.stateNode; + var instance$166 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$165._visibility & 4 + ? instance$166._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9394,7 +9428,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$165._visibility |= 4), + : ((instance$166._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9402,7 +9436,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$165._visibility |= 4), + : ((instance$166._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9415,7 +9449,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$165 + instance$166 ); break; case 24: @@ -10032,8 +10066,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -10129,16 +10163,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$175 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$176 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$175 && - ((lanes = errorRetryLanes$175), + 0 !== errorRetryLanes$176 && + ((lanes = errorRetryLanes$176), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$175 + errorRetryLanes$176 ))); } if (1 === exitStatus) @@ -10347,8 +10381,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -10386,6 +10421,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10469,8 +10505,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$177) { - handleThrow(root, thrownValue$177); + } catch (thrownValue$178) { + handleThrow(root, thrownValue$178); } while (1); resetContextDependencies(); @@ -10574,8 +10610,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$179) { - handleThrow(root, thrownValue$179); + } catch (thrownValue$180) { + handleThrow(root, thrownValue$180); } while (1); resetContextDependencies(); @@ -10641,7 +10677,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -10656,7 +10692,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -10742,10 +10778,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$57 = offscreenQueue.retryQueue; - null === retryQueue$57 + var retryQueue$58 = offscreenQueue.retryQueue; + null === retryQueue$58 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$57.add(wakeable); + : retryQueue$58.add(wakeable); } } break; @@ -10929,12 +10965,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$183 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$184 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$183 && + shouldFireAfterActiveInstanceBlur$184 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11013,7 +11049,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$184 = rootWithPendingPassiveEffects, + var root$185 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -11029,7 +11065,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$184, remainingLanes); + releaseRootPooledCache(root$185, remainingLanes); } } return !1; @@ -12325,12 +12361,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$186 = fiber.stateNode; - if (root$186.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$186.pendingLanes); + var root$187 = fiber.stateNode; + if (root$187.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$187.pendingLanes); 0 !== lanes && - (markRootEntangled(root$186, lanes | 2), - ensureRootIsScheduled(root$186), + (markRootEntangled(root$187, lanes | 2), + ensureRootIsScheduled(root$187), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -12896,19 +12932,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$375; + var JSCompiler_inline_result$jscomp$376; if (canUseDOM) { - var isSupported$jscomp$inline_1633 = "oninput" in document; - if (!isSupported$jscomp$inline_1633) { - var element$jscomp$inline_1634 = document.createElement("div"); - element$jscomp$inline_1634.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1633 = - "function" === typeof element$jscomp$inline_1634.oninput; + var isSupported$jscomp$inline_1636 = "oninput" in document; + if (!isSupported$jscomp$inline_1636) { + var element$jscomp$inline_1637 = document.createElement("div"); + element$jscomp$inline_1637.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1636 = + "function" === typeof element$jscomp$inline_1637.oninput; } - JSCompiler_inline_result$jscomp$375 = isSupported$jscomp$inline_1633; - } else JSCompiler_inline_result$jscomp$375 = !1; + JSCompiler_inline_result$jscomp$376 = isSupported$jscomp$inline_1636; + } else JSCompiler_inline_result$jscomp$376 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$375 && + JSCompiler_inline_result$jscomp$376 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13217,20 +13253,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1674 = 0; - i$jscomp$inline_1674 < simpleEventPluginEvents.length; - i$jscomp$inline_1674++ + var i$jscomp$inline_1677 = 0; + i$jscomp$inline_1677 < simpleEventPluginEvents.length; + i$jscomp$inline_1677++ ) { - var eventName$jscomp$inline_1675 = - simpleEventPluginEvents[i$jscomp$inline_1674], - domEventName$jscomp$inline_1676 = - eventName$jscomp$inline_1675.toLowerCase(), - capitalizedEvent$jscomp$inline_1677 = - eventName$jscomp$inline_1675[0].toUpperCase() + - eventName$jscomp$inline_1675.slice(1); + var eventName$jscomp$inline_1678 = + simpleEventPluginEvents[i$jscomp$inline_1677], + domEventName$jscomp$inline_1679 = + eventName$jscomp$inline_1678.toLowerCase(), + capitalizedEvent$jscomp$inline_1680 = + eventName$jscomp$inline_1678[0].toUpperCase() + + eventName$jscomp$inline_1678.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1676, - "on" + capitalizedEvent$jscomp$inline_1677 + domEventName$jscomp$inline_1679, + "on" + capitalizedEvent$jscomp$inline_1680 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14646,14 +14682,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$215 in nextProps) { - var propKey = nextProps[propKey$215]; - lastProp = lastProps[propKey$215]; + for (var propKey$216 in nextProps) { + var propKey = nextProps[propKey$216]; + lastProp = lastProps[propKey$216]; if ( - nextProps.hasOwnProperty(propKey$215) && + nextProps.hasOwnProperty(propKey$216) && (null != propKey || null != lastProp) ) - switch (propKey$215) { + switch (propKey$216) { case "type": type = propKey; break; @@ -14682,7 +14718,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$215, + propKey$216, propKey, nextProps, lastProp @@ -14701,7 +14737,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$215 = null; + defaultValue = value = propKey = propKey$216 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14732,7 +14768,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$215 = type; + propKey$216 = type; break; case "defaultValue": propKey = type; @@ -14750,10 +14786,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$215, propKey, value, defaultValue); + updateSelect(domElement, propKey$216, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$215 = null; + propKey = propKey$216 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14777,7 +14813,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$215 = name; + propKey$216 = name; break; case "defaultValue": propKey = name; @@ -14791,17 +14827,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$215, propKey); + updateTextarea(domElement, propKey$216, propKey); return; case "option": - for (var propKey$231 in lastProps) + for (var propKey$232 in lastProps) if ( - ((propKey$215 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$231)) + ((propKey$216 = lastProps[propKey$232]), + lastProps.hasOwnProperty(propKey$232) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$232)) ) - switch (propKey$231) { + switch (propKey$232) { case "selected": domElement.selected = !1; break; @@ -14809,33 +14845,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$231, + propKey$232, null, nextProps, - propKey$215 + propKey$216 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$215 = nextProps[lastDefaultValue]), + ((propKey$216 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$215 && - "function" !== typeof propKey$215 && - "symbol" !== typeof propKey$215; + propKey$216 && + "function" !== typeof propKey$216 && + "symbol" !== typeof propKey$216; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$215, + propKey$216, nextProps, propKey ); @@ -14856,24 +14892,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$236 in lastProps) - (propKey$215 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$236) && - setProp(domElement, tag, propKey$236, null, nextProps, propKey$215); + for (var propKey$237 in lastProps) + (propKey$216 = lastProps[propKey$237]), + lastProps.hasOwnProperty(propKey$237) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$237) && + setProp(domElement, tag, propKey$237, null, nextProps, propKey$216); for (checked in nextProps) if ( - ((propKey$215 = nextProps[checked]), + ((propKey$216 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$215) + if (null != propKey$216) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14881,7 +14917,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$215, + propKey$216, nextProps, propKey ); @@ -14889,49 +14925,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$241 in lastProps) - (propKey$215 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$241) && + for (var propKey$242 in lastProps) + (propKey$216 = lastProps[propKey$242]), + lastProps.hasOwnProperty(propKey$242) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$242) && setPropOnCustomElement( domElement, tag, - propKey$241, + propKey$242, null, nextProps, - propKey$215 + propKey$216 ); for (defaultChecked in nextProps) - (propKey$215 = nextProps[defaultChecked]), + (propKey$216 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$215 === propKey || - (null == propKey$215 && null == propKey) || + propKey$216 === propKey || + (null == propKey$216 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$215, + propKey$216, nextProps, propKey ); return; } } - for (var propKey$246 in lastProps) - (propKey$215 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$246) && - setProp(domElement, tag, propKey$246, null, nextProps, propKey$215); + for (var propKey$247 in lastProps) + (propKey$216 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$247) && + setProp(domElement, tag, propKey$247, null, nextProps, propKey$216); for (lastProp in nextProps) - (propKey$215 = nextProps[lastProp]), + (propKey$216 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$215 === propKey || - (null == propKey$215 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$215, nextProps, propKey); + propKey$216 === propKey || + (null == propKey$216 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$216, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15506,11 +15542,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -15579,7 +15619,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -15623,17 +15664,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$280 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$281 = styles$280.get(type); - resource$281 || + var styles$281 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$282 = styles$281.get(type); + resource$282 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$281 = { + (resource$282 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$280.set(type, resource$281), + styles$281.set(type, resource$282), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15648,9 +15689,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$281.state + resource$282.state )); - return resource$281; + return resource$282; } return null; case "script": @@ -15730,36 +15771,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$285 = hoistableRoot.querySelector( + var instance$286 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$285) + if (instance$286) return ( - (resource.instance = instance$285), - markNodeAsHoistable(instance$285), - instance$285 + (resource.instance = instance$286), + markNodeAsHoistable(instance$286), + instance$286 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$285 = ( + instance$286 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$285); - var linkInstance = instance$285; + markNodeAsHoistable(instance$286); + var linkInstance = instance$286; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$285, "link", instance); + setInitialProperties(instance$286, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$285, props.precedence, hoistableRoot); - return (resource.instance = instance$285); + insertStylesheet(instance$286, props.precedence, hoistableRoot); + return (resource.instance = instance$286); case "script": - instance$285 = getScriptKey(props.src); + instance$286 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$285 + "script[async]" + instance$286 )) ) return ( @@ -15768,7 +15809,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$285))) + if ((styleProps = preloadPropsMap.get(instance$286))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16720,11 +16761,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$305); + var instance = getPublicRootInstance(root$306); originalCallback.call(instance); }; } - var root$305 = createHydrationContainer( + var root$306 = createHydrationContainer( initialChildren, callback, container, @@ -16736,23 +16777,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$305; - container[internalContainerInstanceKey] = root$305.current; + container._reactRootContainer = root$306; + container[internalContainerInstanceKey] = root$306.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$305; + return root$306; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$306 = callback; + var originalCallback$307 = callback; callback = function () { - var instance = getPublicRootInstance(root$307); - originalCallback$306.call(instance); + var instance = getPublicRootInstance(root$308); + originalCallback$307.call(instance); }; } - var root$307 = createFiberRoot( + var root$308 = createFiberRoot( container, 0, !1, @@ -16764,15 +16805,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$307; - container[internalContainerInstanceKey] = root$307.current; + container._reactRootContainer = root$308; + container[internalContainerInstanceKey] = root$308.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$307, parentComponent, callback); + updateContainer(initialChildren, root$308, parentComponent, callback); }); - return root$307; + return root$308; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -16832,17 +16873,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1884 = { +var devToolsConfig$jscomp$inline_1887 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-0a3d97ff", + version: "18.3.0-www-classic-4e446d05", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2253 = { - bundleType: devToolsConfig$jscomp$inline_1884.bundleType, - version: devToolsConfig$jscomp$inline_1884.version, - rendererPackageName: devToolsConfig$jscomp$inline_1884.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1884.rendererConfig, +var internals$jscomp$inline_2256 = { + bundleType: devToolsConfig$jscomp$inline_1887.bundleType, + version: devToolsConfig$jscomp$inline_1887.version, + rendererPackageName: devToolsConfig$jscomp$inline_1887.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1887.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16858,26 +16899,26 @@ var internals$jscomp$inline_2253 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1884.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1887.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-0a3d97ff" + reconcilerVersion: "18.3.0-www-classic-4e446d05" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2254 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2257 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2254.isDisabled && - hook$jscomp$inline_2254.supportsFiber + !hook$jscomp$inline_2257.isDisabled && + hook$jscomp$inline_2257.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2254.inject( - internals$jscomp$inline_2253 + (rendererID = hook$jscomp$inline_2257.inject( + internals$jscomp$inline_2256 )), - (injectedHook = hook$jscomp$inline_2254); + (injectedHook = hook$jscomp$inline_2257); } catch (err) {} } assign(Internals, { @@ -17259,4 +17300,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-0a3d97ff"; +exports.version = "18.3.0-www-classic-4e446d05"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index f3b9cc46b4..81ee446188 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -38,6 +38,29 @@ function formatProdErrorMessage(code) { ); } var assign = Object.assign, + dynamicFeatureFlags = require("ReactFeatureFlags"), + disableInputAttributeSyncing = + dynamicFeatureFlags.disableInputAttributeSyncing, + disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, + enableTrustedTypesIntegration = + dynamicFeatureFlags.enableTrustedTypesIntegration, + enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, + enableLazyContextPropagation = + dynamicFeatureFlags.enableLazyContextPropagation, + enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, + enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableCustomElementPropertySupport = + dynamicFeatureFlags.enableCustomElementPropertySupport, + enableDeferRootSchedulingToMicrotask = + dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, + diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, + enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -52,6 +75,37 @@ function push(cursor, value) { valueStack[index] = cursor.current; cursor.current = value; } +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_CACHE_TYPE = Symbol.for("react.cache"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( + "react.default_value" + ), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null); @@ -108,28 +162,7 @@ function popHostContext(fiber) { contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor)); } -var dynamicFeatureFlags = require("ReactFeatureFlags"), - disableInputAttributeSyncing = - dynamicFeatureFlags.disableInputAttributeSyncing, - disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, - enableTrustedTypesIntegration = - dynamicFeatureFlags.enableTrustedTypesIntegration, - enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates, - enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableCustomElementPropertySupport = - dynamicFeatureFlags.enableCustomElementPropertySupport, - enableDeferRootSchedulingToMicrotask = - dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, - enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -140,8 +173,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, - ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null; function onCommitRoot(root) { @@ -687,37 +718,6 @@ function setValueForNamespacedAttribute(node, namespace, name, value) { ); } } -var REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_CACHE_TYPE = Symbol.for("react.cache"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for( - "react.default_value" - ), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} var prefix; function describeBuiltInComponentFrame(name) { if (void 0 === prefix) @@ -3308,57 +3308,80 @@ function requestTransitionLane() { (currentEventTransitionLane = claimNextTransitionLane()); return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( null !== actionReturnValue && "object" === typeof actionReturnValue && "function" === typeof actionReturnValue.then ) { - if (null === currentAsyncAction) { - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: !1, - reason: void 0, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(actionReturnValue, asyncAction); - return (currentAsyncAction = asyncAction); - } - var asyncAction$45 = currentAsyncAction; - attachPingListeners(actionReturnValue, asyncAction$45); - return asyncAction$45; + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + } else entangledListeners = currentEntangledListeners; + currentEntangledPendingCount++; + var resultStatus = "pending", + rejectedReason; + actionReturnValue.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); + var resultThenable = createResultThenable(entangledListeners); + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": + resultThenable.status = "fulfilled"; + resultThenable.value = finishedState; + break; + case "rejected": + resultThenable.status = "rejected"; + resultThenable.reason = rejectedReason; + break; + default: + throw Error(formatProdErrorMessage(478)); + } + }); + return resultThenable; } - return null === currentAsyncAction ? !1 : currentAsyncAction; + if (null === currentEntangledListeners) return finishedState; + actionReturnValue = currentEntangledListeners; + var resultThenable$46 = createResultThenable(actionReturnValue); + actionReturnValue.push(function () { + resultThenable$46.status = "fulfilled"; + resultThenable$46.value = finishedState; + }); + return resultThenable$46; } -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - 0 === --asyncAction.count && - ((asyncAction.status = "fulfilled"), - completeAsyncActionScope(asyncAction)); - }, - function (error) { - 0 === --asyncAction.count && - ((asyncAction.status = "rejected"), - (asyncAction.reason = error), - completeAsyncActionScope(asyncAction)); +function pingEngtangledActionScope() { + if ( + null !== currentEntangledListeners && + 0 === --currentEntangledPendingCount + ) { + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + for (var i = (currentEntangledLane = 0); i < listeners.length; i++) + (0, listeners[i])(); + } +} +function createResultThenable(entangledListeners) { + return { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + entangledListeners.push(resolve); } - ); - return asyncAction; -} -function completeAsyncActionScope(action) { - currentAsyncAction === action && (currentAsyncAction = null); - var listeners = action.listeners; - action.listeners = []; - for (action = 0; action < listeners.length; action++) - (0, listeners[action])(!1); + }; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, @@ -3430,6 +3453,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); @@ -3454,12 +3478,16 @@ function bailoutHooks(current, workInProgress, lanes) { workInProgress.flags &= -2053; current.lanes &= ~lanes; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { - for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) { - var queue = hook.queue; + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; null !== queue && (queue.pending = null); - hook = hook.next; + workInProgress = workInProgress.next; } didScheduleRenderPhaseUpdate = !1; } @@ -3694,12 +3722,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var getVersion = source._getVersion, version = getVersion(source._source), dispatcher = ReactCurrentDispatcher$1.current, - _dispatcher$useState = dispatcher.useState(function () { + _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - setSnapshot = _dispatcher$useState[1], - snapshot = _dispatcher$useState[0]; - _dispatcher$useState = workInProgressHook; + setSnapshot = _dispatcher$useState2[1], + snapshot = _dispatcher$useState2[0]; + _dispatcher$useState2 = workInProgressHook; var memoizedState = hook.memoizedState, refs = memoizedState.refs, prevGetSnapshot = refs.getSnapshot, @@ -3752,10 +3780,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { }), (hook.dispatch = setSnapshot = dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)), - (_dispatcher$useState.queue = hook), - (_dispatcher$useState.baseQueue = null), + (_dispatcher$useState2.queue = hook), + (_dispatcher$useState2.baseQueue = null), (snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)), - (_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = + (_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState = snapshot)); return snapshot; } @@ -3982,13 +4010,19 @@ function updateDeferredValueImpl(hook, prevValue, value) { (hook.baseState = !0)); return prevValue; } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = currentUpdatePriority; currentUpdatePriority = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; - setPending(!0); + setPending(pendingState); ReactCurrentBatchConfig$3.transition = {}; enableTransitionTracing && void 0 !== options && @@ -3998,9 +4032,9 @@ function startTransition(setPending, callback, options) { try { if (enableAsyncActions) { var returnValue = callback(), - isPending = requestAsyncActionContext(returnValue); - setPending(isPending); - } else setPending(!1), callback(); + maybeThenable = requestAsyncActionContext(returnValue, finishedState); + setPending(maybeThenable); + } else setPending(finishedState), callback(); } catch (error) { if (enableAsyncActions) setPending({ then: function () {}, status: "rejected", reason: error }); @@ -4023,14 +4057,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$51 = enqueueUpdate(provider, fiber, lane); - null !== root$51 && - (scheduleUpdateOnFiber(root$51, provider, lane), - entangleTransitions(root$51, provider, lane)); + var root$52 = enqueueUpdate(provider, fiber, lane); + null !== root$52 && + (scheduleUpdateOnFiber(root$52, provider, lane), + entangleTransitions(root$52, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$51 && + null !== root$52 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4211,7 +4245,7 @@ var HooksDispatcherOnMount = { }, useTransition: function () { var setPending = mountState(!1)[1]; - setPending = startTransition.bind(null, setPending); + setPending = startTransition.bind(null, !0, !1, setPending); mountWorkInProgressHook().memoizedState = setPending; return [!1, setPending]; }, @@ -4233,15 +4267,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$47 = workInProgressRoot; - if (null === root$47) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$47, renderLanes$1) || + var root$48 = workInProgressRoot; + if (null === root$48) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$48, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$47 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$47; - mountEffect(subscribeToStore.bind(null, fiber, root$47, subscribe), [ + root$48 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$48; + mountEffect(subscribeToStore.bind(null, fiber, root$48, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4250,7 +4284,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$47, + root$48, getServerSnapshot, getSnapshot ), @@ -4740,10 +4774,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$62 = workInProgress.stateNode; + root$63 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$62.incompleteTransitions.has(transition)) { + if (!root$63.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4751,11 +4785,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$62.incompleteTransitions.set(transition, markerInstance); + root$63.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$62.incompleteTransitions.forEach(function (markerInstance) { + root$63.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5420,14 +5454,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$69 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$69) + var dehydrated$70 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$70) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$69, + dehydrated$70, JSCompiler_temp, renderLanes ); @@ -5437,7 +5471,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$69 = JSCompiler_temp.sibling; + dehydrated$70 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -5446,8 +5480,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$69 - ? (showFallback = createWorkInProgress(dehydrated$69, showFallback)) + null !== dehydrated$70 + ? (showFallback = createWorkInProgress(dehydrated$70, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -5466,10 +5500,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$69 = CacheContext._currentValue), + ? ((dehydrated$70 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$69 - ? { parent: dehydrated$69, pool: dehydrated$69 } + JSCompiler_temp.parent !== dehydrated$70 + ? { parent: dehydrated$70, pool: dehydrated$70 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -5483,23 +5517,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$69 = showFallback.updateQueue), + (dehydrated$70 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$69 + null === dehydrated$70 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$69 === primaryChildProps + : dehydrated$70 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$69.transitions = didSuspend), - (dehydrated$69.markerInstances = JSCompiler_temp)))); + : ((dehydrated$70.transitions = didSuspend), + (dehydrated$70.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -6562,14 +6596,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6579,19 +6613,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags & 31457280), + (subtreeFlags |= child$102.flags & 31457280), + (child$102.return = completedWork), + (child$102 = child$102.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags), + (subtreeFlags |= child$102.flags), + (child$102.return = completedWork), + (child$102 = child$102.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7318,8 +7352,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$130) { - captureCommitPhaseError(current, nearestMountedAncestor, error$130); + } catch (error$131) { + captureCommitPhaseError(current, nearestMountedAncestor, error$131); } else ref.current = null; } @@ -7356,7 +7390,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$192) { + } catch (e$193) { JSCompiler_temp = null; break a; } @@ -7635,11 +7669,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$132) { + } catch (error$133) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$132 + error$133 ); } } @@ -8319,8 +8353,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$145) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$145); + } catch (error$146) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$146); } } break; @@ -8502,11 +8536,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$146) { + } catch (error$147) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$146 + error$147 ); } break; @@ -8542,8 +8576,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$147) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$147); + } catch (error$148) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$148); } } if ( @@ -8568,8 +8602,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$150) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$150); + } catch (error$151) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$151); } break; case 6: @@ -8582,8 +8616,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$151) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$151); + } catch (error$152) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$152); } } break; @@ -8597,8 +8631,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); + } catch (error$153) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$153); } break; case 4: @@ -8628,8 +8662,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$154) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$154); + } catch (error$155) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$155); } current = finishedWork.updateQueue; null !== current && @@ -8707,11 +8741,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$135) { + } catch (error$136) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$135 + error$136 ); } } else if ( @@ -8786,21 +8820,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$136 = JSCompiler_inline_result.stateNode; + var parent$137 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$136, ""), + (setTextContent(parent$137, ""), (JSCompiler_inline_result.flags &= -33)); - var before$137 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$137, parent$136); + var before$138 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$138, parent$137); break; case 3: case 4: - var parent$138 = JSCompiler_inline_result.stateNode.containerInfo, - before$139 = getHostSibling(finishedWork); + var parent$139 = JSCompiler_inline_result.stateNode.containerInfo, + before$140 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$139, - parent$138 + before$140, + parent$139 ); break; default: @@ -9270,9 +9304,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$164 = finishedWork.stateNode; + var instance$165 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$164._visibility & 4 + ? instance$165._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9285,7 +9319,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$164._visibility |= 4), + : ((instance$165._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9293,7 +9327,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$164._visibility |= 4), + : ((instance$165._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9306,7 +9340,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$164 + instance$165 ); break; case 24: @@ -9923,8 +9957,8 @@ function requestUpdateLane(fiber) { return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; if (null !== ReactCurrentBatchConfig$2.transition) return ( - (fiber = currentAsyncAction), - null !== fiber ? fiber.lane : requestTransitionLane() + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); fiber = currentUpdatePriority; if (0 !== fiber) return fiber; @@ -10020,16 +10054,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { exitStatus = renderRootSync(root, lanes); if (2 === exitStatus) { errorRetryLanes = lanes; - var errorRetryLanes$174 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$175 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$174 && - ((lanes = errorRetryLanes$174), + 0 !== errorRetryLanes$175 && + ((lanes = errorRetryLanes$175), (exitStatus = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$174 + errorRetryLanes$175 ))); } if (1 === exitStatus) @@ -10238,8 +10272,9 @@ function resetWorkInProgressStack() { if (0 === workInProgressSuspendedReason) var interruptedWork = workInProgress.return; else - resetContextDependencies(), - resetHooksOnUnwind(), + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), (thenableState$1 = null), (thenableIndexCounter$1 = 0), (interruptedWork = workInProgress); @@ -10277,6 +10312,7 @@ function prepareFreshStack(root, lanes) { return root; } function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; ReactCurrentOwner.current = null; thrownValue === SuspenseException @@ -10360,8 +10396,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$176) { - handleThrow(root, thrownValue$176); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); resetContextDependencies(); @@ -10465,8 +10501,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$178) { - handleThrow(root, thrownValue$178); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); resetContextDependencies(); @@ -10528,7 +10564,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { ); break; case 5: - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); default: unwindInterruptedWork(current, unitOfWork), (unitOfWork = workInProgress = @@ -10543,7 +10579,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { } function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(unitOfWork); thenableState$1 = null; thenableIndexCounter$1 = 0; var returnFiber = unitOfWork.return; @@ -10629,10 +10665,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$57 = offscreenQueue.retryQueue; - null === retryQueue$57 + var retryQueue$58 = offscreenQueue.retryQueue; + null === retryQueue$58 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$57.add(wakeable); + : retryQueue$58.add(wakeable); } } break; @@ -10816,12 +10852,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$182 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$183 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$182 && + shouldFireAfterActiveInstanceBlur$183 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -10900,7 +10936,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$183 = rootWithPendingPassiveEffects, + var root$184 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -10916,7 +10952,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$183, remainingLanes); + releaseRootPooledCache(root$184, remainingLanes); } } return !1; @@ -12099,12 +12135,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$185 = fiber.stateNode; - if (root$185.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$185.pendingLanes); + var root$186 = fiber.stateNode; + if (root$186.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$186.pendingLanes); 0 !== lanes && - (markRootEntangled(root$185, lanes | 2), - ensureRootIsScheduled(root$185), + (markRootEntangled(root$186, lanes | 2), + ensureRootIsScheduled(root$186), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13194,19 +13230,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$373; + var JSCompiler_inline_result$jscomp$374; if (canUseDOM) { - var isSupported$jscomp$inline_1632 = "oninput" in document; - if (!isSupported$jscomp$inline_1632) { - var element$jscomp$inline_1633 = document.createElement("div"); - element$jscomp$inline_1633.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1632 = - "function" === typeof element$jscomp$inline_1633.oninput; + var isSupported$jscomp$inline_1635 = "oninput" in document; + if (!isSupported$jscomp$inline_1635) { + var element$jscomp$inline_1636 = document.createElement("div"); + element$jscomp$inline_1636.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1635 = + "function" === typeof element$jscomp$inline_1636.oninput; } - JSCompiler_inline_result$jscomp$373 = isSupported$jscomp$inline_1632; - } else JSCompiler_inline_result$jscomp$373 = !1; + JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1635; + } else JSCompiler_inline_result$jscomp$374 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$373 && + JSCompiler_inline_result$jscomp$374 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13515,20 +13551,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1673 = 0; - i$jscomp$inline_1673 < simpleEventPluginEvents.length; - i$jscomp$inline_1673++ + var i$jscomp$inline_1676 = 0; + i$jscomp$inline_1676 < simpleEventPluginEvents.length; + i$jscomp$inline_1676++ ) { - var eventName$jscomp$inline_1674 = - simpleEventPluginEvents[i$jscomp$inline_1673], - domEventName$jscomp$inline_1675 = - eventName$jscomp$inline_1674.toLowerCase(), - capitalizedEvent$jscomp$inline_1676 = - eventName$jscomp$inline_1674[0].toUpperCase() + - eventName$jscomp$inline_1674.slice(1); + var eventName$jscomp$inline_1677 = + simpleEventPluginEvents[i$jscomp$inline_1676], + domEventName$jscomp$inline_1678 = + eventName$jscomp$inline_1677.toLowerCase(), + capitalizedEvent$jscomp$inline_1679 = + eventName$jscomp$inline_1677[0].toUpperCase() + + eventName$jscomp$inline_1677.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1675, - "on" + capitalizedEvent$jscomp$inline_1676 + domEventName$jscomp$inline_1678, + "on" + capitalizedEvent$jscomp$inline_1679 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14943,14 +14979,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$219 in nextProps) { - var propKey = nextProps[propKey$219]; - lastProp = lastProps[propKey$219]; + for (var propKey$220 in nextProps) { + var propKey = nextProps[propKey$220]; + lastProp = lastProps[propKey$220]; if ( - nextProps.hasOwnProperty(propKey$219) && + nextProps.hasOwnProperty(propKey$220) && (null != propKey || null != lastProp) ) - switch (propKey$219) { + switch (propKey$220) { case "type": type = propKey; break; @@ -14979,7 +15015,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$219, + propKey$220, propKey, nextProps, lastProp @@ -14998,7 +15034,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - defaultValue = value = propKey = propKey$219 = null; + defaultValue = value = propKey = propKey$220 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15029,7 +15065,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$219 = type; + propKey$220 = type; break; case "defaultValue": propKey = type; @@ -15047,10 +15083,10 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue ); } - updateSelect(domElement, propKey$219, propKey, value, defaultValue); + updateSelect(domElement, propKey$220, propKey, value, defaultValue); return; case "textarea": - propKey = propKey$219 = null; + propKey = propKey$220 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15074,7 +15110,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$219 = name; + propKey$220 = name; break; case "defaultValue": propKey = name; @@ -15088,17 +15124,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$219, propKey); + updateTextarea(domElement, propKey$220, propKey); return; case "option": - for (var propKey$235 in lastProps) + for (var propKey$236 in lastProps) if ( - ((propKey$219 = lastProps[propKey$235]), - lastProps.hasOwnProperty(propKey$235) && - null != propKey$219 && - !nextProps.hasOwnProperty(propKey$235)) + ((propKey$220 = lastProps[propKey$236]), + lastProps.hasOwnProperty(propKey$236) && + null != propKey$220 && + !nextProps.hasOwnProperty(propKey$236)) ) - switch (propKey$235) { + switch (propKey$236) { case "selected": domElement.selected = !1; break; @@ -15106,33 +15142,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$235, + propKey$236, null, nextProps, - propKey$219 + propKey$220 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$219 = nextProps[lastDefaultValue]), + ((propKey$220 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$219 !== propKey && - (null != propKey$219 || null != propKey)) + propKey$220 !== propKey && + (null != propKey$220 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$219 && - "function" !== typeof propKey$219 && - "symbol" !== typeof propKey$219; + propKey$220 && + "function" !== typeof propKey$220 && + "symbol" !== typeof propKey$220; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$219, + propKey$220, nextProps, propKey ); @@ -15153,24 +15189,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$240 in lastProps) - (propKey$219 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && - null != propKey$219 && - !nextProps.hasOwnProperty(propKey$240) && - setProp(domElement, tag, propKey$240, null, nextProps, propKey$219); + for (var propKey$241 in lastProps) + (propKey$220 = lastProps[propKey$241]), + lastProps.hasOwnProperty(propKey$241) && + null != propKey$220 && + !nextProps.hasOwnProperty(propKey$241) && + setProp(domElement, tag, propKey$241, null, nextProps, propKey$220); for (checked in nextProps) if ( - ((propKey$219 = nextProps[checked]), + ((propKey$220 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$219 !== propKey && - (null != propKey$219 || null != propKey)) + propKey$220 !== propKey && + (null != propKey$220 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$219) + if (null != propKey$220) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15178,7 +15214,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$219, + propKey$220, nextProps, propKey ); @@ -15186,49 +15222,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$245 in lastProps) - (propKey$219 = lastProps[propKey$245]), - lastProps.hasOwnProperty(propKey$245) && - null != propKey$219 && - !nextProps.hasOwnProperty(propKey$245) && + for (var propKey$246 in lastProps) + (propKey$220 = lastProps[propKey$246]), + lastProps.hasOwnProperty(propKey$246) && + null != propKey$220 && + !nextProps.hasOwnProperty(propKey$246) && setPropOnCustomElement( domElement, tag, - propKey$245, + propKey$246, null, nextProps, - propKey$219 + propKey$220 ); for (defaultChecked in nextProps) - (propKey$219 = nextProps[defaultChecked]), + (propKey$220 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$219 === propKey || - (null == propKey$219 && null == propKey) || + propKey$220 === propKey || + (null == propKey$220 && null == propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$219, + propKey$220, nextProps, propKey ); return; } } - for (var propKey$250 in lastProps) - (propKey$219 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && - null != propKey$219 && - !nextProps.hasOwnProperty(propKey$250) && - setProp(domElement, tag, propKey$250, null, nextProps, propKey$219); + for (var propKey$251 in lastProps) + (propKey$220 = lastProps[propKey$251]), + lastProps.hasOwnProperty(propKey$251) && + null != propKey$220 && + !nextProps.hasOwnProperty(propKey$251) && + setProp(domElement, tag, propKey$251, null, nextProps, propKey$220); for (lastProp in nextProps) - (propKey$219 = nextProps[lastProp]), + (propKey$220 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$219 === propKey || - (null == propKey$219 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$219, nextProps, propKey); + propKey$220 === propKey || + (null == propKey$220 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$220, nextProps, propKey); } function updatePropertiesWithDiff( domElement, @@ -15789,11 +15825,15 @@ function preload$1(href, options) { type: options.type }), preloadPropsMap.set(key, href), - null === ownerDocument.querySelector(limitedEscapedHref) && - ((options = ownerDocument.createElement("link")), - setInitialProperties(options, "link", href), - markNodeAsHoistable(options), - ownerDocument.head.appendChild(options))); + null !== ownerDocument.querySelector(limitedEscapedHref) || + ("style" === as && + ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || + ("script" === as && + ownerDocument.querySelector("script[async]" + key)) || + ((as = ownerDocument.createElement("link")), + setInitialProperties(as, "link", href), + markNodeAsHoistable(as), + ownerDocument.head.appendChild(as))); } } function preinit$1(href, options) { @@ -15862,7 +15902,8 @@ function preinit$1(href, options) { src: href, async: !0, crossOrigin: options.crossOrigin, - integrity: options.integrity + integrity: options.integrity, + nonce: options.nonce }), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(href, options), @@ -15906,17 +15947,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$284 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$285 = styles$284.get(type); - resource$285 || + var styles$285 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$286 = styles$285.get(type); + resource$286 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$285 = { + (resource$286 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$284.set(type, resource$285), + styles$285.set(type, resource$286), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15931,9 +15972,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$285.state + resource$286.state )); - return resource$285; + return resource$286; } return null; case "script": @@ -16013,36 +16054,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$289 = hoistableRoot.querySelector( + var instance$290 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$289) + if (instance$290) return ( - (resource.instance = instance$289), - markNodeAsHoistable(instance$289), - instance$289 + (resource.instance = instance$290), + markNodeAsHoistable(instance$290), + instance$290 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$289 = ( + instance$290 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$289); - var linkInstance = instance$289; + markNodeAsHoistable(instance$290); + var linkInstance = instance$290; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$289, "link", instance); + setInitialProperties(instance$290, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$289, props.precedence, hoistableRoot); - return (resource.instance = instance$289); + insertStylesheet(instance$290, props.precedence, hoistableRoot); + return (resource.instance = instance$290); case "script": - instance$289 = getScriptKey(props.src); + instance$290 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$289 + "script[async]" + instance$290 )) ) return ( @@ -16051,7 +16092,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$289))) + if ((styleProps = preloadPropsMap.get(instance$290))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16414,17 +16455,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1843 = { +var devToolsConfig$jscomp$inline_1846 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-bcc00dd5", + version: "18.3.0-www-modern-3898c4ac", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2217 = { - bundleType: devToolsConfig$jscomp$inline_1843.bundleType, - version: devToolsConfig$jscomp$inline_1843.version, - rendererPackageName: devToolsConfig$jscomp$inline_1843.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1843.rendererConfig, +var internals$jscomp$inline_2220 = { + bundleType: devToolsConfig$jscomp$inline_1846.bundleType, + version: devToolsConfig$jscomp$inline_1846.version, + rendererPackageName: devToolsConfig$jscomp$inline_1846.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1846.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16441,26 +16482,26 @@ var internals$jscomp$inline_2217 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1843.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1846.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-bcc00dd5" + reconcilerVersion: "18.3.0-www-modern-3898c4ac" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2218 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2218.isDisabled && - hook$jscomp$inline_2218.supportsFiber + !hook$jscomp$inline_2221.isDisabled && + hook$jscomp$inline_2221.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2218.inject( - internals$jscomp$inline_2217 + (rendererID = hook$jscomp$inline_2221.inject( + internals$jscomp$inline_2220 )), - (injectedHook = hook$jscomp$inline_2218); + (injectedHook = hook$jscomp$inline_2221); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16770,4 +16811,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-bcc00dd5"; +exports.version = "18.3.0-www-modern-3898c4ac"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 9f715a2a72..711788ad91 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -2837,7 +2837,7 @@ function isRootDehydrated(root) { var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -2891,24 +2891,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches @@ -6668,8 +6665,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -6678,81 +6687,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -7173,6 +7235,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -7240,11 +7303,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -7254,7 +7318,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -7768,11 +7832,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -8510,14 +8574,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$2.transition = {}); { @@ -8525,11 +8595,11 @@ function startTransition(setPending, callback, options) { } try { - var returnValue, isPending; + var returnValue, maybeThenable; if (enableAsyncActions); else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -8564,7 +8634,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -20600,9 +20670,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -21318,7 +21388,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -21375,10 +21445,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -22033,7 +22103,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -22079,7 +22149,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -24455,7 +24525,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-3c32bc8c"; +var ReactVersion = "18.3.0-www-classic-59dc1008"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index c0deff7c00..dc27a98a35 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -2837,7 +2837,7 @@ function isRootDehydrated(root) { var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); -var rootInstanceStackCursor = createCursor(null); +var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) function requiredContext(c) { { @@ -2891,24 +2891,21 @@ function pushHostContext(fiber) { var context = requiredContext(contextStackCursor.current); var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } } function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches @@ -6668,8 +6665,20 @@ function requestTransitionLane() { return currentEventTransitionLane; } -var currentAsyncAction = null; -function requestAsyncActionContext(actionReturnValue) { +// transition updates that occur while the async action is still in progress +// are treated as part of the action. +// +// The ideal behavior would be to treat each async function as an independent +// action. However, without a mechanism like AsyncContext, we can't tell which +// action an update corresponds to. So instead, we entangle them all into one. +// The listeners to notify once the entangled scope completes. + +var currentEntangledListeners = null; // The number of pending async actions in the entangled scope. + +var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope. + +var currentEntangledLane = NoLane; +function requestAsyncActionContext(actionReturnValue, finishedState) { if ( actionReturnValue !== null && typeof actionReturnValue === "object" && @@ -6678,81 +6687,134 @@ function requestAsyncActionContext(actionReturnValue) { // This is an async action. // // Return a thenable that resolves once the action scope (i.e. the async - // function passed to startTransition) has finished running. The fulfilled - // value is `false` to represent that the action is not pending. + // function passed to startTransition) has finished running. var thenable = actionReturnValue; + var entangledListeners; - if (currentAsyncAction === null) { + if (currentEntangledListeners === null) { // There's no outer async action scope. Create a new one. - var asyncAction = { - lane: requestTransitionLane(), - listeners: [], - count: 0, - status: "pending", - value: false, - reason: undefined, - then: function (resolve) { - asyncAction.listeners.push(resolve); - } - }; - attachPingListeners(thenable, asyncAction); - currentAsyncAction = asyncAction; - return asyncAction; + entangledListeners = currentEntangledListeners = []; + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); } else { - // Inherit the outer scope. - var _asyncAction = currentAsyncAction; - attachPingListeners(thenable, _asyncAction); - return _asyncAction; + entangledListeners = currentEntangledListeners; } + + currentEntangledPendingCount++; + var resultStatus = "pending"; + var rejectedReason; + thenable.then( + function () { + resultStatus = "fulfilled"; + pingEngtangledActionScope(); + }, + function (error) { + resultStatus = "rejected"; + rejectedReason = error; + pingEngtangledActionScope(); + } + ); // Create a thenable that represents the result of this action, but doesn't + // resolve until the entire entangled scope has finished. + // + // Expressed using promises: + // const [thisResult] = await Promise.all([thisAction, entangledAction]); + // return thisResult; + + var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result. + + entangledListeners.push(function () { + switch (resultStatus) { + case "fulfilled": { + var fulfilledThenable = resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + break; + } + + case "rejected": { + var rejectedThenable = resultThenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = rejectedReason; + break; + } + + case "pending": + default: { + // The listener above should have been called first, so `resultStatus` + // should already be set to the correct value. + throw new Error( + "Thenable should have already resolved. This " + + "is a bug in React." + ); + } + } + }); + return resultThenable; } else { // This is not an async action, but it may be part of an outer async action. - if (currentAsyncAction === null) { - // There's no outer async action scope. - return false; + if (currentEntangledListeners === null) { + return finishedState; } else { - // Inherit the outer scope. - return currentAsyncAction; + // Return a thenable that does not resolve until the entangled actions + // have finished. + var _entangledListeners = currentEntangledListeners; + + var _resultThenable = createResultThenable(_entangledListeners); + + _entangledListeners.push(function () { + var fulfilledThenable = _resultThenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = finishedState; + }); + + return _resultThenable; } } } -function peekAsyncActionContext() { - return currentAsyncAction; -} -function attachPingListeners(thenable, asyncAction) { - asyncAction.count++; - thenable.then( - function () { - if (--asyncAction.count === 0) { - var fulfilledAsyncAction = asyncAction; - fulfilledAsyncAction.status = "fulfilled"; - completeAsyncActionScope(asyncAction); - } - }, - function (error) { - if (--asyncAction.count === 0) { - var rejectedAsyncAction = asyncAction; - rejectedAsyncAction.status = "rejected"; - rejectedAsyncAction.reason = error; - completeAsyncActionScope(asyncAction); - } +function pingEngtangledActionScope() { + if ( + currentEntangledListeners !== null && + --currentEntangledPendingCount === 0 + ) { + // All the actions have finished. Close the entangled async action scope + // and notify all the listeners. + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = NoLane; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - ); - return asyncAction; + } } -function completeAsyncActionScope(action) { - if (currentAsyncAction === action) { - currentAsyncAction = null; - } +function createResultThenable(entangledListeners) { + // Waits for the entangled async action to complete, then resolves to the + // result of an individual action. + var resultThenable = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + // This is a bit of a cheat. `resolve` expects a value of type `S` to be + // passed, but because we're instrumenting the `status` field ourselves, + // and we know this thenable will only be used by React, we also know + // the value isn't actually needed. So we add the resolve function + // directly to the entangled listeners. + // + // This is also why we don't need to check if the thenable is still + // pending; the Suspense implementation already performs that check. + var ping = resolve; + entangledListeners.push(ping); + } + }; + return resultThenable; +} - var listeners = action.listeners; - action.listeners = []; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(false); - } +function peekEntangledActionLane() { + return currentEntangledLane; } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, @@ -7173,6 +7235,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { // // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. + currentlyRenderingFiber$1 = workInProgress; var numberOfReRenders = 0; var children; @@ -7240,11 +7303,12 @@ function resetHooksAfterThrow() { // // It should only reset things like the current dispatcher, to prevent hooks // from being called outside of a component. - // We can assume the previous dispatcher is always this one, since we set it + currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; } -function resetHooksOnUnwind() { +function resetHooksOnUnwind(workInProgress) { if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so @@ -7254,7 +7318,7 @@ function resetHooksOnUnwind() { // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. - var hook = currentlyRenderingFiber$1.memoizedState; + var hook = workInProgress.memoizedState; while (hook !== null) { var queue = hook.queue; @@ -7768,11 +7832,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) { var version = getVersion(source._source); var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const - var _dispatcher$useState = dispatcher.useState(function () { + var _dispatcher$useState2 = dispatcher.useState(function () { return readFromUnsubscribedMutableSource(root, source, getSnapshot); }), - currentSnapshot = _dispatcher$useState[0], - setSnapshot = _dispatcher$useState[1]; + currentSnapshot = _dispatcher$useState2[0], + setSnapshot = _dispatcher$useState2[1]; var snapshot = currentSnapshot; // Grab a handle to the state hook as well. // We use it to clear the pending update queue if we have a new source. @@ -8510,14 +8574,20 @@ function updateDeferredValueImpl(hook, prevValue, value) { } } -function startTransition(setPending, callback, options) { +function startTransition( + pendingState, + finishedState, + setPending, + callback, + options +) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority( higherEventPriority(previousPriority, ContinuousEventPriority) ); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = null; - setPending(true); + setPending(pendingState); var currentTransition = (ReactCurrentBatchConfig$2.transition = {}); { @@ -8525,11 +8595,11 @@ function startTransition(setPending, callback, options) { } try { - var returnValue, isPending; + var returnValue, maybeThenable; if (enableAsyncActions); else { // Async actions are not enabled. - setPending(false); + setPending(finishedState); callback(); } } catch (error) { @@ -8564,7 +8634,7 @@ function mountTransition() { var _mountState = mountState(false), setPending = _mountState[1]; // The `start` method never changes. - var start = startTransition.bind(null, setPending); + var start = startTransition.bind(null, true, false, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [false, start]; @@ -20600,9 +20670,9 @@ function requestUpdateLane(fiber) { transition._updatedFibers.add(fiber); } - var asyncAction = peekAsyncActionContext(); - return asyncAction !== null // We're inside an async action scope. Reuse the same lane. - ? asyncAction.lane // We may or may not be inside an async action scope. If we are, this + var actionScopeLane = peekEntangledActionLane(); + return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane. + ? actionScopeLane // We may or may not be inside an async action scope. If we are, this : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); @@ -21318,7 +21388,7 @@ function resetWorkInProgressStack() { } else { // Work-in-progress is in suspended state. Reset the work loop and unwind // both the suspended fiber and all its parents. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(workInProgress); interruptedWork = workInProgress; } @@ -21375,10 +21445,10 @@ function prepareFreshStack(root, lanes) { return rootWorkInProgress; } -function resetSuspendedWorkLoopOnUnwind() { +function resetSuspendedWorkLoopOnUnwind(fiber) { // Reset module-level state that was set during the render phase. resetContextDependencies(); - resetHooksOnUnwind(); + resetHooksOnUnwind(fiber); resetChildReconcilerOnUnwind(); } @@ -22033,7 +22103,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { // is to reuse uncached promises, but we happen to know that the only // promises that a host component might suspend on are definitely cached // because they are controlled by us. So don't bother. - resetHooksOnUnwind(); // Fallthrough to the next branch. + resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch. } default: { @@ -22079,7 +22149,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { // // Return to the normal work loop. This will unwind the stack, and potentially // result in showing a fallback. - resetSuspendedWorkLoopOnUnwind(); + resetSuspendedWorkLoopOnUnwind(unitOfWork); var returnFiber = unitOfWork.return; if (returnFiber === null || workInProgressRoot === null) { @@ -24455,7 +24525,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-bcc00dd5"; +var ReactVersion = "18.3.0-www-modern-3898c4ac"; // Might add PROFILE later. diff --git a/compiled/facebook-www/WARNINGS b/compiled/facebook-www/WARNINGS index 742b8c5b3f..4410c8ca7d 100644 --- a/compiled/facebook-www/WARNINGS +++ b/compiled/facebook-www/WARNINGS @@ -213,7 +213,6 @@ "React encountered a with props that conflict with the options provided to `ReactDOM.preinit(\"%s\", { as: \"style\", ... })`. React will use the first props or preinitialization options encountered when rendering a hoistable stylesheet with a particular `href` and will ignore any newer props or options. The first instance of this stylesheet resource was created using the `ReactDOM.preinit()` function. Please note, `ReactDOM.preinit()` is modeled off of module import assertions capabilities and does not support arbitrary props. If you need to have props not included with the preinit options you will need to rely on rendering tags only.%s" "React encountered a