From 43874233ca0c3e67cab5548f014cb0bd7259d22b Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Tue, 12 Mar 2024 00:20:53 +0000 Subject: [PATCH] Remove invokeGuardedCallback and replay trick (#28515) We broke the ability to "break on uncaught exceptions" by adding a try/catch higher up in the scheduling. We're giving up on fixing that so we can remove the replay trick inside an event handler. The issue with that approach is that we end up double logging a lot of errors in DEV since they get reported to the page. It's also a lot of complexity around this feature. DiffTrain build for [89021fb4ec9aa82194b0788566e736a4cedfc0e4](https://github.com/facebook/react/commit/89021fb4ec9aa82194b0788566e736a4cedfc0e4) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- .../facebook-www/React-profiling.classic.js | 2 +- .../facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 260 +- compiled/facebook-www/ReactART-dev.modern.js | 260 +- .../facebook-www/ReactART-prod.classic.js | 8425 ++++++------ compiled/facebook-www/ReactART-prod.modern.js | 8329 ++++++----- compiled/facebook-www/ReactDOM-dev.classic.js | 323 +- compiled/facebook-www/ReactDOM-dev.modern.js | 323 +- .../facebook-www/ReactDOM-prod.classic.js | 10440 +++++++------- compiled/facebook-www/ReactDOM-prod.modern.js | 10288 +++++++------- .../ReactDOM-profiling.classic.js | 11358 ++++++++-------- .../facebook-www/ReactDOM-profiling.modern.js | 11190 ++++++++------- .../ReactDOMTesting-dev.classic.js | 323 +- .../ReactDOMTesting-dev.modern.js | 323 +- .../ReactDOMTesting-prod.classic.js | 10852 ++++++++------- .../ReactDOMTesting-prod.modern.js | 10656 ++++++++------- .../ReactTestRenderer-dev.classic.js | 127 +- .../ReactTestRenderer-dev.modern.js | 127 +- .../ReactTestUtils-dev.classic.js | 126 +- .../facebook-www/ReactTestUtils-dev.modern.js | 126 +- 23 files changed, 40887 insertions(+), 42979 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 7c8d6101eaa8c..a4770c10b2b53 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -56e20051c3c1611f9495081d01f1946184332c6b +89021fb4ec9aa82194b0788566e736a4cedfc0e4 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index beae3e149e446..94c4f72b1bd61 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-www-classic-7d5d3599"; + var ReactVersion = "18.3.0-www-classic-489e33ec"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 8f43e11ed39ee..e5ea18642018f 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -633,4 +633,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-32d29ecb"; +exports.version = "18.3.0-www-classic-76e5ebad"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index ce35107094db6..64602aa63d250 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -637,7 +637,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-e14b3ab5"; +exports.version = "18.3.0-www-classic-33a06df4"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index ced6357581184..3031dde67cc80 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -629,7 +629,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-120f741e"; +exports.version = "18.3.0-www-modern-dc34ad0a"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 0d78b17d7b2e7..0b374f1a4b0b4 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "18.3.0-www-classic-c7591c48"; + var ReactVersion = "18.3.0-www-classic-dbf75d4c"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -163,9 +163,7 @@ if (__DEV__) { // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require("ReactFeatureFlags"); - var replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, enableLazyContextPropagation = dynamicFeatureFlags.enableLazyContextPropagation, @@ -3728,16 +3726,8 @@ if (__DEV__) { } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches - // due to earlier mismatches or a suspended fiber. - - var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary var hydrationErrors = null; - function didSuspendOrErrorWhileHydratingDEV() { - { - return didSuspendOrErrorDEV; - } - } function prepareToHydrateHostInstance(fiber, hostContext) { { @@ -13842,25 +13832,8 @@ if (__DEV__) { if (true) { var source = errorInfo.source; var stack = errorInfo.stack; - var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling - // `preventDefault()` in window `error` handler. - // We record this information as an expando on the error. - - if (error != null && error._suppressLogging) { - if (boundary.tag === ClassComponent) { - // The error is recoverable and was silenced. - // Ignore it and don't print the stack addendum. - // This is handy for testing error boundaries without noise. - return; - } // The error is fatal. Since the silencing might have - // been accidental, we'll surface it anyway. - // However, the browser would have silenced the original error - // so we'll print it first, and then print the stack addendum. - - console["error"](error); // Don't transform to our wrapper - // For a more detailed description of this block, see: - // https://github.com/facebook/react/pull/13384 - } + var componentStack = stack !== null ? stack : ""; // TODO: There's no longer a way to silence these warnings e.g. for tests. + // See https://github.com/facebook/react/pull/13384 var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName @@ -13882,19 +13855,17 @@ if (__DEV__) { ("using the error boundary you provided, " + errorBoundaryName + "."); - } - - var combinedMessage = - componentNameMessage + - "\n" + - componentStack + - "\n\n" + - ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - - console["error"](combinedMessage); // Don't transform to our wrapper + } // In development, we provide our own message which includes the component stack + // in addition to the error. + + console["error"]( + // Don't transform to our wrapper + "%o\n\n%s\n%s\n\n%s", + error, + componentNameMessage, + componentStack, + errorBoundaryMessage + ); } } catch (e) { // This method must not throw, or React internal state will get messed up. @@ -17942,7 +17913,7 @@ if (__DEV__) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } - function beginWork$1(current, workInProgress, renderLanes) { + function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. @@ -20738,64 +20709,6 @@ if (__DEV__) { } } - // Provided by www - var ReactFbErrorUtils = require("ReactFbErrorUtils"); - - if (typeof ReactFbErrorUtils.invokeGuardedCallback !== "function") { - throw new Error( - "Expected ReactFbErrorUtils.invokeGuardedCallback to be a function." - ); - } - - function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { - // This will call `this.onError(err)` if an error was caught. - ReactFbErrorUtils.invokeGuardedCallback.apply(this, arguments); - } - - var hasError = false; - var caughtError = null; // Used by event system to capture/rethrow the first error. - var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } - }; - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl.apply(reporter, arguments); - } - function hasCaughtError() { - return hasError; - } - function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - throw new Error( - "clearCaughtError was called but no error was captured. This error " + - "is likely caused by a bug in React. Please file an issue." - ); - } - } - var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { @@ -20818,20 +20731,6 @@ if (__DEV__) { ); } - function reportUncaughtErrorInDEV(error) { - // Wrapping each small part of the commit phase into a guarded - // callback is a bit too slow (https://github.com/facebook/react/pull/21666). - // But we rely on it to surface errors to DEV tools like overlays - // (https://github.com/facebook/react/issues/21712). - // As a compromise, rethrow only caught errors in a guard. - { - invokeGuardedCallback(null, function () { - throw error; - }); - clearCaughtError(); - } - } - function callComponentWillUnmountWithTimer(current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; @@ -27947,7 +27846,6 @@ if (__DEV__) { error$1 ) { { - reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } @@ -28451,83 +28349,6 @@ if (__DEV__) { } } } - var beginWork; - - if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { - var dummyFiber = null; - - beginWork = function (current, unitOfWork, lanes) { - // If a component throws an error, we replay it again in a synchronously - // dispatched event, so that the debugger will treat it as an uncaught - // error See ReactErrorUtils for more information. - // Before entering the begin phase, copy the work-in-progress onto a dummy - // fiber. If beginWork throws, we'll use this to reset the state. - var originalWorkInProgressCopy = assignFiberPropertiesInDEV( - dummyFiber, - unitOfWork - ); - - try { - return beginWork$1(current, unitOfWork, lanes); - } catch (originalError) { - if ( - didSuspendOrErrorWhileHydratingDEV() || - originalError === SuspenseException || - originalError === SelectiveHydrationException || - (originalError !== null && - typeof originalError === "object" && - typeof originalError.then === "function") - ) { - // Don't replay promises. - // Don't replay errors if we are hydrating and have already suspended or handled an error - throw originalError; - } // Don't reset current debug fiber, since we're about to work on the - // same fiber again. - // Unwind the failed stack frame - - resetSuspendedWorkLoopOnUnwind(unitOfWork); - unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. - - assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); - - if (unitOfWork.mode & ProfileMode) { - // Reset the profiler timer. - startProfilerTimer(unitOfWork); - } // Run beginWork again. - - invokeGuardedCallback( - null, - beginWork$1, - null, - current, - unitOfWork, - lanes - ); - - if (hasCaughtError()) { - var replayError = clearCaughtError(); - - if ( - typeof replayError === "object" && - replayError !== null && - replayError._suppressLogging && - typeof originalError === "object" && - originalError !== null && - !originalError._suppressLogging - ) { - // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. - originalError._suppressLogging = true; - } - } // We always throw the original error in case the second render pass is not idempotent. - // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. - - throw originalError; - } - }; - } else { - beginWork = beginWork$1; - } - var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; @@ -29850,55 +29671,6 @@ if (__DEV__) { implementation: portal.implementation }; return fiber; - } // Used for stashing WIP properties to replay failed work in DEV. - - function assignFiberPropertiesInDEV(target, source) { - if (target === null) { - // This Fiber's initial properties will always be overwritten. - // We only use a Fiber to ensure the same hidden class so DEV isn't slow. - target = createFiber(IndeterminateComponent, null, null, NoMode); - } // This is intentionally written as a list of all properties. - // We tried to use Object.assign() instead but this is called in - // the hottest path, and Object.assign() was too slow: - // https://github.com/facebook/react/issues/12502 - // This code is DEV-only so size is not a concern. - - target.tag = source.tag; - target.key = source.key; - target.elementType = source.elementType; - target.type = source.type; - target.stateNode = source.stateNode; - target.return = source.return; - target.child = source.child; - target.sibling = source.sibling; - target.index = source.index; - target.ref = source.ref; - target.refCleanup = source.refCleanup; - target.pendingProps = source.pendingProps; - target.memoizedProps = source.memoizedProps; - target.updateQueue = source.updateQueue; - target.memoizedState = source.memoizedState; - target.dependencies = source.dependencies; - target.mode = source.mode; - target.flags = source.flags; - target.subtreeFlags = source.subtreeFlags; - target.deletions = source.deletions; - target.lanes = source.lanes; - target.childLanes = source.childLanes; - target.alternate = source.alternate; - - { - target.actualDuration = source.actualDuration; - target.actualStartTime = source.actualStartTime; - target.selfBaseDuration = source.selfBaseDuration; - target.treeBaseDuration = source.treeBaseDuration; - } - - target._debugInfo = source._debugInfo; - target._debugOwner = source._debugOwner; - target._debugNeedsRemount = source._debugNeedsRemount; - target._debugHookTypes = source._debugHookTypes; - return target; } function FiberRootNode( diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 9b77ab53129bd..47648962fec09 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "18.3.0-www-modern-0ed317cd"; + var ReactVersion = "18.3.0-www-modern-3276b5fd"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -163,9 +163,7 @@ if (__DEV__) { // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require("ReactFeatureFlags"); - var replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, enableLazyContextPropagation = dynamicFeatureFlags.enableLazyContextPropagation, @@ -3493,16 +3491,8 @@ if (__DEV__) { } var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches - // due to earlier mismatches or a suspended fiber. - - var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary var hydrationErrors = null; - function didSuspendOrErrorWhileHydratingDEV() { - { - return didSuspendOrErrorDEV; - } - } function prepareToHydrateHostInstance(fiber, hostContext) { { @@ -13566,25 +13556,8 @@ if (__DEV__) { if (true) { var source = errorInfo.source; var stack = errorInfo.stack; - var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling - // `preventDefault()` in window `error` handler. - // We record this information as an expando on the error. - - if (error != null && error._suppressLogging) { - if (boundary.tag === ClassComponent) { - // The error is recoverable and was silenced. - // Ignore it and don't print the stack addendum. - // This is handy for testing error boundaries without noise. - return; - } // The error is fatal. Since the silencing might have - // been accidental, we'll surface it anyway. - // However, the browser would have silenced the original error - // so we'll print it first, and then print the stack addendum. - - console["error"](error); // Don't transform to our wrapper - // For a more detailed description of this block, see: - // https://github.com/facebook/react/pull/13384 - } + var componentStack = stack !== null ? stack : ""; // TODO: There's no longer a way to silence these warnings e.g. for tests. + // See https://github.com/facebook/react/pull/13384 var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName @@ -13606,19 +13579,17 @@ if (__DEV__) { ("using the error boundary you provided, " + errorBoundaryName + "."); - } - - var combinedMessage = - componentNameMessage + - "\n" + - componentStack + - "\n\n" + - ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - - console["error"](combinedMessage); // Don't transform to our wrapper + } // In development, we provide our own message which includes the component stack + // in addition to the error. + + console["error"]( + // Don't transform to our wrapper + "%o\n\n%s\n%s\n\n%s", + error, + componentNameMessage, + componentStack, + errorBoundaryMessage + ); } } catch (e) { // This method must not throw, or React internal state will get messed up. @@ -17630,7 +17601,7 @@ if (__DEV__) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } - function beginWork$1(current, workInProgress, renderLanes) { + function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. @@ -20397,64 +20368,6 @@ if (__DEV__) { } } - // Provided by www - var ReactFbErrorUtils = require("ReactFbErrorUtils"); - - if (typeof ReactFbErrorUtils.invokeGuardedCallback !== "function") { - throw new Error( - "Expected ReactFbErrorUtils.invokeGuardedCallback to be a function." - ); - } - - function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { - // This will call `this.onError(err)` if an error was caught. - ReactFbErrorUtils.invokeGuardedCallback.apply(this, arguments); - } - - var hasError = false; - var caughtError = null; // Used by event system to capture/rethrow the first error. - var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } - }; - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl.apply(reporter, arguments); - } - function hasCaughtError() { - return hasError; - } - function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - throw new Error( - "clearCaughtError was called but no error was captured. This error " + - "is likely caused by a bug in React. Please file an issue." - ); - } - } - var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { @@ -20477,20 +20390,6 @@ if (__DEV__) { ); } - function reportUncaughtErrorInDEV(error) { - // Wrapping each small part of the commit phase into a guarded - // callback is a bit too slow (https://github.com/facebook/react/pull/21666). - // But we rely on it to surface errors to DEV tools like overlays - // (https://github.com/facebook/react/issues/21712). - // As a compromise, rethrow only caught errors in a guard. - { - invokeGuardedCallback(null, function () { - throw error; - }); - clearCaughtError(); - } - } - function callComponentWillUnmountWithTimer(current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; @@ -27597,7 +27496,6 @@ if (__DEV__) { error$1 ) { { - reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } @@ -28101,83 +27999,6 @@ if (__DEV__) { } } } - var beginWork; - - if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { - var dummyFiber = null; - - beginWork = function (current, unitOfWork, lanes) { - // If a component throws an error, we replay it again in a synchronously - // dispatched event, so that the debugger will treat it as an uncaught - // error See ReactErrorUtils for more information. - // Before entering the begin phase, copy the work-in-progress onto a dummy - // fiber. If beginWork throws, we'll use this to reset the state. - var originalWorkInProgressCopy = assignFiberPropertiesInDEV( - dummyFiber, - unitOfWork - ); - - try { - return beginWork$1(current, unitOfWork, lanes); - } catch (originalError) { - if ( - didSuspendOrErrorWhileHydratingDEV() || - originalError === SuspenseException || - originalError === SelectiveHydrationException || - (originalError !== null && - typeof originalError === "object" && - typeof originalError.then === "function") - ) { - // Don't replay promises. - // Don't replay errors if we are hydrating and have already suspended or handled an error - throw originalError; - } // Don't reset current debug fiber, since we're about to work on the - // same fiber again. - // Unwind the failed stack frame - - resetSuspendedWorkLoopOnUnwind(unitOfWork); - unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. - - assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); - - if (unitOfWork.mode & ProfileMode) { - // Reset the profiler timer. - startProfilerTimer(unitOfWork); - } // Run beginWork again. - - invokeGuardedCallback( - null, - beginWork$1, - null, - current, - unitOfWork, - lanes - ); - - if (hasCaughtError()) { - var replayError = clearCaughtError(); - - if ( - typeof replayError === "object" && - replayError !== null && - replayError._suppressLogging && - typeof originalError === "object" && - originalError !== null && - !originalError._suppressLogging - ) { - // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. - originalError._suppressLogging = true; - } - } // We always throw the original error in case the second render pass is not idempotent. - // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. - - throw originalError; - } - }; - } else { - beginWork = beginWork$1; - } - var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; @@ -29500,55 +29321,6 @@ if (__DEV__) { implementation: portal.implementation }; return fiber; - } // Used for stashing WIP properties to replay failed work in DEV. - - function assignFiberPropertiesInDEV(target, source) { - if (target === null) { - // This Fiber's initial properties will always be overwritten. - // We only use a Fiber to ensure the same hidden class so DEV isn't slow. - target = createFiber(IndeterminateComponent, null, null, NoMode); - } // This is intentionally written as a list of all properties. - // We tried to use Object.assign() instead but this is called in - // the hottest path, and Object.assign() was too slow: - // https://github.com/facebook/react/issues/12502 - // This code is DEV-only so size is not a concern. - - target.tag = source.tag; - target.key = source.key; - target.elementType = source.elementType; - target.type = source.type; - target.stateNode = source.stateNode; - target.return = source.return; - target.child = source.child; - target.sibling = source.sibling; - target.index = source.index; - target.ref = source.ref; - target.refCleanup = source.refCleanup; - target.pendingProps = source.pendingProps; - target.memoizedProps = source.memoizedProps; - target.updateQueue = source.updateQueue; - target.memoizedState = source.memoizedState; - target.dependencies = source.dependencies; - target.mode = source.mode; - target.flags = source.flags; - target.subtreeFlags = source.subtreeFlags; - target.deletions = source.deletions; - target.lanes = source.lanes; - target.childLanes = source.childLanes; - target.alternate = source.alternate; - - { - target.actualDuration = source.actualDuration; - target.actualStartTime = source.actualStartTime; - target.selfBaseDuration = source.selfBaseDuration; - target.treeBaseDuration = source.treeBaseDuration; - } - - target._debugInfo = source._debugInfo; - target._debugOwner = source._debugOwner; - target._debugNeedsRemount = source._debugNeedsRemount; - target._debugHookTypes = source._debugHookTypes; - return target; } function FiberRootNode( diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 045699dc97225..053ed52599dfa 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -5614,4457 +5614,4454 @@ function attemptEarlyBailoutIfNoScheduledUpdate( } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null; -function resetContextDependencies() { - lastFullyObservedContext = - lastContextDependency = - currentlyRenderingFiber = - null; -} -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2); - context._currentValue2 = nextValue; -} -function popProvider(context) { - context._currentValue2 = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } -} -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; } - null !== current && - propagateContextChanges( + else didReceiveUpdate = !1; + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, workInProgress, + Component, current, - renderLanes, - forcePropagateEntireTree + context, + renderLanes ); - workInProgress.flags |= 262144; - } -} -function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress, renderLanes) { - currentlyRenderingFiber = workInProgress; - lastFullyObservedContext = lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconcilation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - if (lastFullyObservedContext !== context) - if ( - ((context = { context: context, memoizedValue: value, next: null }), - null === lastContextDependency) - ) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$1 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); -} -var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; -function requestCurrentTransition() { - var transition = ReactCurrentBatchConfig$1.transition; - null !== transition && transition._callbacks.add(handleAsyncAction); - return transition; -} -function handleAsyncAction(transition, thenable) { - entangleAsyncAction(transition, thenable); -} -function notifyTransitionCallbacks(transition, returnValue) { - transition._callbacks.forEach(function (callback) { - return callback(transition, returnValue); - }); -} -var resumedCache = createCursor(null), - transitionStack = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition( - offscreenWorkInProgress, - prevCachePool, - newTransitions -) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); - enableTransitionTracing && - (null === transitionStack.current - ? push(transitionStack, newTransitions) - : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); -} -function popTransition(workInProgress, current) { - null !== current && - (enableTransitionTracing && pop(transitionStack), pop(resumedCache)); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; -} -var emptyObject = {}; -function collectScopedNodesFromChildren( - startingChild, - fn$jscomp$0, - scopedNodes$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - fn = fn$jscomp$0, - scopedNodes = scopedNodes$jscomp$0; - if (5 === node.tag) { - var type = node.type, - memoizedProps = node.memoizedProps, - instance = node.stateNode; - null !== instance && - !0 === fn(type, memoizedProps || emptyObject, instance) && - scopedNodes.push(instance); - } - type = node.child; - isFiberSuspenseAndTimedOut(node) && (type = node.child.sibling.child); - null !== type && collectScopedNodesFromChildren(type, fn, scopedNodes); - startingChild = startingChild.sibling; - } -} -function collectFirstScopedNodeFromChildren(startingChild, fn$jscomp$0) { - for (; null !== startingChild; ) { - a: { - var JSCompiler_inline_result = startingChild; - var fn = fn$jscomp$0; - if (5 === JSCompiler_inline_result.tag) { - var type = JSCompiler_inline_result.type, - memoizedProps = JSCompiler_inline_result.memoizedProps, - instance = JSCompiler_inline_result.stateNode; - if (null !== instance && !0 === fn(type, memoizedProps, instance)) { - JSCompiler_inline_result = instance; - break a; - } - } - type = JSCompiler_inline_result.child; - isFiberSuspenseAndTimedOut(JSCompiler_inline_result) && - (type = JSCompiler_inline_result.child.sibling.child); - JSCompiler_inline_result = - null !== type ? collectFirstScopedNodeFromChildren(type, fn) : null; - } - if (null !== JSCompiler_inline_result) return JSCompiler_inline_result; - startingChild = startingChild.sibling; - } - return null; -} -function collectNearestChildContextValues( - startingChild, - context$jscomp$0, - childContextValues$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - context = context$jscomp$0, - childContextValues = childContextValues$jscomp$0; - if ( - 10 === node.tag && - (enableRenderableContext ? node.type : node.type._context) === context - ) - childContextValues.push(node.memoizedProps.value); - else { - var child = node.child; - isFiberSuspenseAndTimedOut(node) && (child = node.child.sibling.child); - null !== child && - collectNearestChildContextValues(child, context, childContextValues); - } - startingChild = startingChild.sibling; - } -} -function DO_NOT_USE_queryAllNodes(fn) { - var currentFiber = shim$1(); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - var scopedNodes = []; - null !== currentFiber && - collectScopedNodesFromChildren(currentFiber, fn, scopedNodes); - return 0 === scopedNodes.length ? null : scopedNodes; -} -function DO_NOT_USE_queryFirstNode(fn) { - var currentFiber = shim$1(); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - return null !== currentFiber - ? collectFirstScopedNodeFromChildren(currentFiber, fn) - : null; -} -function containsNode() { - throw Error(formatProdErrorMessage(248)); -} -function getChildContextValues(context) { - var currentFiber = shim$1(); - if (null === currentFiber) return []; - currentFiber = currentFiber.child; - var childContextValues = []; - null !== currentFiber && - collectNearestChildContextValues(currentFiber, context, childContextValues); - return childContextValues; -} -function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); -} -function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { - switch (renderState.tailMode) { - case "hidden": - hasRenderedATailFallback = renderState.tail; - for (var lastTailNode = null; null !== hasRenderedATailFallback; ) - null !== hasRenderedATailFallback.alternate && - (lastTailNode = hasRenderedATailFallback), - (hasRenderedATailFallback = hasRenderedATailFallback.sibling); - null === lastTailNode - ? (renderState.tail = null) - : (lastTailNode.sibling = null); - break; - case "collapsed": - lastTailNode = renderState.tail; - for (var lastTailNode$78 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode), - (lastTailNode = lastTailNode.sibling); - null === lastTailNode$78 - ? hasRenderedATailFallback || null === renderState.tail - ? (renderState.tail = null) - : (renderState.tail.sibling = null) - : (lastTailNode$78.sibling = null); - } -} -function bubbleProperties(completedWork) { - var didBailout = - null !== completedWork.alternate && - completedWork.alternate.child === completedWork.child, - newChildLanes = 0, - subtreeFlags = 0; - if (didBailout) - for (var child$79 = completedWork.child; null !== child$79; ) - (newChildLanes |= child$79.lanes | child$79.childLanes), - (subtreeFlags |= child$79.subtreeFlags & 31457280), - (subtreeFlags |= child$79.flags & 31457280), - (child$79.return = completedWork), - (child$79 = child$79.sibling); - else - for (child$79 = completedWork.child; null !== child$79; ) - (newChildLanes |= child$79.lanes | child$79.childLanes), - (subtreeFlags |= child$79.subtreeFlags), - (subtreeFlags |= child$79.flags), - (child$79.return = completedWork), - (child$79 = child$79.sibling); - completedWork.subtreeFlags |= subtreeFlags; - completedWork.childLanes = newChildLanes; - return didBailout; -} -function completeWork(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - switch (workInProgress.tag) { - case 2: + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return bubbleProperties(workInProgress), null; - case 1: - return ( - isContextProvider(workInProgress.type) && popContext(), - bubbleProperties(workInProgress), - null - ); - case 3: - return ( - (renderLanes = workInProgress.stateNode), - enableTransitionTracing && - null !== workInProgressTransitions && - (workInProgress.flags |= 2048), - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack), - enableTransitionTracing && pop(transitionStack), - popHostContainer(), - pop(didPerformWorkStackCursor), - pop(contextStackCursor$1), - renderLanes.pendingContext && - ((renderLanes.context = renderLanes.pendingContext), - (renderLanes.pendingContext = null)), - (null !== current && null !== current.child) || - null === current || - (current.memoizedState.isDehydrated && - 0 === (workInProgress.flags & 256)) || - ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), - bubbleProperties(workInProgress), - enableTransitionTracing && - 0 !== (workInProgress.subtreeFlags & 8192) && - (workInProgress.flags |= 2048), - null - ); - case 26: - case 27: - case 5: - popHostContext(workInProgress); - renderLanes = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && (workInProgress.flags |= 4); - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - bubbleProperties(workInProgress); - return null; - } - switch (renderLanes) { - case TYPES.CLIPPING_RECTANGLE: - var instance = Mode$1.ClippingRectangle(); - instance._applyProps = applyClippingRectangleProps; - break; - case TYPES.GROUP: - instance = Mode$1.Group(); - instance._applyProps = applyGroupProps; - break; - case TYPES.SHAPE: - instance = Mode$1.Shape(); - instance._applyProps = applyShapeProps; - break; - case TYPES.TEXT: - (instance = Mode$1.Text( - newProps.children, - newProps.font, - newProps.alignment, - newProps.path - )), - (instance._applyProps = applyTextProps); - } - if (!instance) throw Error(formatProdErrorMessage(217, renderLanes)); - instance._applyProps(instance, newProps); - current = instance; - a: for (renderLanes = workInProgress.child; null !== renderLanes; ) { - if (5 === renderLanes.tag || 6 === renderLanes.tag) { - newProps = current; - instance = renderLanes.stateNode; - if ("string" === typeof instance) - throw Error(formatProdErrorMessage(216)); - instance.inject(newProps); - } else if (4 !== renderLanes.tag && null !== renderLanes.child) { - renderLanes.child.return = renderLanes; - renderLanes = renderLanes.child; - continue; - } - if (renderLanes === workInProgress) break a; - for (; null === renderLanes.sibling; ) { - if ( - null === renderLanes.return || - renderLanes.return === workInProgress - ) - break a; - renderLanes = renderLanes.return; - } - renderLanes.sibling.return = renderLanes.return; - renderLanes = renderLanes.sibling; - } - workInProgress.stateNode = current; - } - bubbleProperties(workInProgress); - workInProgress.flags &= -16777217; - return null; - case 6: - if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && (workInProgress.flags |= 4); - else { - if ("string" !== typeof newProps && null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - workInProgress.stateNode = newProps; - } - bubbleProperties(workInProgress); - return null; - case 13: - newProps = workInProgress.memoizedState; - if ( - null === current || - (null !== current.memoizedState && - null !== current.memoizedState.dehydrated) - ) { - if (null !== newProps && null !== newProps.dehydrated) { - if (null === current) { - throw Error(formatProdErrorMessage(318)); - throw Error(formatProdErrorMessage(344)); - } - 0 === (workInProgress.flags & 128) && - (workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - instance = !1; - } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), - (instance = !0); - if (!instance) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; + Component = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error(formatProdErrorMessage(306, Component, "")); } - popSuspenseHandler(workInProgress); - if (0 !== (workInProgress.flags & 128)) - return (workInProgress.lanes = renderLanes), workInProgress; - renderLanes = null !== newProps; - current = null !== current && null !== current.memoizedState; - if (renderLanes) { - newProps = workInProgress.child; - instance = null; - null !== newProps.alternate && - null !== newProps.alternate.memoizedState && - null !== newProps.alternate.memoizedState.cachePool && - (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$83 = null; - null !== newProps.memoizedState && - null !== newProps.memoizedState.cachePool && - (cache$83 = newProps.memoizedState.cachePool.pool); - cache$83 !== instance && (newProps.flags |= 2048); - } - renderLanes !== current && - (enableTransitionTracing && (workInProgress.child.flags |= 2048), - renderLanes && (workInProgress.child.flags |= 8192)); - scheduleRetryEffect(workInProgress, workInProgress.updateQueue); - null !== workInProgress.updateQueue && - null != workInProgress.memoizedProps.suspenseCallback && - (workInProgress.flags |= 4); - bubbleProperties(workInProgress); - return null; - case 4: - return popHostContainer(), bubbleProperties(workInProgress), null; - case 10: - return ( - popProvider( - enableRenderableContext - ? workInProgress.type - : workInProgress.type._context - ), - bubbleProperties(workInProgress), - null - ); - case 17: + return workInProgress; + case 0: return ( - isContextProvider(workInProgress.type) && popContext(), - bubbleProperties(workInProgress), - null + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), + updateFunctionComponent( + current, + workInProgress, + Component, + context, + renderLanes + ) ); - case 19: - pop(suspenseStackCursor); - instance = workInProgress.memoizedState; - if (null === instance) return bubbleProperties(workInProgress), null; - newProps = 0 !== (workInProgress.flags & 128); - cache$83 = instance.rendering; - if (null === cache$83) - if (newProps) cutOffTailIfNeeded(instance, !1); - else { - if ( - 0 !== workInProgressRootExitStatus || - (null !== current && 0 !== (current.flags & 128)) - ) - for (current = workInProgress.child; null !== current; ) { - cache$83 = findFirstSuspended(current); - if (null !== cache$83) { - workInProgress.flags |= 128; - cutOffTailIfNeeded(instance, !1); - current = cache$83.updateQueue; - workInProgress.updateQueue = current; - scheduleRetryEffect(workInProgress, current); - workInProgress.subtreeFlags = 0; - current = renderLanes; - for (renderLanes = workInProgress.child; null !== renderLanes; ) - resetWorkInProgress(renderLanes, current), - (renderLanes = renderLanes.sibling); - push( - suspenseStackCursor, - (suspenseStackCursor.current & 1) | 2 - ); - return workInProgress.child; - } - current = current.sibling; - } - null !== instance.tail && - now() > workInProgressRootRenderTargetTime && - ((workInProgress.flags |= 128), - (newProps = !0), - cutOffTailIfNeeded(instance, !1), - (workInProgress.lanes = 4194304)); - } - else { - if (!newProps) - if (((current = findFirstSuspended(cache$83)), null !== current)) { - if ( - ((workInProgress.flags |= 128), - (newProps = !0), - (current = current.updateQueue), - (workInProgress.updateQueue = current), - scheduleRetryEffect(workInProgress, current), - cutOffTailIfNeeded(instance, !0), - null === instance.tail && - "hidden" === instance.tailMode && - !cache$83.alternate) - ) - return bubbleProperties(workInProgress), null; - } else - 2 * now() - instance.renderingStartTime > - workInProgressRootRenderTargetTime && - 536870912 !== renderLanes && - ((workInProgress.flags |= 128), - (newProps = !0), - cutOffTailIfNeeded(instance, !1), - (workInProgress.lanes = 4194304)); - instance.isBackwards - ? ((cache$83.sibling = workInProgress.child), - (workInProgress.child = cache$83)) - : ((current = instance.last), - null !== current - ? (current.sibling = cache$83) - : (workInProgress.child = cache$83), - (instance.last = cache$83)); - } - if (null !== instance.tail) - return ( - (workInProgress = instance.tail), - (instance.rendering = workInProgress), - (instance.tail = workInProgress.sibling), - (instance.renderingStartTime = now()), - (workInProgress.sibling = null), - (current = suspenseStackCursor.current), - push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1), - workInProgress - ); - bubbleProperties(workInProgress); - return null; - case 21: + case 1: return ( - null === current && - ((workInProgress.stateNode = { - DO_NOT_USE_queryAllNodes: DO_NOT_USE_queryAllNodes, - DO_NOT_USE_queryFirstNode: DO_NOT_USE_queryFirstNode, - containsNode: containsNode, - getChildContextValues: getChildContextValues - }), - shim$1()), - null !== workInProgress.ref && (workInProgress.flags |= 4), - bubbleProperties(workInProgress), - null + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), + updateClassComponent( + current, + workInProgress, + Component, + context, + renderLanes + ) ); - case 22: - case 23: + case 3: + pushHostRootContext(workInProgress); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + context = workInProgress.memoizedState; + Component = context.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + nextProps = workInProgress.memoizedState; + enableTransitionTracing && + push(transitionStack, workInProgressTransitions); + enableTransitionTracing && pushRootMarkerInstance(workInProgress); + var nextCache = nextProps.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== context.cache && + propagateContextChange(workInProgress, CacheContext, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + context = nextProps.element; + context === Component + ? (workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + )) + : (reconcileChildren(current, workInProgress, context, renderLanes), + (workInProgress = workInProgress.child)); + return workInProgress; + case 26: + case 27: + case 5: return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - (newProps = null !== workInProgress.memoizedState), - 23 !== workInProgress.tag && - (null !== current - ? (null !== current.memoizedState) !== newProps && - (workInProgress.flags |= 8192) - : newProps && (workInProgress.flags |= 8192)), - newProps && 0 !== (workInProgress.mode & 1) - ? 0 !== (renderLanes & 536870912) && - 0 === (workInProgress.flags & 128) && - (bubbleProperties(workInProgress), - 23 !== workInProgress.tag && - workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), - (renderLanes = workInProgress.updateQueue), - null !== renderLanes && - scheduleRetryEffect(workInProgress, renderLanes.retryQueue), - (renderLanes = null), - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (renderLanes = current.memoizedState.cachePool.pool), - (newProps = null), + pushHostContext(workInProgress), + (context = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextCache = null !== current ? current.memoizedProps : null), + (Component = nextProps.children), + shouldSetTextContent(context, nextProps) + ? (Component = null) + : null !== nextCache && + shouldSetTextContent(context, nextCache) && + (workInProgress.flags |= 32), null !== workInProgress.memoizedState && - null !== workInProgress.memoizedState.cachePool && - (newProps = workInProgress.memoizedState.cachePool.pool), - newProps !== renderLanes && (workInProgress.flags |= 2048), - popTransition(workInProgress, current), - null + ((context = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue2 = context), + enableLazyContextPropagation || + (didReceiveUpdate && + null !== current && + current.memoizedState.memoizedState !== context && + propagateContextChange( + workInProgress, + HostTransitionContext, + renderLanes + ))), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - case 24: + case 6: + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: return ( - (renderLanes = null), - null !== current && (renderLanes = current.memoizedState.cache), - workInProgress.memoizedState.cache !== renderLanes && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - bubbleProperties(workInProgress), - null + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (Component = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + )) + : reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - case 25: + case 11: return ( - enableTransitionTracing && - (null !== workInProgress.stateNode && - enableTransitionTracing && - pop(markerInstanceStack), - bubbleProperties(workInProgress)), - null + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), + updateForwardRef( + current, + workInProgress, + Component, + context, + renderLanes + ) ); - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -function unwindWork(current, workInProgress) { - switch (workInProgress.tag) { - case 1: + case 7: return ( - isContextProvider(workInProgress.type) && popContext(), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child ); - case 3: + case 8: return ( - popProvider(CacheContext), - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack), - enableTransitionTracing && pop(transitionStack), - popHostContainer(), - pop(didPerformWorkStackCursor), - pop(contextStackCursor$1), - (current = workInProgress.flags), - 0 !== (current & 65536) && 0 === (current & 128) - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - case 26: - case 27: - case 5: - return popHostContext(workInProgress), null; - case 13: - popSuspenseHandler(workInProgress); - current = workInProgress.memoizedState; - if ( - null !== current && - null !== current.dehydrated && - null === workInProgress.alternate - ) - throw Error(formatProdErrorMessage(340)); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null; - case 19: - return pop(suspenseStackCursor), null; - case 4: - return popHostContainer(), null; - case 10: + case 12: return ( - popProvider( - enableRenderableContext - ? workInProgress.type - : workInProgress.type._context + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ), - null + workInProgress.child ); - case 22: - case 23: + case 10: + a: { + Component = enableRenderableContext + ? workInProgress.type + : workInProgress.type._context; + context = workInProgress.pendingProps; + nextProps = workInProgress.memoizedProps; + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextCache)) { + if ( + nextProps.children === context.children && + !didPerformWorkStackCursor.current + ) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); + workInProgress = workInProgress.child; + } + return workInProgress; + case 9: return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - popTransition(workInProgress, current), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + (context = enableRenderableContext + ? workInProgress.type._context + : workInProgress.type), + (Component = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress, renderLanes), + (context = readContext(context)), + (Component = Component(context)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - case 24: - return popProvider(CacheContext), null; - case 25: + case 14: return ( - enableTransitionTracing && - null !== workInProgress.stateNode && - enableTransitionTracing && - pop(markerInstanceStack), - null + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), + updateMemoComponent( + current, + workInProgress, + Component, + context, + renderLanes + ) + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(Component) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), + finishClassComponent( + null, + workInProgress, + Component, + !0, + current, + renderLanes + ) ); - default: - return null; - } -} -function unwindInterruptedWork(current, interruptedWork) { - switch (interruptedWork.tag) { - case 1: - current = interruptedWork.type.childContextTypes; - null !== current && void 0 !== current && popContext(); - break; - case 3: - popProvider(CacheContext); - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack); - enableTransitionTracing && pop(transitionStack); - popHostContainer(); - pop(didPerformWorkStackCursor); - pop(contextStackCursor$1); - break; - case 26: - case 27: - case 5: - popHostContext(interruptedWork); - break; - case 4: - popHostContainer(); - break; - case 13: - popSuspenseHandler(interruptedWork); - break; case 19: - pop(suspenseStackCursor); - break; - case 10: - popProvider( - enableRenderableContext - ? interruptedWork.type - : interruptedWork.type._context + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 21: + return ( + (Component = workInProgress.pendingProps.children), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - break; case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: - popSuspenseHandler(interruptedWork); - popHiddenContext(); - popTransition(interruptedWork, current); - break; + return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: - popProvider(CacheContext); - break; + return ( + prepareToReadContext(workInProgress, renderLanes), + (Component = readContext(CacheContext)), + null === current + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), + (nextProps = createCache()), + (context.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), + (workInProgress.memoizedState = { + parent: Component, + cache: context + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, context)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (context = current.memoizedState), + (nextProps = workInProgress.memoizedState), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && + propagateContextChange( + workInProgress, + CacheContext, + renderLanes + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); case 25: - enableTransitionTracing && - null !== interruptedWork.stateNode && - enableTransitionTracing && - pop(markerInstanceStack); - } -} -if ("function" !== typeof require("ReactFbErrorUtils").invokeGuardedCallback) - throw Error(formatProdErrorMessage(255)); -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; -function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - "function" === typeof ref - ? (current.refCleanup = ref(instanceToUse)) - : (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } -} -function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - ref(null); - } catch (error$101) { - captureCommitPhaseError(current, nearestMountedAncestor, error$101); - } - else ref.current = null; -} -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } -} -var focusedInstanceHandle = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - focusedInstanceHandle = null; - for (nextEffect = firstChild; null !== nextEffect; ) { - root = nextEffect; - firstChild = root.deletions; - if (null !== firstChild) - for (var i = 0; i < firstChild.length; i++) - doesFiberContain(firstChild[i], focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - firstChild = root.child; - if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - try { - var current = root.alternate, - flags = root.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === root.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = root.memoizedState; - JSCompiler_temp = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(root, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - switch (root.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = root.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for ( - firstChild = 0; - firstChild < eventPayloads.length; - firstChild++ - ) { - var _eventPayloads$ii = eventPayloads[firstChild]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevProps = current.memoizedProps, - prevState = current.memoizedState, - instance = root.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - root.elementType === root.type - ? prevProps - : resolveDefaultProps(root.type, prevProps), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(root, root.return, error); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } + if (enableTransitionTracing) + return ( + enableTransitionTracing + ? (null === current && + ((Component = enableTransitionTracing + ? transitionStack.current + : null), + null !== Component && + ((Component = { + tag: 1, + transitions: new Set(Component), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }), + (workInProgress.stateNode = Component), + (workInProgress.flags |= 2048))), + (Component = workInProgress.stateNode), + null !== Component && + pushMarkerInstance(workInProgress, Component), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + (workInProgress = workInProgress.child)) + : (workInProgress = null), + workInProgress + ); } - current = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - focusedInstanceHandle = null; - return current; + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } +var valueCursor = createCursor(null), + currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null; +function resetContextDependencies() { + lastFullyObservedContext = + lastContextDependency = + currentlyRenderingFiber = + null; } -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; - } - effect = effect.next; - } while (effect !== finishedWork); - } +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2); + context._currentValue2 = nextValue; } -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +function popProvider(context) { + context._currentValue2 = valueCursor.current; + pop(valueCursor); +} +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } } -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +function propagateContextChange(workInProgress, context, renderLanes) { + if (enableLazyContextPropagation) + propagateContextChanges(workInProgress, [context], renderLanes, !0); + else if (!enableLazyContextPropagation) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + for (var dependency = list.firstContext; null !== dependency; ) { + if (dependency.context === context) { + if (1 === fiber.tag) { + dependency = createUpdate(renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = fiber.updateQueue; + if (null !== updateQueue) { + updateQueue = updateQueue.shared; + var pending = updateQueue.pending; + null === pending + ? (dependency.next = dependency) + : ((dependency.next = pending.next), + (pending.next = dependency)); + updateQueue.pending = dependency; + } + } + fiber.lanes |= renderLanes; + dependency = fiber.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + workInProgress + ); + list.lanes |= renderLanes; + break; + } + dependency = dependency.next; + } + } else if (10 === fiber.tag) + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = fiber.sibling; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } } -function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); - break; - case 1: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 4) - if (((finishedRoot = finishedWork.stateNode), null === current)) - try { - finishedRoot.componentDidMount(); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + if (enableLazyContextPropagation) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - else { - var prevProps = - finishedWork.elementType === finishedWork.type - ? current.memoizedProps - : resolveDefaultProps(finishedWork.type, current.memoizedProps); - current = current.memoizedState; - try { - finishedRoot.componentDidUpdate( - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$102) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$102 - ); + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } + nextFiber = nextFiber.return; } - flags & 64 && commitClassCallbacks(finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 3: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { - finishedRoot = null; - if (null !== finishedWork.child) - switch (finishedWork.child.tag) { - case 27: - case 5: - finishedRoot = finishedWork.child.stateNode; - break; - case 1: - finishedRoot = finishedWork.child.stateNode; - } - try { - commitCallbacks(flags, finishedRoot); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + fiber = nextFiber; + } + } +} +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + if (enableLazyContextPropagation) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - break; - case 26: - case 27: - case 5: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 13: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 22: - if (0 !== (finishedWork.mode & 1)) { - if ( - ((prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !prevProps) - ) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && - ("manual" === finishedWork.memoizedProps.mode - ? safelyAttachRef(finishedWork, finishedWork.return) - : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + } +} +function checkIfContextChanged(currentDependencies) { + if (!enableLazyContextPropagation) return !1; + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; +} +function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && + (enableLazyContextPropagation + ? (workInProgress.firstContext = null) + : null !== workInProgress.firstContext && + (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), + (workInProgress.firstContext = null))); +} +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber, context); +} +function readContextDuringReconcilation(consumer, context, renderLanes) { + null === currentlyRenderingFiber && + prepareToReadContext(consumer, renderLanes); + return readContextForConsumer(consumer, context); +} +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { context: context, memoizedValue: value, next: null }), + null === lastContextDependency) + ) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + enableLazyContextPropagation && (consumer.flags |= 524288); + } else lastContextDependency = lastContextDependency.next = context; + return value; +} +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; +} +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); +} +var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; +function requestCurrentTransition() { + var transition = ReactCurrentBatchConfig$1.transition; + null !== transition && transition._callbacks.add(handleAsyncAction); + return transition; +} +function handleAsyncAction(transition, thenable) { + entangleAsyncAction(transition, thenable); +} +function notifyTransitionCallbacks(transition, returnValue) { + transition._callbacks.forEach(function (callback) { + return callback(transition, returnValue); + }); +} +var resumedCache = createCursor(null), + transitionStack = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition( + offscreenWorkInProgress, + prevCachePool, + newTransitions +) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); + enableTransitionTracing && + (null === transitionStack.current + ? push(transitionStack, newTransitions) + : null === newTransitions + ? push(transitionStack, transitionStack.current) + : push(transitionStack, transitionStack.current.concat(newTransitions))); +} +function popTransition(workInProgress, current) { + null !== current && + (enableTransitionTracing && pop(transitionStack), pop(resumedCache)); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; } -function abortRootTransitions( - root, - abort, - deletedTransitions, - deletedOffscreenInstance +var emptyObject = {}; +function collectScopedNodesFromChildren( + startingChild, + fn$jscomp$0, + scopedNodes$jscomp$0 ) { - if (enableTransitionTracing) { - var rootTransitions = root.incompleteTransitions; - deletedTransitions.forEach(function (transition) { - rootTransitions.has(transition) && - ((transition = rootTransitions.get(transition)), - null === transition.aborts && (transition.aborts = []), - transition.aborts.push(abort), - null !== deletedOffscreenInstance && - null !== transition.pendingBoundaries && - transition.pendingBoundaries.has(deletedOffscreenInstance) && - transition.pendingBoundaries.delete(deletedOffscreenInstance)); - }); + for (; null !== startingChild; ) { + var node = startingChild, + fn = fn$jscomp$0, + scopedNodes = scopedNodes$jscomp$0; + if (5 === node.tag) { + var type = node.type, + memoizedProps = node.memoizedProps, + instance = node.stateNode; + null !== instance && + !0 === fn(type, memoizedProps || emptyObject, instance) && + scopedNodes.push(instance); + } + type = node.child; + isFiberSuspenseAndTimedOut(node) && (type = node.child.sibling.child); + null !== type && collectScopedNodesFromChildren(type, fn, scopedNodes); + startingChild = startingChild.sibling; } } -function abortTracingMarkerTransitions( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree -) { - if (enableTransitionTracing) { - var markerInstance = abortedFiber.stateNode, - markerTransitions = markerInstance.transitions, - pendingBoundaries = markerInstance.pendingBoundaries; - null !== markerTransitions && - deletedTransitions.forEach(function (transition) { - if ( - null !== abortedFiber && - markerTransitions.has(transition) && - (null === markerInstance.aborts || - !markerInstance.aborts.includes(abort)) && - null !== markerInstance.transitions - ) { - if (null === markerInstance.aborts) { - markerInstance.aborts = [abort]; - transition = abortedFiber.memoizedProps.name; - var transitions = markerInstance.transitions, - aborts = markerInstance.aborts; - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: new Map(), - markerComplete: null - }), - null === currentPendingTransitionCallbacks.markerIncomplete && - (currentPendingTransitionCallbacks.markerIncomplete = - new Map()), - currentPendingTransitionCallbacks.markerIncomplete.set( - transition, - { transitions: transitions, aborts: aborts } - )); - } else markerInstance.aborts.push(abort); - null !== deletedOffscreenInstance && - !isInDeletedTree && - null !== pendingBoundaries && - pendingBoundaries.has(deletedOffscreenInstance) && - (pendingBoundaries.delete(deletedOffscreenInstance), - addMarkerProgressCallbackToPendingTransition( - abortedFiber.memoizedProps.name, - deletedTransitions, - pendingBoundaries - )); +function collectFirstScopedNodeFromChildren(startingChild, fn$jscomp$0) { + for (; null !== startingChild; ) { + a: { + var JSCompiler_inline_result = startingChild; + var fn = fn$jscomp$0; + if (5 === JSCompiler_inline_result.tag) { + var type = JSCompiler_inline_result.type, + memoizedProps = JSCompiler_inline_result.memoizedProps, + instance = JSCompiler_inline_result.stateNode; + if (null !== instance && !0 === fn(type, memoizedProps, instance)) { + JSCompiler_inline_result = instance; + break a; } - }); - } -} -function abortParentMarkerTransitionsForDeletedFiber( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree -) { - if (enableTransitionTracing) - for (; null !== abortedFiber; ) { - switch (abortedFiber.tag) { - case 25: - abortTracingMarkerTransitions( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree - ); - break; - case 3: - abortRootTransitions( - abortedFiber.stateNode, - abort, - deletedTransitions, - deletedOffscreenInstance - ); } - abortedFiber = abortedFiber.return; + type = JSCompiler_inline_result.child; + isFiberSuspenseAndTimedOut(JSCompiler_inline_result) && + (type = JSCompiler_inline_result.child.sibling.child); + JSCompiler_inline_result = + null !== type ? collectFirstScopedNodeFromChildren(type, fn) : null; } -} -function commitTransitionProgress(offscreenFiber) { - if (enableTransitionTracing) { - var offscreenInstance = offscreenFiber.stateNode, - prevState = null, - previousFiber = offscreenFiber.alternate; - null !== previousFiber && - null !== previousFiber.memoizedState && - (prevState = previousFiber.memoizedState); - prevState = null !== prevState; - previousFiber = null !== offscreenFiber.memoizedState; - var pendingMarkers = offscreenInstance._pendingMarkers, - name = null; - offscreenFiber = offscreenFiber.return; - null !== offscreenFiber && - 13 === offscreenFiber.tag && - offscreenFiber.memoizedProps.unstable_name && - (name = offscreenFiber.memoizedProps.unstable_name); - !prevState && previousFiber - ? null !== pendingMarkers && - pendingMarkers.forEach(function (markerInstance) { - var pendingBoundaries = markerInstance.pendingBoundaries, - transitions = markerInstance.transitions, - markerName = markerInstance.name; - null === pendingBoundaries || - pendingBoundaries.has(offscreenInstance) || - (pendingBoundaries.set(offscreenInstance, { name: name }), - null !== transitions && - (1 === markerInstance.tag && null !== markerName - ? addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries - ) - : 0 === markerInstance.tag && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }) - : prevState && - !previousFiber && - null !== pendingMarkers && - pendingMarkers.forEach(function (markerInstance) { - var pendingBoundaries = markerInstance.pendingBoundaries, - transitions = markerInstance.transitions, - markerName = markerInstance.name; - null !== pendingBoundaries && - pendingBoundaries.has(offscreenInstance) && - (pendingBoundaries.delete(offscreenInstance), - null !== transitions && - (1 === markerInstance.tag && null !== markerName - ? (addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries - ), - 0 === pendingBoundaries.size && - (null === markerInstance.aborts && - addMarkerCompleteCallbackToPendingTransition( - markerName, - transitions - ), - (markerInstance.transitions = null), - (markerInstance.pendingBoundaries = null), - (markerInstance.aborts = null))) - : 0 === markerInstance.tag && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }); + if (null !== JSCompiler_inline_result) return JSCompiler_inline_result; + startingChild = startingChild.sibling; } + return null; } -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; -} -function isHostParent(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); +function collectNearestChildContextValues( + startingChild, + context$jscomp$0, + childContextValues$jscomp$0 +) { + for (; null !== startingChild; ) { + var node = startingChild, + context = context$jscomp$0, + childContextValues = childContextValues$jscomp$0; + if ( + 10 === node.tag && + (enableRenderableContext ? node.type : node.type._context) === context + ) + childContextValues.push(node.memoizedProps.value); + else { + var child = node.child; + isFiberSuspenseAndTimedOut(node) && (child = node.child.sibling.child); + null !== child && + collectNearestChildContextValues(child, context, childContextValues); } - if (!(fiber.flags & 2)) return fiber.stateNode; + startingChild = startingChild.sibling; } } -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); +function DO_NOT_USE_queryAllNodes(fn) { + var currentFiber = shim$1(); + if (null === currentFiber) return null; + currentFiber = currentFiber.child; + var scopedNodes = []; + null !== currentFiber && + collectScopedNodesFromChildren(currentFiber, fn, scopedNodes); + return 0 === scopedNodes.length ? null : scopedNodes; } -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function DO_NOT_USE_queryFirstNode(fn) { + var currentFiber = shim$1(); + if (null === currentFiber) return null; + currentFiber = currentFiber.child; + return null !== currentFiber + ? collectFirstScopedNodeFromChildren(currentFiber, fn) + : null; } -var hostParent = null, - hostParentIsContainer = !1; -function recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - parent -) { - for (parent = parent.child; null !== parent; ) - commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), - (parent = parent.sibling); +function containsNode() { + throw Error(formatProdErrorMessage(248)); } -function commitDeletionEffectsOnFiber( - finishedRoot, - nearestMountedAncestor, - deletedFiber -) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) - try { - injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); - } catch (err) {} - switch (deletedFiber.tag) { +function getChildContextValues(context) { + var currentFiber = shim$1(); + if (null === currentFiber) return []; + currentFiber = currentFiber.child; + var childContextValues = []; + null !== currentFiber && + collectNearestChildContextValues(currentFiber, context, childContextValues); + return childContextValues; +} +function scheduleRetryEffect(workInProgress, retryQueue) { + null !== retryQueue + ? (workInProgress.flags |= 4) + : workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue)); +} +function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + hasRenderedATailFallback = renderState.tail; + for (var lastTailNode = null; null !== hasRenderedATailFallback; ) + null !== hasRenderedATailFallback.alternate && + (lastTailNode = hasRenderedATailFallback), + (hasRenderedATailFallback = hasRenderedATailFallback.sibling); + null === lastTailNode + ? (renderState.tail = null) + : (lastTailNode.sibling = null); + break; + case "collapsed": + lastTailNode = renderState.tail; + for (var lastTailNode$78 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode), + (lastTailNode = lastTailNode.sibling); + null === lastTailNode$78 + ? hasRenderedATailFallback || null === renderState.tail + ? (renderState.tail = null) + : (renderState.tail.sibling = null) + : (lastTailNode$78.sibling = null); + } +} +function bubbleProperties(completedWork) { + var didBailout = + null !== completedWork.alternate && + completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) + for (var child$79 = completedWork.child; null !== child$79; ) + (newChildLanes |= child$79.lanes | child$79.childLanes), + (subtreeFlags |= child$79.subtreeFlags & 31457280), + (subtreeFlags |= child$79.flags & 31457280), + (child$79.return = completedWork), + (child$79 = child$79.sibling); + else + for (child$79 = completedWork.child; null !== child$79; ) + (newChildLanes |= child$79.lanes | child$79.childLanes), + (subtreeFlags |= child$79.subtreeFlags), + (subtreeFlags |= child$79.flags), + (child$79.return = completedWork), + (child$79 = child$79.sibling); + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; +} +function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + switch (workInProgress.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; + case 1: + return ( + isContextProvider(workInProgress.type) && popContext(), + bubbleProperties(workInProgress), + null + ); + case 3: + return ( + (renderLanes = workInProgress.stateNode), + enableTransitionTracing && + null !== workInProgressTransitions && + (workInProgress.flags |= 2048), + (newProps = null), + null !== current && (newProps = current.memoizedState.cache), + workInProgress.memoizedState.cache !== newProps && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack), + enableTransitionTracing && pop(transitionStack), + popHostContainer(), + pop(didPerformWorkStackCursor), + pop(contextStackCursor$1), + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)), + (null !== current && null !== current.child) || + null === current || + (current.memoizedState.isDehydrated && + 0 === (workInProgress.flags & 256)) || + ((workInProgress.flags |= 1024), + null !== hydrationErrors && + (queueRecoverableErrors(hydrationErrors), + (hydrationErrors = null))), + bubbleProperties(workInProgress), + enableTransitionTracing && + 0 !== (workInProgress.subtreeFlags & 8192) && + (workInProgress.flags |= 2048), + null + ); case 26: case 27: case 5: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor); + popHostContext(workInProgress); + renderLanes = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) + current.memoizedProps !== newProps && (workInProgress.flags |= 4); + else { + if (!newProps) { + if (null === workInProgress.stateNode) + throw Error(formatProdErrorMessage(166)); + bubbleProperties(workInProgress); + return null; + } + switch (renderLanes) { + case TYPES.CLIPPING_RECTANGLE: + var instance = Mode$1.ClippingRectangle(); + instance._applyProps = applyClippingRectangleProps; + break; + case TYPES.GROUP: + instance = Mode$1.Group(); + instance._applyProps = applyGroupProps; + break; + case TYPES.SHAPE: + instance = Mode$1.Shape(); + instance._applyProps = applyShapeProps; + break; + case TYPES.TEXT: + (instance = Mode$1.Text( + newProps.children, + newProps.font, + newProps.alignment, + newProps.path + )), + (instance._applyProps = applyTextProps); + } + if (!instance) throw Error(formatProdErrorMessage(217, renderLanes)); + instance._applyProps(instance, newProps); + current = instance; + a: for (renderLanes = workInProgress.child; null !== renderLanes; ) { + if (5 === renderLanes.tag || 6 === renderLanes.tag) { + newProps = current; + instance = renderLanes.stateNode; + if ("string" === typeof instance) + throw Error(formatProdErrorMessage(216)); + instance.inject(newProps); + } else if (4 !== renderLanes.tag && null !== renderLanes.child) { + renderLanes.child.return = renderLanes; + renderLanes = renderLanes.child; + continue; + } + if (renderLanes === workInProgress) break a; + for (; null === renderLanes.sibling; ) { + if ( + null === renderLanes.return || + renderLanes.return === workInProgress + ) + break a; + renderLanes = renderLanes.return; + } + renderLanes.sibling.return = renderLanes.return; + renderLanes = renderLanes.sibling; + } + workInProgress.stateNode = current; + } + bubbleProperties(workInProgress); + workInProgress.flags &= -16777217; + return null; case 6: - var prevHostParent = hostParent, - prevHostParentIsContainer = hostParentIsContainer; - hostParent = null; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); - break; - case 18: - finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); - null !== hostParent && shim$2(); - break; - case 4: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; - hostParent = deletedFiber.stateNode.containerInfo; - hostParentIsContainer = !0; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - break; - case 0: - case 11: - case 14: - case 15: + if (current && null != workInProgress.stateNode) + current.memoizedProps !== newProps && (workInProgress.flags |= 4); + else { + if ("string" !== typeof newProps && null === workInProgress.stateNode) + throw Error(formatProdErrorMessage(166)); + workInProgress.stateNode = newProps; + } + bubbleProperties(workInProgress); + return null; + case 13: + newProps = workInProgress.memoizedState; if ( - !offscreenSubtreeWasHidden && - ((prevHostParent = deletedFiber.updateQueue), - null !== prevHostParent && - ((prevHostParent = prevHostParent.lastEffect), - null !== prevHostParent)) + null === current || + (null !== current.memoizedState && + null !== current.memoizedState.dehydrated) ) { - prevHostParentIsContainer = prevHostParent = prevHostParent.next; - do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - (0 !== (tag & 2) - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : 0 !== (tag & 4) && - ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ))); - prevHostParentIsContainer = prevHostParentIsContainer.next; - } while (prevHostParentIsContainer !== prevHostParent); + if (null !== newProps && null !== newProps.dehydrated) { + if (null === current) { + throw Error(formatProdErrorMessage(318)); + throw Error(formatProdErrorMessage(344)); + } + 0 === (workInProgress.flags & 128) && + (workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + instance = !1; + } else + null !== hydrationErrors && + (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (instance = !0); + if (!instance) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; + } } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + popSuspenseHandler(workInProgress); + if (0 !== (workInProgress.flags & 128)) + return (workInProgress.lanes = renderLanes), workInProgress; + renderLanes = null !== newProps; + current = null !== current && null !== current.memoizedState; + if (renderLanes) { + newProps = workInProgress.child; + instance = null; + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (instance = newProps.alternate.memoizedState.cachePool.pool); + var cache$83 = null; + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (cache$83 = newProps.memoizedState.cachePool.pool); + cache$83 !== instance && (newProps.flags |= 2048); + } + renderLanes !== current && + (enableTransitionTracing && (workInProgress.child.flags |= 2048), + renderLanes && (workInProgress.child.flags |= 8192)); + scheduleRetryEffect(workInProgress, workInProgress.updateQueue); + null !== workInProgress.updateQueue && + null != workInProgress.memoizedProps.suspenseCallback && + (workInProgress.flags |= 4); + bubbleProperties(workInProgress); + return null; + case 4: + return popHostContainer(), bubbleProperties(workInProgress), null; + case 10: + return ( + popProvider( + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context + ), + bubbleProperties(workInProgress), + null ); - break; - case 1: - if ( - !offscreenSubtreeWasHidden && - (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - (prevHostParent.props = deletedFiber.memoizedProps), - (prevHostParent.state = deletedFiber.memoizedState), - prevHostParent.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); - } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case 17: + return ( + isContextProvider(workInProgress.type) && popContext(), + bubbleProperties(workInProgress), + null ); - break; + case 19: + pop(suspenseStackCursor); + instance = workInProgress.memoizedState; + if (null === instance) return bubbleProperties(workInProgress), null; + newProps = 0 !== (workInProgress.flags & 128); + cache$83 = instance.rendering; + if (null === cache$83) + if (newProps) cutOffTailIfNeeded(instance, !1); + else { + if ( + 0 !== workInProgressRootExitStatus || + (null !== current && 0 !== (current.flags & 128)) + ) + for (current = workInProgress.child; null !== current; ) { + cache$83 = findFirstSuspended(current); + if (null !== cache$83) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(instance, !1); + current = cache$83.updateQueue; + workInProgress.updateQueue = current; + scheduleRetryEffect(workInProgress, current); + workInProgress.subtreeFlags = 0; + current = renderLanes; + for (renderLanes = workInProgress.child; null !== renderLanes; ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); + push( + suspenseStackCursor, + (suspenseStackCursor.current & 1) | 2 + ); + return workInProgress.child; + } + current = current.sibling; + } + null !== instance.tail && + now() > workInProgressRootRenderTargetTime && + ((workInProgress.flags |= 128), + (newProps = !0), + cutOffTailIfNeeded(instance, !1), + (workInProgress.lanes = 4194304)); + } + else { + if (!newProps) + if (((current = findFirstSuspended(cache$83)), null !== current)) { + if ( + ((workInProgress.flags |= 128), + (newProps = !0), + (current = current.updateQueue), + (workInProgress.updateQueue = current), + scheduleRetryEffect(workInProgress, current), + cutOffTailIfNeeded(instance, !0), + null === instance.tail && + "hidden" === instance.tailMode && + !cache$83.alternate) + ) + return bubbleProperties(workInProgress), null; + } else + 2 * now() - instance.renderingStartTime > + workInProgressRootRenderTargetTime && + 536870912 !== renderLanes && + ((workInProgress.flags |= 128), + (newProps = !0), + cutOffTailIfNeeded(instance, !1), + (workInProgress.lanes = 4194304)); + instance.isBackwards + ? ((cache$83.sibling = workInProgress.child), + (workInProgress.child = cache$83)) + : ((current = instance.last), + null !== current + ? (current.sibling = cache$83) + : (workInProgress.child = cache$83), + (instance.last = cache$83)); + } + if (null !== instance.tail) + return ( + (workInProgress = instance.tail), + (instance.rendering = workInProgress), + (instance.tail = workInProgress.sibling), + (instance.renderingStartTime = now()), + (workInProgress.sibling = null), + (current = suspenseStackCursor.current), + push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1), + workInProgress + ); + bubbleProperties(workInProgress); + return null; case 21: - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + return ( + null === current && + ((workInProgress.stateNode = { + DO_NOT_USE_queryAllNodes: DO_NOT_USE_queryAllNodes, + DO_NOT_USE_queryFirstNode: DO_NOT_USE_queryFirstNode, + containsNode: containsNode, + getChildContextValues: getChildContextValues + }), + shim$1()), + null !== workInProgress.ref && (workInProgress.flags |= 4), + bubbleProperties(workInProgress), + null ); - break; case 22: - safelyDetachRef(deletedFiber, nearestMountedAncestor); - deletedFiber.mode & 1 - ? ((offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState), - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ), - (offscreenSubtreeWasHidden = prevHostParent)) - : recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - default: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(), + (newProps = null !== workInProgress.memoizedState), + 23 !== workInProgress.tag && + (null !== current + ? (null !== current.memoizedState) !== newProps && + (workInProgress.flags |= 8192) + : newProps && (workInProgress.flags |= 8192)), + newProps && 0 !== (workInProgress.mode & 1) + ? 0 !== (renderLanes & 536870912) && + 0 === (workInProgress.flags & 128) && + (bubbleProperties(workInProgress), + 23 !== workInProgress.tag && + workInProgress.subtreeFlags & 6 && + (workInProgress.flags |= 8192)) + : bubbleProperties(workInProgress), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), + null !== workInProgress.memoizedState && + null !== workInProgress.memoizedState.cachePool && + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), + popTransition(workInProgress, current), + null + ); + case 24: + return ( + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + bubbleProperties(workInProgress), + null + ); + case 25: + return ( + enableTransitionTracing && + (null !== workInProgress.stateNode && + enableTransitionTracing && + pop(markerInstanceStack), + bubbleProperties(workInProgress)), + null ); } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } -function getRetryCache(finishedWork) { - switch (finishedWork.tag) { +function unwindWork(current, workInProgress) { + switch (workInProgress.tag) { + case 1: + return ( + isContextProvider(workInProgress.type) && popContext(), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); + case 3: + return ( + popProvider(CacheContext), + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack), + enableTransitionTracing && pop(transitionStack), + popHostContainer(), + pop(didPerformWorkStackCursor), + pop(contextStackCursor$1), + (current = workInProgress.flags), + 0 !== (current & 65536) && 0 === (current & 128) + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); + case 26: + case 27: + case 5: + return popHostContext(workInProgress), null; case 13: + popSuspenseHandler(workInProgress); + current = workInProgress.memoizedState; + if ( + null !== current && + null !== current.dehydrated && + null === workInProgress.alternate + ) + throw Error(formatProdErrorMessage(340)); + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null; case 19: - var retryCache = finishedWork.stateNode; - null === retryCache && - (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); - return retryCache; + return pop(suspenseStackCursor), null; + case 4: + return popHostContainer(), null; + case 10: + return ( + popProvider( + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context + ), + null + ); case 22: + case 23: return ( - (finishedWork = finishedWork.stateNode), - (retryCache = finishedWork._retryCache), - null === retryCache && - (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), - retryCache + popSuspenseHandler(workInProgress), + popHiddenContext(), + popTransition(workInProgress, current), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null ); - default: - throw Error(formatProdErrorMessage(435, finishedWork.tag)); - } -} -function detachOffscreenInstance(instance) { - var fiber = instance._current; - if (null === fiber) throw Error(formatProdErrorMessage(456)); - if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && - ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, 2)); - } -} -function attachOffscreenInstance(instance) { - var fiber = instance._current; - if (null === fiber) throw Error(formatProdErrorMessage(456)); - if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && - ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, 2)); - } -} -function attachSuspenseRetryListeners(finishedWork, wakeables) { - var retryCache = getRetryCache(finishedWork); - wakeables.forEach(function (wakeable) { - var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); - retryCache.has(wakeable) || - (retryCache.add(wakeable), wakeable.then(retry, retry)); - }); -} -function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { - var deletions = parentFiber.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; - } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); - } - } - if (parentFiber.subtreeFlags & 12854) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), - (parentFiber = parentFiber.sibling); + case 24: + return popProvider(CacheContext), null; + case 25: + return ( + enableTransitionTracing && + null !== workInProgress.stateNode && + enableTransitionTracing && + pop(markerInstanceStack), + null + ); + default: + return null; + } } -function commitMutationEffectsOnFiber(finishedWork, root) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$110) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$110); - } - } - break; +function unwindInterruptedWork(current, interruptedWork) { + switch (interruptedWork.tag) { case 1: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - flags & 64 && - offscreenSubtreeIsHidden && - ((finishedWork = finishedWork.updateQueue), - null !== finishedWork && - ((flags = finishedWork.callbacks), - null !== flags && - ((current = finishedWork.shared.hiddenCallbacks), - (finishedWork.shared.hiddenCallbacks = - null === current ? flags : current.concat(flags))))); + current = interruptedWork.type.childContextTypes; + null !== current && void 0 !== current && popContext(); + break; + case 3: + popProvider(CacheContext); + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack); + enableTransitionTracing && pop(transitionStack); + popHostContainer(); + pop(didPerformWorkStackCursor); + pop(contextStackCursor$1); break; case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; - finishedWork.updateQueue = null; - try { - flags._applyProps(flags, newProps, current); - } catch (error$113) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$113); - } - } - break; - case 6: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - if (flags & 4 && null === finishedWork.stateNode) - throw Error(formatProdErrorMessage(162)); - break; - case 3: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); + popHostContext(interruptedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); + popHostContainer(); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((newProps = null !== finishedWork.memoizedState), - (current = null !== current && null !== current.memoizedState), - alwaysThrottleRetries - ? newProps !== current && (globalMostRecentFallbackTime = now()) - : newProps && !current && (globalMostRecentFallbackTime = now())); - if (flags & 4) { - try { - if (null !== finishedWork.memoizedState) { - var suspenseCallback = finishedWork.memoizedProps.suspenseCallback; - if ("function" === typeof suspenseCallback) { - var retryQueue = finishedWork.updateQueue; - null !== retryQueue && suspenseCallback(new Set(retryQueue)); - } - } - } catch (error$115) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$115); - } - flags = finishedWork.updateQueue; - null !== flags && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, flags)); - } - break; - case 22: - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - suspenseCallback = null !== finishedWork.memoizedState; - retryQueue = null !== current && null !== current.memoizedState; - if (finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - } else recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - root = finishedWork.stateNode; - root._current = finishedWork; - root._visibility &= -3; - root._visibility |= root._pendingVisibility & 2; - if ( - flags & 8192 && - ((root._visibility = suspenseCallback - ? root._visibility & -2 - : root._visibility | 1), - suspenseCallback && - ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), - null === current || - retryQueue || - root || - (0 !== (finishedWork.mode & 1) && - recursivelyTraverseDisappearLayoutEffects(finishedWork))), - null === finishedWork.memoizedProps || - "manual" !== finishedWork.memoizedProps.mode) - ) - a: for (current = null, root = finishedWork; ; ) { - if (5 === root.tag) { - if (null === current) { - current = root; - try { - if (((newProps = root.stateNode), suspenseCallback)) - newProps.hide(); - else { - var props = root.memoizedProps; - (null == props.visible || props.visible) && - root.stateNode.show(); - } - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } - } - } else if ( - 6 !== root.tag && - ((22 !== root.tag && 23 !== root.tag) || - null === root.memoizedState || - root === finishedWork) && - null !== root.child - ) { - root.child.return = root; - root = root.child; - continue; - } - if (root === finishedWork) break a; - for (; null === root.sibling; ) { - if (null === root.return || root.return === finishedWork) break a; - current === root && (current = null); - root = root.return; - } - current === root && (current = null); - root.sibling.return = root.return; - root = root.sibling; - } - flags & 4 && - ((flags = finishedWork.updateQueue), - null !== flags && - ((current = flags.retryQueue), - null !== current && - ((flags.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, current)))); + popSuspenseHandler(interruptedWork); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((flags = finishedWork.updateQueue), - null !== flags && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, flags))); + pop(suspenseStackCursor); break; - case 21: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && - (null !== current && safelyDetachRef(finishedWork, finishedWork.return), - safelyAttachRef(finishedWork, finishedWork.return)); - flags & 4 && shim$1(); + case 10: + popProvider( + enableRenderableContext + ? interruptedWork.type + : interruptedWork.type._context + ); break; - default: - recursivelyTraverseMutationEffects(root, finishedWork), - commitReconciliationEffects(finishedWork); + case 22: + case 23: + popSuspenseHandler(interruptedWork); + popHiddenContext(); + popTransition(interruptedWork, current); + break; + case 24: + popProvider(CacheContext); + break; + case 25: + enableTransitionTracing && + null !== interruptedWork.stateNode && + enableTransitionTracing && + pop(markerInstanceStack); } } -function commitReconciliationEffects(finishedWork) { - var flags = finishedWork.flags; - if (flags & 2) { - try { - a: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var JSCompiler_inline_result = parent; - break a; - } - parent = parent.return; - } - throw Error(formatProdErrorMessage(160)); - } - switch (JSCompiler_inline_result.tag) { +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null; +function safelyAttachRef(current, nearestMountedAncestor) { + try { + var ref = current.ref; + if (null !== ref) { + var instance = current.stateNode; + switch (current.tag) { + case 26: case 27: case 5: - var parent$jscomp$0 = JSCompiler_inline_result.stateNode; - JSCompiler_inline_result.flags & 32 && - (JSCompiler_inline_result.flags &= -33); - var before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); - break; - case 3: - case 4: - var parent$105 = JSCompiler_inline_result.stateNode.containerInfo, - before$106 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - before$106, - parent$105 - ); + var instanceToUse = instance; break; default: - throw Error(formatProdErrorMessage(161)); + instanceToUse = instance; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + 21 === current.tag && (instanceToUse = instance); + "function" === typeof ref + ? (current.refCleanup = ref(instanceToUse)) + : (ref.current = instanceToUse); } - finishedWork.flags &= -3; + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); } - flags & 4096 && (finishedWork.flags &= -4097); } -function recursivelyTraverseLayoutEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 8772) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), - (parentFiber = parentFiber.sibling); +function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + refCleanup(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + ref(null); + } catch (error$101) { + captureCommitPhaseError(current, nearestMountedAncestor, error$101); + } + else ref.current = null; } -function recursivelyTraverseDisappearLayoutEffects(parentFiber) { - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedWork = parentFiber; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - commitHookEffectListUnmount(4, finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 1: - safelyDetachRef(finishedWork, finishedWork.return); - var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - var current$jscomp$0 = current; - instance.props = current$jscomp$0.memoizedProps; - instance.state = current$jscomp$0.memoizedState; - instance.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 26: - case 27: - case 5: - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 22: - safelyDetachRef(finishedWork, finishedWork.return); - null === finishedWork.memoizedState && - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - default: - recursivelyTraverseDisappearLayoutEffects(finishedWork); - } - parentFiber = parentFiber.sibling; +function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); } } -function recursivelyTraverseReappearLayoutEffects( - finishedRoot$jscomp$0, - parentFiber, - includeWorkInProgressEffects -) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitHookLayoutEffects(finishedWork, 4); - break; - case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +var focusedInstanceHandle = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = null; + for (nextEffect = firstChild; null !== nextEffect; ) { + root = nextEffect; + firstChild = root.deletions; + if (null !== firstChild) + for (var i = 0; i < firstChild.length; i++) + doesFiberContain(firstChild[i], focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + firstChild = root.child; + if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + root = nextEffect; + try { + var current = root.alternate, + flags = root.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === root.tag)) + a: { + if (null !== current) { + var oldState = current.memoizedState; + if (null === oldState || null !== oldState.dehydrated) { + var newState = root.memoizedState; + JSCompiler_temp = + null !== newState && null === newState.dehydrated; + break a; + } + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(root, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); } - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], instance); - } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 26: - case 27: - case 5: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 13: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - } - parentFiber = parentFiber.sibling; + switch (root.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = root.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + firstChild = 0; + firstChild < eventPayloads.length; + firstChild++ + ) { + var _eventPayloads$ii = eventPayloads[firstChild]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = root.stateNode, + snapshot = instance.getSnapshotBeforeUpdate( + root.elementType === root.type + ? prevProps + : resolveDefaultProps(root.type, prevProps), + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + break; + case 3: + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); + } + } catch (error) { + captureCommitPhaseError(root, root.return, error); + } + firstChild = root.sibling; + if (null !== firstChild) { + firstChild.return = root.return; + nextEffect = firstChild; + break; + } + nextEffect = root.return; + } } + current = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return current; } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor +) { + var updateQueue = finishedWork.updateQueue; + updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== updateQueue) { + var effect = (updateQueue = updateQueue.next); + do { + if ((effect.tag & flags) === flags) { + var inst = effect.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + effect = effect.next; + } while (effect !== updateQueue); + } +} +function commitHookEffectListMount(flags, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + if (null !== finishedWork) { + var effect = (finishedWork = finishedWork.next); + do { + if ((effect.tag & flags) === flags) { + var create = effect.create, + inst = effect.inst; + create = create(); + inst.destroy = create; + } + effect = effect.next; + } while (effect !== finishedWork); + } +} +function commitHookLayoutEffects(finishedWork, hookFlags) { try { commitHookEffectListMount(hookFlags, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } -function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { - var previousCache = null; - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (previousCache = current.memoizedState.cachePool.pool); - current = null; - null !== finishedWork.memoizedState && - null !== finishedWork.memoizedState.cachePool && - (current = finishedWork.memoizedState.cachePool.pool); - current !== previousCache && - (null != current && current.refCount++, - null != previousCache && releaseCache(previousCache)); - if (enableTransitionTracing) { - current = finishedWork.updateQueue; - previousCache = null !== finishedWork.memoizedState; - if (null !== current) { - if (previousCache) { - var transitions = current.transitions; - null !== transitions && - transitions.forEach(function (transition) { - null === instance._transitions && - (instance._transitions = new Set()); - instance._transitions.add(transition); - }); - current = current.markerInstances; - null !== current && - current.forEach(function (markerInstance) { - var markerTransitions = markerInstance.transitions; - null !== markerTransitions && - markerTransitions.forEach(function (transition) { - null === instance._transitions - ? (instance._transitions = new Set()) - : instance._transitions.has(transition) && - (null === markerInstance.pendingBoundaries && - (markerInstance.pendingBoundaries = new Map()), - null === instance._pendingMarkers && - (instance._pendingMarkers = new Set()), - instance._pendingMarkers.add(markerInstance)); - }); - }); - } - finishedWork.updateQueue = null; +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - commitTransitionProgress(finishedWork); - previousCache || - ((instance._transitions = null), (instance._pendingMarkers = null)); } } -function commitCachePassiveMountEffect(current, finishedWork) { - current = null; - null !== finishedWork.alternate && - (current = finishedWork.alternate.memoizedState.cache); - finishedWork = finishedWork.memoizedState.cache; - finishedWork !== current && - (finishedWork.refCount++, null != current && releaseCache(current)); -} -function commitTracingMarkerPassiveMountEffect(finishedWork) { - var instance = finishedWork.stateNode; - null !== instance.transitions && - null === instance.pendingBoundaries && - (addMarkerCompleteCallbackToPendingTransition( - finishedWork.memoizedProps.name, - instance.transitions - ), - (instance.transitions = null), - (instance.pendingBoundaries = null), - (instance.aborts = null), - (instance.name = null)); -} -function recursivelyTraversePassiveMountEffects( - root, - parentFiber, - committedLanes, - committedTransitions -) { - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveMountOnFiber( - root, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); -} -function commitPassiveMountOnFiber( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions -) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); - break; - case 3: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - if (flags & 2048) { - flags = null; - null !== finishedWork.alternate && - (flags = finishedWork.alternate.memoizedState.cache); - var nextCache = finishedWork.memoizedState.cache; - nextCache !== flags && - (nextCache.refCount++, null != flags && releaseCache(flags)); - if (enableTransitionTracing) { - var incompleteTransitions = - finishedWork.stateNode.incompleteTransitions; - null !== committedTransitions && - (committedTransitions.forEach(function (transition) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: [], - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionStart && - (currentPendingTransitionCallbacks.transitionStart = []), - currentPendingTransitionCallbacks.transitionStart.push( - transition - )); - }), - clearTransitionsForLanes(finishedRoot, committedLanes)); - incompleteTransitions.forEach(function (markerInstance, transition) { - var pendingBoundaries = markerInstance.pendingBoundaries; - if (null === pendingBoundaries || 0 === pendingBoundaries.size) - null === markerInstance.aborts && - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: [], - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionComplete && - (currentPendingTransitionCallbacks.transitionComplete = []), - currentPendingTransitionCallbacks.transitionComplete.push( - transition - )), - incompleteTransitions.delete(transition); - }); - clearTransitionsForLanes(finishedRoot, committedLanes); +function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { + var flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 4 && commitHookLayoutEffects(finishedWork, 5); + break; + case 1: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + try { + finishedRoot.componentDidMount(); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + else { + var prevProps = + finishedWork.elementType === finishedWork.type + ? current.memoizedProps + : resolveDefaultProps(finishedWork.type, current.memoizedProps); + current = current.memoizedState; + try { + finishedRoot.componentDidUpdate( + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } catch (error$102) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$102 + ); + } + } + flags & 64 && commitClassCallbacks(finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + break; + case 3: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { + finishedRoot = null; + if (null !== finishedWork.child) + switch (finishedWork.child.tag) { + case 27: + case 5: + finishedRoot = finishedWork.child.stateNode; + break; + case 1: + finishedRoot = finishedWork.child.stateNode; + } + try { + commitCallbacks(flags, finishedRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; - case 23: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); + case 26: + case 27: + case 5: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; - case 22: - nextCache = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - nextCache - ); + case 12: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; - case 24: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + case 13: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; - case 25: - if (enableTransitionTracing) { - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && commitTracingMarkerPassiveMountEffect(finishedWork); - break; - } - default: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } -} -function recursivelyTraverseReconnectPassiveEffects( - finishedRoot$jscomp$0, - parentFiber, - committedLanes$jscomp$0, - committedTransitions$jscomp$0, - includeWorkInProgressEffects -) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - committedLanes = committedLanes$jscomp$0, - committedTransitions = committedTransitions$jscomp$0, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - commitHookPassiveMountEffects(finishedWork, 8); - break; - case 23: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); - break; - case 22: - var instance$121 = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? instance$121._visibility & 4 - ? recursivelyTraverseReconnectPassiveEffects( + case 22: + if (0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( finishedRoot, finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork + 0 !== (finishedWork.subtreeFlags & 8772) ) - : ((instance$121._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((instance$121._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && + ("manual" === finishedWork.memoizedProps.mode + ? safelyAttachRef(finishedWork, finishedWork.return) + : safelyDetachRef(finishedWork, finishedWork.return)); + break; + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } +} +function abortRootTransitions( + root, + abort, + deletedTransitions, + deletedOffscreenInstance +) { + if (enableTransitionTracing) { + var rootTransitions = root.incompleteTransitions; + deletedTransitions.forEach(function (transition) { + rootTransitions.has(transition) && + ((transition = rootTransitions.get(transition)), + null === transition.aborts && (transition.aborts = []), + transition.aborts.push(abort), + null !== deletedOffscreenInstance && + null !== transition.pendingBoundaries && + transition.pendingBoundaries.has(deletedOffscreenInstance) && + transition.pendingBoundaries.delete(deletedOffscreenInstance)); + }); + } +} +function abortTracingMarkerTransitions( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree +) { + if (enableTransitionTracing) { + var markerInstance = abortedFiber.stateNode, + markerTransitions = markerInstance.transitions, + pendingBoundaries = markerInstance.pendingBoundaries; + null !== markerTransitions && + deletedTransitions.forEach(function (transition) { + if ( + null !== abortedFiber && + markerTransitions.has(transition) && + (null === markerInstance.aborts || + !markerInstance.aborts.includes(abort)) && + null !== markerInstance.transitions + ) { + if (null === markerInstance.aborts) { + markerInstance.aborts = [abort]; + transition = abortedFiber.memoizedProps.name; + var transitions = markerInstance.transitions, + aborts = markerInstance.aborts; + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: new Map(), + markerComplete: null + }), + null === currentPendingTransitionCallbacks.markerIncomplete && + (currentPendingTransitionCallbacks.markerIncomplete = + new Map()), + currentPendingTransitionCallbacks.markerIncomplete.set( + transition, + { transitions: transitions, aborts: aborts } + )); + } else markerInstance.aborts.push(abort); + null !== deletedOffscreenInstance && + !isInDeletedTree && + null !== pendingBoundaries && + pendingBoundaries.has(deletedOffscreenInstance) && + (pendingBoundaries.delete(deletedOffscreenInstance), + addMarkerProgressCallbackToPendingTransition( + abortedFiber.memoizedProps.name, + deletedTransitions, + pendingBoundaries )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - instance$121 - ); - break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - case 25: - if (enableTransitionTracing) { - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitTracingMarkerPassiveMountEffect(finishedWork); - break; } - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - } - parentFiber = parentFiber.sibling; + }); } } -function recursivelyTraverseAtomicPassiveEffects( - finishedRoot$jscomp$0, - parentFiber +function abortParentMarkerTransitionsForDeletedFiber( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree ) { - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + if (enableTransitionTracing) + for (; null !== abortedFiber; ) { + switch (abortedFiber.tag) { + case 25: + abortTracingMarkerTransitions( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree + ); break; - default: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + case 3: + abortRootTransitions( + abortedFiber.stateNode, + abort, + deletedTransitions, + deletedOffscreenInstance + ); } - parentFiber = parentFiber.sibling; + abortedFiber = abortedFiber.return; + } +} +function commitTransitionProgress(offscreenFiber) { + if (enableTransitionTracing) { + var offscreenInstance = offscreenFiber.stateNode, + prevState = null, + previousFiber = offscreenFiber.alternate; + null !== previousFiber && + null !== previousFiber.memoizedState && + (prevState = previousFiber.memoizedState); + prevState = null !== prevState; + previousFiber = null !== offscreenFiber.memoizedState; + var pendingMarkers = offscreenInstance._pendingMarkers, + name = null; + offscreenFiber = offscreenFiber.return; + null !== offscreenFiber && + 13 === offscreenFiber.tag && + offscreenFiber.memoizedProps.unstable_name && + (name = offscreenFiber.memoizedProps.unstable_name); + !prevState && previousFiber + ? null !== pendingMarkers && + pendingMarkers.forEach(function (markerInstance) { + var pendingBoundaries = markerInstance.pendingBoundaries, + transitions = markerInstance.transitions, + markerName = markerInstance.name; + null === pendingBoundaries || + pendingBoundaries.has(offscreenInstance) || + (pendingBoundaries.set(offscreenInstance, { name: name }), + null !== transitions && + (1 === markerInstance.tag && null !== markerName + ? addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries + ) + : 0 === markerInstance.tag && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }) + : prevState && + !previousFiber && + null !== pendingMarkers && + pendingMarkers.forEach(function (markerInstance) { + var pendingBoundaries = markerInstance.pendingBoundaries, + transitions = markerInstance.transitions, + markerName = markerInstance.name; + null !== pendingBoundaries && + pendingBoundaries.has(offscreenInstance) && + (pendingBoundaries.delete(offscreenInstance), + null !== transitions && + (1 === markerInstance.tag && null !== markerName + ? (addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries + ), + 0 === pendingBoundaries.size && + (null === markerInstance.aborts && + addMarkerCompleteCallbackToPendingTransition( + markerName, + transitions + ), + (markerInstance.transitions = null), + (markerInstance.pendingBoundaries = null), + (markerInstance.aborts = null))) + : 0 === markerInstance.tag && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }); + } +} +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; +} +function isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); } + if (!(fiber.flags & 2)) return fiber.stateNode; + } } -var suspenseyCommitFlag = 8192; -function recursivelyAccumulateSuspenseyCommit(parentFiber) { - if (parentFiber.subtreeFlags & suspenseyCommitFlag) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - accumulateSuspenseyCommitOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); } -function accumulateSuspenseyCommitOnFiber(fiber) { - switch (fiber.tag) { +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var hostParent = null, + hostParentIsContainer = !1; +function recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + parent +) { + for (parent = parent.child; null !== parent; ) + commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), + (parent = parent.sibling); +} +function commitDeletionEffectsOnFiber( + finishedRoot, + nearestMountedAncestor, + deletedFiber +) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) + try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) {} + switch (deletedFiber.tag) { case 26: - recursivelyAccumulateSuspenseyCommit(fiber); - if (fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState) - throw Error(formatProdErrorMessage(442)); - break; + case 27: case 5: - recursivelyAccumulateSuspenseyCommit(fiber); + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor); + case 6: + var prevHostParent = hostParent, + prevHostParentIsContainer = hostParentIsContainer; + hostParent = null; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; + null !== hostParent && + ((deletedFiber = deletedFiber.stateNode), + destroyEventListeners(deletedFiber), + deletedFiber.eject()); break; - case 3: - case 4: - recursivelyAccumulateSuspenseyCommit(fiber); + case 18: + finishedRoot = finishedRoot.hydrationCallbacks; + null !== finishedRoot && + (finishedRoot = finishedRoot.onDeleted) && + finishedRoot(deletedFiber.stateNode); + null !== hostParent && shim$2(); break; - case 22: - if (null === fiber.memoizedState) { - var current = fiber.alternate; - null !== current && null !== current.memoizedState - ? ((current = suspenseyCommitFlag), - (suspenseyCommitFlag = 16777216), - recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current)) - : recursivelyAccumulateSuspenseyCommit(fiber); - } + case 4: + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; + hostParent = deletedFiber.stateNode.containerInfo; + hostParentIsContainer = !0; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; break; - default: - recursivelyAccumulateSuspenseyCommit(fiber); - } -} -function detachAlternateSiblings(parentFiber) { - var previousFiber = parentFiber.alternate; - if ( - null !== previousFiber && - ((parentFiber = previousFiber.child), null !== parentFiber) - ) { - previousFiber.child = null; - do - (previousFiber = parentFiber.sibling), - (parentFiber.sibling = null), - (parentFiber = previousFiber); - while (null !== parentFiber); - } -} -function recursivelyTraversePassiveUnmountEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - } - detachAlternateSiblings(parentFiber); - } - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveUnmountOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); -} -function commitPassiveUnmountOnFiber(finishedWork) { - switch (finishedWork.tag) { case 0: case 11: + case 14: case 15: - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.flags & 2048 && - commitHookEffectListUnmount(9, finishedWork, finishedWork.return); + if ( + !offscreenSubtreeWasHidden && + ((prevHostParent = deletedFiber.updateQueue), + null !== prevHostParent && + ((prevHostParent = prevHostParent.lastEffect), + null !== prevHostParent)) + ) { + prevHostParentIsContainer = prevHostParent = prevHostParent.next; + do { + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, + destroy = inst.destroy; + void 0 !== destroy && + (0 !== (tag & 2) + ? ((inst.destroy = void 0), + safelyCallDestroy( + deletedFiber, + nearestMountedAncestor, + destroy + )) + : 0 !== (tag & 4) && + ((inst.destroy = void 0), + safelyCallDestroy( + deletedFiber, + nearestMountedAncestor, + destroy + ))); + prevHostParentIsContainer = prevHostParentIsContainer.next; + } while (prevHostParentIsContainer !== prevHostParent); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 1: + if ( + !offscreenSubtreeWasHidden && + (safelyDetachRef(deletedFiber, nearestMountedAncestor), + (prevHostParent = deletedFiber.stateNode), + "function" === typeof prevHostParent.componentWillUnmount) + ) + try { + (prevHostParent.props = deletedFiber.memoizedProps), + (prevHostParent.state = deletedFiber.memoizedState), + prevHostParent.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 21: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; case 22: - var instance = finishedWork.stateNode; - null !== finishedWork.memoizedState && - instance._visibility & 4 && - (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((instance._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(finishedWork)) - : recursivelyTraversePassiveUnmountEffects(finishedWork); + safelyDetachRef(deletedFiber, nearestMountedAncestor); + deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: - recursivelyTraversePassiveUnmountEffects(finishedWork); - } -} -function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - } - detachAlternateSiblings(parentFiber); - } - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - deletions = parentFiber; - switch (deletions.tag) { - case 0: - case 11: - case 15: - commitHookEffectListUnmount(8, deletions, deletions.return); - recursivelyTraverseDisconnectPassiveEffects(deletions); - break; - case 22: - i = deletions.stateNode; - i._visibility & 4 && - ((i._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(deletions)); - break; - default: - recursivelyTraverseDisconnectPassiveEffects(deletions); - } - parentFiber = parentFiber.sibling; - } -} -function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - deletedSubtreeRoot, - nearestMountedAncestor$jscomp$0 -) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookEffectListUnmount(8, fiber, nearestMountedAncestor); - break; - case 23: - case 22: - null !== fiber.memoizedState && - null !== fiber.memoizedState.cachePool && - ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), - null != nearestMountedAncestor && nearestMountedAncestor.refCount++); - break; - case 13: - if (enableTransitionTracing) { - var offscreenFiber = fiber.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: fiber.memoizedProps.unstable_name || null - }; - if ( - null === fiber.memoizedState || - null === fiber.memoizedState.dehydrated - ) - abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(fiber.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = fiber.stateNode.transitions), - null !== offscreenFiber && - ((instance = { reason: "marker", name: fiber.memoizedProps.name }), - abortParentMarkerTransitionsForDeletedFiber( - fiber, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - instance, - offscreenFiber, - null, - !1 - ))); - } - nearestMountedAncestor = fiber.child; - if (null !== nearestMountedAncestor) - (nearestMountedAncestor.return = fiber), - (nextEffect = nearestMountedAncestor); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - nearestMountedAncestor = nextEffect; - offscreenFiber = nearestMountedAncestor.sibling; - instance = nearestMountedAncestor.return; - detachFiberAfterEffects(nearestMountedAncestor); - if (nearestMountedAncestor === fiber) { - nextEffect = null; - break a; - } - if (null !== offscreenFiber) { - offscreenFiber.return = instance; - nextEffect = offscreenFiber; - break a; - } - nextEffect = instance; - } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); } } -var DefaultCacheDispatcher = { - getCacheSignal: function () { - return readContext(CacheContext).controller.signal; - }, - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } - }, - PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, - ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, - ReactCurrentCache = ReactSharedInternals.ReactCurrentCache, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig, - executionContext = 0, - workInProgressRoot = null, - workInProgress = null, - workInProgressRootRenderLanes = 0, - workInProgressSuspendedReason = 0, - workInProgressThrownValue = null, - workInProgressRootDidAttachPingListener = !1, - entangledRenderLanes = 0, - workInProgressRootExitStatus = 0, - workInProgressRootFatalError = null, - workInProgressRootSkippedLanes = 0, - workInProgressRootInterleavedUpdatedLanes = 0, - workInProgressRootPingedLanes = 0, - workInProgressDeferredLane = 0, - workInProgressRootConcurrentErrors = null, - workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, - globalMostRecentFallbackTime = 0, - workInProgressRootRenderTargetTime = Infinity, - workInProgressTransitions = null, - currentPendingTransitionCallbacks = null, - currentEndTime = null; -function addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries -) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: new Map(), - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.markerProgress && - (currentPendingTransitionCallbacks.markerProgress = new Map()), - currentPendingTransitionCallbacks.markerProgress.set(markerName, { - pendingBoundaries: pendingBoundaries, - transitions: transitions - })); -} -function addMarkerCompleteCallbackToPendingTransition(markerName, transitions) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: new Map() - }), - null === currentPendingTransitionCallbacks.markerComplete && - (currentPendingTransitionCallbacks.markerComplete = new Map()), - currentPendingTransitionCallbacks.markerComplete.set( - markerName, - transitions - )); -} -function addTransitionProgressCallbackToPendingTransition( - transition, - boundaries -) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: new Map(), - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionProgress && - (currentPendingTransitionCallbacks.transitionProgress = new Map()), - currentPendingTransitionCallbacks.transitionProgress.set( - transition, - boundaries - )); +function getRetryCache(finishedWork) { + switch (finishedWork.tag) { + case 13: + case 19: + var retryCache = finishedWork.stateNode; + null === retryCache && + (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + return retryCache; + case 22: + return ( + (finishedWork = finishedWork.stateNode), + (retryCache = finishedWork._retryCache), + null === retryCache && + (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), + retryCache + ); + default: + throw Error(formatProdErrorMessage(435, finishedWork.tag)); + } } -var hasUncaughtError = !1, - firstUncaughtError = null, - legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, - pendingPassiveTransitions = null, - nestedUpdateCount = 0, - rootWithNestedUpdates = null; -function requestUpdateLane(fiber) { - if (0 === (fiber.mode & 1)) return 2; - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== requestCurrentTransition()) - return ( - (fiber = currentEntangledLane), - 0 !== fiber ? fiber : requestTransitionLane() - ); - fiber = currentUpdatePriority; - return 0 !== fiber ? fiber : 32; +function detachOffscreenInstance(instance) { + var fiber = instance._current; + if (null === fiber) throw Error(formatProdErrorMessage(456)); + if (0 === (instance._pendingVisibility & 2)) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && + ((instance._pendingVisibility |= 2), + scheduleUpdateOnFiber(root, fiber, 2)); + } } -function requestDeferredLane() { - 0 === workInProgressDeferredLane && - (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & 536870912) - ? 536870912 - : claimNextTransitionLane()); - var suspenseHandler = suspenseHandlerStackCursor.current; - null !== suspenseHandler && (suspenseHandler.flags |= 32); - return workInProgressDeferredLane; +function attachOffscreenInstance(instance) { + var fiber = instance._current; + if (null === fiber) throw Error(formatProdErrorMessage(456)); + if (0 !== (instance._pendingVisibility & 2)) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && + ((instance._pendingVisibility &= -3), + scheduleUpdateOnFiber(root, fiber, 2)); + } } -function scheduleUpdateOnFiber(root, fiber, lane) { - if ( - (root === workInProgressRoot && 2 === workInProgressSuspendedReason) || - null !== root.cancelPendingCommit - ) - prepareFreshStack(root, 0), - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane - ); - markRootUpdated(root, lane); - if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if (enableTransitionTracing) { - var transition = ReactCurrentBatchConfig.transition; - if ( - null !== transition && - null != transition.name && - (-1 === transition.startTime && (transition.startTime = now()), - enableTransitionTracing) - ) { - var transitionLanesMap = root.transitionLanes, - index$7 = 31 - clz32(lane), - transitions = transitionLanesMap[index$7]; - null === transitions && (transitions = new Set()); - transitions.add(transition); - transitionLanesMap[index$7] = transitions; +function attachSuspenseRetryListeners(finishedWork, wakeables) { + var retryCache = getRetryCache(finishedWork); + wakeables.forEach(function (wakeable) { + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + retryCache.has(wakeable) || + (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); +} +function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { + var deletions = parentFiber.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + var root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + } + parent = parent.return; + } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); } } - root === workInProgressRoot && - (0 === (executionContext & 2) && - (workInProgressRootInterleavedUpdatedLanes |= lane), - 4 === workInProgressRootExitStatus && - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane - )); - ensureRootIsScheduled(root); - 2 === lane && - 0 === executionContext && - 0 === (fiber.mode & 1) && - ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(!0)); - } + if (parentFiber.subtreeFlags & 12854) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), + (parentFiber = parentFiber.sibling); } -function performConcurrentWorkOnRoot(root, didTimeout) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; +function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + try { + commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - ))); + try { + commitHookEffectListUnmount(5, finishedWork, finishedWork.return); + } catch (error$110) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$110); + } + } + break; + case 1: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + flags & 64 && + offscreenSubtreeIsHidden && + ((finishedWork = finishedWork.updateQueue), + null !== finishedWork && + ((flags = finishedWork.callbacks), + null !== flags && + ((current = finishedWork.shared.hiddenCallbacks), + (finishedWork.shared.hiddenCallbacks = + null === current ? flags : current.concat(flags))))); + break; + case 26: + case 27: + case 5: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { + var newProps = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : newProps; + finishedWork.updateQueue = null; + try { + flags._applyProps(flags, newProps, current); + } catch (error$113) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$113); + } + } + break; + case 6: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4 && null === finishedWork.stateNode) + throw Error(formatProdErrorMessage(162)); + break; + case 3: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 4: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 13: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + finishedWork.child.flags & 8192 && + ((newProps = null !== finishedWork.memoizedState), + (current = null !== current && null !== current.memoizedState), + alwaysThrottleRetries + ? newProps !== current && (globalMostRecentFallbackTime = now()) + : newProps && !current && (globalMostRecentFallbackTime = now())); + if (flags & 4) { + try { + if (null !== finishedWork.memoizedState) { + var suspenseCallback = finishedWork.memoizedProps.suspenseCallback; + if ("function" === typeof suspenseCallback) { + var retryQueue = finishedWork.updateQueue; + null !== retryQueue && suspenseCallback(new Set(retryQueue)); + } + } + } catch (error$115) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$115); } - if (1 === exitStatus) - throw ( - ((originalCallbackNode = workInProgressRootFatalError), - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - originalCallbackNode) - ); - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane + flags = finishedWork.updateQueue; + null !== flags && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, flags)); + } + break; + case 22: + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; + if (finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + root = finishedWork.stateNode; + root._current = finishedWork; + root._visibility &= -3; + root._visibility |= root._pendingVisibility & 2; + if ( + flags & 8192 && + ((root._visibility = suspenseCallback + ? root._visibility & -2 + : root._visibility | 1), + suspenseCallback && + ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), + null === current || + retryQueue || + root || + (0 !== (finishedWork.mode & 1) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), + null === finishedWork.memoizedProps || + "manual" !== finishedWork.memoizedProps.mode) + ) + a: for (current = null, root = finishedWork; ; ) { + if (5 === root.tag) { + if (null === current) { + current = root; + try { + if (((newProps = root.stateNode), suspenseCallback)) + newProps.hide(); + else { + var props = root.memoizedProps; + (null == props.visible || props.visible) && + root.stateNode.show(); + } + } catch (error) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error ); - break a; } - break; - case 2: - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); - } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) + } + } else if ( + 6 !== root.tag && + ((22 !== root.tag && 23 !== root.tag) || + null === root.memoizedState || + root === finishedWork) && + null !== root.child ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; + root.child.return = root; + root = root.child; + continue; } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ); + if (root === finishedWork) break a; + for (; null === root.sibling; ) { + if (null === root.return || root.return === finishedWork) break a; + current === root && (current = null); + root = root.return; + } + current === root && (current = null); + root.sibling.return = root.return; + root = root.sibling; } - } + flags & 4 && + ((flags = finishedWork.updateQueue), + null !== flags && + ((current = flags.retryQueue), + null !== current && + ((flags.retryQueue = null), + attachSuspenseRetryListeners(finishedWork, current)))); break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - JSCompiler_inline_result; - (JSCompiler_inline_result = root.current.memoizedState.isDehydrated) && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !JSCompiler_inline_result) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; -} -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} -function commitRootWhenReady( - root, - finishedWork, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane -) { - 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); + case 19: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((flags = finishedWork.updateQueue), + null !== flags && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, flags))); + break; + case 21: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + (null !== current && safelyDetachRef(finishedWork, finishedWork.return), + safelyAttachRef(finishedWork, finishedWork.return)); + flags & 4 && shim$1(); + break; + default: + recursivelyTraverseMutationEffects(root, finishedWork), + commitReconciliationEffects(finishedWork); + } } -function isRenderConsistentWithExternalStores(finishedWork) { - for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; +function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + if (flags & 2) { + try { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var JSCompiler_inline_result = parent; + break a; } + parent = parent.return; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); - else { - if (node === finishedWork) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === finishedWork) return !0; - node = node.return; + throw Error(formatProdErrorMessage(160)); } - node.sibling.return = node.return; - node = node.sibling; + switch (JSCompiler_inline_result.tag) { + case 27: + case 5: + var parent$jscomp$0 = JSCompiler_inline_result.stateNode; + JSCompiler_inline_result.flags & 32 && + (JSCompiler_inline_result.flags &= -33); + var before = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); + break; + case 3: + case 4: + var parent$105 = JSCompiler_inline_result.stateNode.containerInfo, + before$106 = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + before$106, + parent$105 + ); + break; + default: + throw Error(formatProdErrorMessage(161)); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } + finishedWork.flags &= -3; } - return !0; -} -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - enableInfiniteRenderLoopDetection && - (executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), - throwIfInfiniteUpdateLoopDetected()); -} -function markRootSuspended(root, suspendedLanes, spawnedLane) { - suspendedLanes &= ~workInProgressRootPingedLanes; - suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; - root.suspendedLanes |= suspendedLanes; - root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4; - expirationTimes[index$4] = -1; - lanes &= ~lane; - } - 0 !== spawnedLane && - markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); -} -function resetWorkInProgressStack() { - if (null !== workInProgress) { - if (0 === workInProgressSuspendedReason) - var interruptedWork = workInProgress.return; - else - (interruptedWork = workInProgress), - resetContextDependencies(), - resetHooksOnUnwind(interruptedWork), - (thenableState$1 = null), - (thenableIndexCounter$1 = 0), - (interruptedWork = workInProgress); - for (; null !== interruptedWork; ) - unwindInterruptedWork(interruptedWork.alternate, interruptedWork), - (interruptedWork = interruptedWork.return); - workInProgress = null; - } -} -function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; - var timeoutHandle = root.timeoutHandle; - -1 !== timeoutHandle && - ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); - timeoutHandle = root.cancelPendingCommit; - null !== timeoutHandle && - ((root.cancelPendingCommit = null), timeoutHandle()); - resetWorkInProgressStack(); - workInProgressRoot = root; - workInProgress = timeoutHandle = createWorkInProgress(root.current, null); - workInProgressRootRenderLanes = lanes; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressRootExitStatus = 0; - workInProgressRootFatalError = null; - workInProgressDeferredLane = - workInProgressRootPingedLanes = - workInProgressRootInterleavedUpdatedLanes = - workInProgressRootSkippedLanes = - 0; - workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = - null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); - var allEntangledLanes = root.entangledLanes; - if (0 !== allEntangledLanes) - for ( - root = root.entanglements, allEntangledLanes &= lanes; - 0 < allEntangledLanes; - - ) { - var index$2 = 31 - clz32(allEntangledLanes), - lane = 1 << index$2; - lanes |= root[index$2]; - allEntangledLanes &= ~lane; - } - entangledRenderLanes = lanes; - finishQueueingConcurrentUpdates(); - return timeoutHandle; -} -function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; - ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - ReactCurrentOwner.current = null; - thrownValue === SuspenseException - ? ((thrownValue = getSuspendedThenable()), - (root = suspenseHandlerStackCursor.current), - (workInProgressSuspendedReason = - (null !== root && - ((workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - root !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 3 - : 2)) - : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = 4)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? 8 - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); - workInProgressThrownValue = thrownValue; - null === workInProgress && - ((workInProgressRootExitStatus = 1), - (workInProgressRootFatalError = thrownValue)); -} -function pushDispatcher() { - var prevDispatcher = ReactCurrentDispatcher.current; - ReactCurrentDispatcher.current = ContextOnlyDispatcher; - return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; + flags & 4096 && (finishedWork.flags &= -4097); } -function pushCacheDispatcher() { - var prevCacheDispatcher = ReactCurrentCache.current; - ReactCurrentCache.current = DefaultCacheDispatcher; - return prevCacheDispatcher; +function recursivelyTraverseLayoutEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 8772) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), + (parentFiber = parentFiber.sibling); } -function renderDidSuspendDelayIfPossible() { - workInProgressRootExitStatus = 4; - (0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || - null === workInProgressRoot || - markRootSuspended( - workInProgressRoot, - workInProgressRootRenderLanes, - workInProgressDeferredLane - ); +function recursivelyTraverseDisappearLayoutEffects(parentFiber) { + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedWork = parentFiber; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + commitHookEffectListUnmount(4, finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 1: + safelyDetachRef(finishedWork, finishedWork.return); + var instance = finishedWork.stateNode; + if ("function" === typeof instance.componentWillUnmount) { + var current = finishedWork, + nearestMountedAncestor = finishedWork.return; + try { + var current$jscomp$0 = current; + instance.props = current$jscomp$0.memoizedProps; + instance.state = current$jscomp$0.memoizedState; + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 26: + case 27: + case 5: + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 22: + safelyDetachRef(finishedWork, finishedWork.return); + null === finishedWork.memoizedState && + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + default: + recursivelyTraverseDisappearLayoutEffects(finishedWork); + } + parentFiber = parentFiber.sibling; + } } -function renderRootSync(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevCacheDispatcher = pushCacheDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), - prepareFreshStack(root, lanes); - lanes = !1; - a: do - try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; - switch (workInProgressSuspendedReason) { - case 8: - resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; - break a; - case 3: - case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); +function recursivelyTraverseReappearLayoutEffects( + finishedRoot$jscomp$0, + parentFiber, + includeWorkInProgressEffects +) { + includeWorkInProgressEffects = + includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + commitHookLayoutEffects(finishedWork, 4); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + var instance = finishedWork.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + finishedRoot = finishedWork.updateQueue; + if (null !== finishedRoot) { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); } - } - workLoopSync(); - break; - } catch (thrownValue$129) { - handleThrow(root, thrownValue$129); + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 26: + case 27: + case 5: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 13: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); } - while (1); - lanes && root.shellSuspendCounter++; - resetContextDependencies(); - executionContext = prevExecutionContext; - ReactCurrentDispatcher.current = prevDispatcher; - ReactCurrentCache.current = prevCacheDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + parentFiber = parentFiber.sibling; + } } -function workLoopSync() { - for (; null !== workInProgress; ) performUnitOfWork(workInProgress); +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + try { + commitHookEffectListMount(hookFlags, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } -function renderRootConcurrent(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevCacheDispatcher = pushCacheDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); - a: do - try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - lanes = workInProgress; - var thrownValue = workInProgressThrownValue; - b: switch (workInProgressSuspendedReason) { - case 1: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 2: - if (isThenableResolved(thrownValue)) { - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - replaySuspendedUnitOfWork(lanes); - break; - } - lanes = function () { - 2 === workInProgressSuspendedReason && - workInProgressRoot === root && - (workInProgressSuspendedReason = 7); - ensureRootIsScheduled(root); - }; - thrownValue.then(lanes, lanes); - break a; - case 3: - workInProgressSuspendedReason = 7; - break a; - case 4: - workInProgressSuspendedReason = 5; - break a; - case 7: - isThenableResolved(thrownValue) - ? ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - replaySuspendedUnitOfWork(lanes)) - : ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); - break; - case 5: - switch (workInProgress.tag) { - case 5: - case 26: - case 27: - lanes = workInProgress; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - var sibling = lanes.sibling; - if (null !== sibling) workInProgress = sibling; - else { - var returnFiber = lanes.return; - null !== returnFiber - ? ((workInProgress = returnFiber), - completeUnitOfWork(returnFiber)) - : (workInProgress = null); - } - break b; - } - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 6: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 8: - resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; - break a; - default: - throw Error(formatProdErrorMessage(462)); - } +function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { + var previousCache = null; + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (previousCache = current.memoizedState.cachePool.pool); + current = null; + null !== finishedWork.memoizedState && + null !== finishedWork.memoizedState.cachePool && + (current = finishedWork.memoizedState.cachePool.pool); + current !== previousCache && + (null != current && current.refCount++, + null != previousCache && releaseCache(previousCache)); + if (enableTransitionTracing) { + current = finishedWork.updateQueue; + previousCache = null !== finishedWork.memoizedState; + if (null !== current) { + if (previousCache) { + var transitions = current.transitions; + null !== transitions && + transitions.forEach(function (transition) { + null === instance._transitions && + (instance._transitions = new Set()); + instance._transitions.add(transition); + }); + current = current.markerInstances; + null !== current && + current.forEach(function (markerInstance) { + var markerTransitions = markerInstance.transitions; + null !== markerTransitions && + markerTransitions.forEach(function (transition) { + null === instance._transitions + ? (instance._transitions = new Set()) + : instance._transitions.has(transition) && + (null === markerInstance.pendingBoundaries && + (markerInstance.pendingBoundaries = new Map()), + null === instance._pendingMarkers && + (instance._pendingMarkers = new Set()), + instance._pendingMarkers.add(markerInstance)); + }); + }); } - workLoopConcurrent(); - break; - } catch (thrownValue$131) { - handleThrow(root, thrownValue$131); + finishedWork.updateQueue = null; } - while (1); - resetContextDependencies(); - ReactCurrentDispatcher.current = prevDispatcher; - ReactCurrentCache.current = prevCacheDispatcher; - executionContext = prevExecutionContext; - if (null !== workInProgress) return 0; - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + commitTransitionProgress(finishedWork); + previousCache || + ((instance._transitions = null), (instance._pendingMarkers = null)); + } } -function workLoopConcurrent() { - for (; null !== workInProgress && !shouldYield(); ) - performUnitOfWork(workInProgress); +function commitCachePassiveMountEffect(current, finishedWork) { + current = null; + null !== finishedWork.alternate && + (current = finishedWork.alternate.memoizedState.cache); + finishedWork = finishedWork.memoizedState.cache; + finishedWork !== current && + (finishedWork.refCount++, null != current && releaseCache(current)); } -function performUnitOfWork(unitOfWork) { - var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); - ReactCurrentOwner.current = null; +function commitTracingMarkerPassiveMountEffect(finishedWork) { + var instance = finishedWork.stateNode; + null !== instance.transitions && + null === instance.pendingBoundaries && + (addMarkerCompleteCallbackToPendingTransition( + finishedWork.memoizedProps.name, + instance.transitions + ), + (instance.transitions = null), + (instance.pendingBoundaries = null), + (instance.aborts = null), + (instance.name = null)); } -function replaySuspendedUnitOfWork(unitOfWork) { - var current = unitOfWork.alternate; - switch (unitOfWork.tag) { - case 2: - unitOfWork.tag = 0; - case 15: +function recursivelyTraversePassiveMountEffects( + root, + parentFiber, + committedLanes, + committedTransitions +) { + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveMountOnFiber( + root, + parentFiber, + committedLanes, + committedTransitions + ), + (parentFiber = parentFiber.sibling); +} +function commitPassiveMountOnFiber( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions +) { + var flags = finishedWork.flags; + switch (finishedWork.tag) { case 0: - var Component = unitOfWork.type, - unresolvedProps = unitOfWork.pendingProps; - unresolvedProps = - unitOfWork.elementType === Component - ? unresolvedProps - : resolveDefaultProps(Component, unresolvedProps); - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current; - context = getMaskedContext(unitOfWork, context); - current = replayFunctionComponent( - current, - unitOfWork, - unresolvedProps, - Component, - context, - workInProgressRootRenderLanes + case 11: + case 15: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions ); + flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; - case 11: - Component = unitOfWork.type.render; - unresolvedProps = unitOfWork.pendingProps; - unresolvedProps = - unitOfWork.elementType === Component - ? unresolvedProps - : resolveDefaultProps(Component, unresolvedProps); - current = replayFunctionComponent( - current, - unitOfWork, - unresolvedProps, - Component, - unitOfWork.ref, - workInProgressRootRenderLanes + case 3: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + if (flags & 2048) { + flags = null; + null !== finishedWork.alternate && + (flags = finishedWork.alternate.memoizedState.cache); + var nextCache = finishedWork.memoizedState.cache; + nextCache !== flags && + (nextCache.refCount++, null != flags && releaseCache(flags)); + if (enableTransitionTracing) { + var incompleteTransitions = + finishedWork.stateNode.incompleteTransitions; + null !== committedTransitions && + (committedTransitions.forEach(function (transition) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: [], + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionStart && + (currentPendingTransitionCallbacks.transitionStart = []), + currentPendingTransitionCallbacks.transitionStart.push( + transition + )); + }), + clearTransitionsForLanes(finishedRoot, committedLanes)); + incompleteTransitions.forEach(function (markerInstance, transition) { + var pendingBoundaries = markerInstance.pendingBoundaries; + if (null === pendingBoundaries || 0 === pendingBoundaries.size) + null === markerInstance.aborts && + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: [], + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionComplete && + (currentPendingTransitionCallbacks.transitionComplete = []), + currentPendingTransitionCallbacks.transitionComplete.push( + transition + )), + incompleteTransitions.delete(transition); + }); + clearTransitionsForLanes(finishedRoot, committedLanes); + } + } + break; + case 23: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 22: + nextCache = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + nextCache + ); + break; + case 24: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions ); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; - case 5: - resetHooksOnUnwind(unitOfWork); + case 25: + if (enableTransitionTracing) { + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + flags & 2048 && commitTracingMarkerPassiveMountEffect(finishedWork); + break; + } default: - unwindInterruptedWork(current, unitOfWork), - (unitOfWork = workInProgress = - resetWorkInProgress(unitOfWork, entangledRenderLanes)), - (current = beginWork(current, unitOfWork, entangledRenderLanes)); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); } - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === current - ? completeUnitOfWork(unitOfWork) - : (workInProgress = current); - ReactCurrentOwner.current = null; } -function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { - resetContextDependencies(); - resetHooksOnUnwind(unitOfWork); - thenableState$1 = null; - thenableIndexCounter$1 = 0; - var returnFiber = unitOfWork.return; - try { - if ( - throwException( - root, - returnFiber, - unitOfWork, - thrownValue, - workInProgressRootRenderLanes - ) - ) { - workInProgressRootExitStatus = 1; - workInProgressRootFatalError = thrownValue; - workInProgress = null; - return; - } - } catch (error) { - if (null !== returnFiber) throw ((workInProgress = returnFiber), error); - workInProgressRootExitStatus = 1; - workInProgressRootFatalError = thrownValue; - workInProgress = null; - return; - } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; +function recursivelyTraverseReconnectPassiveEffects( + finishedRoot$jscomp$0, + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + includeWorkInProgressEffects +) { + includeWorkInProgressEffects = + includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + commitHookPassiveMountEffects(finishedWork, 8); + break; + case 23: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 22: + var instance$121 = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? instance$121._visibility & 4 + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ) + : finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((instance$121._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$121._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + instance$121 + ); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + case 25: + if (enableTransitionTracing) { + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitTracingMarkerPassiveMountEffect(finishedWork); + break; } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); -} -function completeUnitOfWork(unitOfWork) { - var completedWork = unitOfWork; - do { - unitOfWork = completedWork.return; - var next = completeWork( - completedWork.alternate, - completedWork, - entangledRenderLanes - ); - if (null !== next) { - workInProgress = next; - return; - } - completedWork = completedWork.sibling; - if (null !== completedWork) { - workInProgress = completedWork; - return; + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); } - workInProgress = completedWork = unitOfWork; - } while (null !== completedWork); - 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + parentFiber = parentFiber.sibling; + } } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane +function recursivelyTraverseAtomicPassiveEffects( + finishedRoot$jscomp$0, + parentFiber ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; - try { - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactCurrentBatchConfig.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + default: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + } + parentFiber = parentFiber.sibling; + } +} +var suspenseyCommitFlag = 8192; +function recursivelyAccumulateSuspenseyCommit(parentFiber) { + if (parentFiber.subtreeFlags & suspenseyCommitFlag) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + accumulateSuspenseyCommitOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); +} +function accumulateSuspenseyCommitOnFiber(fiber) { + switch (fiber.tag) { + case 26: + recursivelyAccumulateSuspenseyCommit(fiber); + if (fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState) + throw Error(formatProdErrorMessage(442)); + break; + case 5: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 3: + case 4: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 22: + if (null === fiber.memoizedState) { + var current = fiber.alternate; + null !== current && null !== current.memoizedState + ? ((current = suspenseyCommitFlag), + (suspenseyCommitFlag = 16777216), + recursivelyAccumulateSuspenseyCommit(fiber), + (suspenseyCommitFlag = current)) + : recursivelyAccumulateSuspenseyCommit(fiber); + } + break; + default: + recursivelyAccumulateSuspenseyCommit(fiber); } - return null; } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); - return null; - })); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactCurrentBatchConfig.transition; - ReactCurrentBatchConfig.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactCurrentBatchConfig.transition = transitions; - } else root.current = finishedWork; - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (transitions = { - digest: remainingLanes.digest, - componentStack: remainingLanes.stack - }), - renderPriorityLevel(remainingLanes.value, transitions); - if (hasUncaughtError) - throw ( - ((hasUncaughtError = !1), - (root = firstUncaughtError), - (firstUncaughtError = null), - root) - ); - 0 !== (pendingPassiveEffectsLanes & 3) && - 0 !== root.tag && - flushPassiveEffects(); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); - return null; +function detachAlternateSiblings(parentFiber) { + var previousFiber = parentFiber.alternate; + if ( + null !== previousFiber && + ((parentFiber = previousFiber.child), null !== parentFiber) + ) { + previousFiber.child = null; + do + (previousFiber = parentFiber.sibling), + (parentFiber.sibling = null), + (parentFiber = previousFiber); + while (null !== parentFiber); + } } -function releaseRootPooledCache(root, remainingLanes) { - 0 === (root.pooledCacheLanes &= remainingLanes) && - ((remainingLanes = root.pooledCache), - null != remainingLanes && - ((root.pooledCache = null), releaseCache(remainingLanes))); +function recursivelyTraversePassiveUnmountEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber + ); + } + detachAlternateSiblings(parentFiber); + } + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveUnmountOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); } -function flushPassiveEffects() { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig.transition, - previousPriority = currentUpdatePriority; - try { - return ( - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = renderPriority), - flushPassiveEffectsImpl() - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactCurrentBatchConfig.transition = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } +function commitPassiveUnmountOnFiber(finishedWork) { + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.flags & 2048 && + commitHookEffectListUnmount(9, finishedWork, finishedWork.return); + break; + case 22: + var instance = finishedWork.stateNode; + null !== finishedWork.memoizedState && + instance._visibility & 4 && + (null === finishedWork.return || 13 !== finishedWork.return.tag) + ? ((instance._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(finishedWork)) + : recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + default: + recursivelyTraversePassiveUnmountEffects(finishedWork); } - return !1; } -function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; - var transitions = pendingPassiveTransitions; - pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); - var prevExecutionContext = executionContext; - executionContext |= 4; - commitPassiveUnmountOnFiber(root.current); - commitPassiveMountOnFiber(root, root.current, lanes, transitions); - executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); - if (enableTransitionTracing) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, - prevRootTransitionCallbacks = root.transitionCallbacks, - prevEndTime = currentEndTime; - null !== prevPendingTransitionCallbacks && - null !== prevRootTransitionCallbacks && - null !== prevEndTime && - ((currentEndTime = currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - prevEndTime, - prevRootTransitionCallbacks +function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber ); - })); + } + detachAlternateSiblings(parentFiber); + } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + deletions = parentFiber; + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(8, deletions, deletions.return); + recursivelyTraverseDisconnectPassiveEffects(deletions); + break; + case 22: + i = deletions.stateNode; + i._visibility & 4 && + ((i._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(deletions)); + break; + default: + recursivelyTraverseDisconnectPassiveEffects(deletions); + } + parentFiber = parentFiber.sibling; } - if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) - try { - injectedHook.onPostCommitFiberRoot(rendererID, root); - } catch (err) {} - return !0; -} -function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); - null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } -function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { - if (3 === sourceFiber.tag) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); - else - for (; null !== nearestMountedAncestor; ) { - if (3 === nearestMountedAncestor.tag) { - captureCommitPhaseErrorOnRoot( - nearestMountedAncestor, - sourceFiber, - error - ); +function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + deletedSubtreeRoot, + nearestMountedAncestor$jscomp$0 +) { + for (; null !== nextEffect; ) { + var fiber = nextEffect, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(8, fiber, nearestMountedAncestor); break; - } else if (1 === nearestMountedAncestor.tag) { - var instance = nearestMountedAncestor.stateNode; - if ( - "function" === - typeof nearestMountedAncestor.type.getDerivedStateFromError || - ("function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance))) - ) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createClassErrorUpdate( - nearestMountedAncestor, - sourceFiber, - 2 - ); - nearestMountedAncestor = enqueueUpdate( - nearestMountedAncestor, - sourceFiber, - 2 - ); - null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), - ensureRootIsScheduled(nearestMountedAncestor)); - break; + case 23: + case 22: + null !== fiber.memoizedState && + null !== fiber.memoizedState.cachePool && + ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), + null != nearestMountedAncestor && nearestMountedAncestor.refCount++); + break; + case 13: + if (enableTransitionTracing) { + var offscreenFiber = fiber.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: fiber.memoizedProps.unstable_name || null + }; + if ( + null === fiber.memoizedState || + null === fiber.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - } - nearestMountedAncestor = nearestMountedAncestor.return; + break; + case 24: + releaseCache(fiber.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = fiber.stateNode.transitions), + null !== offscreenFiber && + ((instance = { reason: "marker", name: fiber.memoizedProps.name }), + abortParentMarkerTransitionsForDeletedFiber( + fiber, + instance, + offscreenFiber, + null, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); } + nearestMountedAncestor = fiber.child; + if (null !== nearestMountedAncestor) + (nearestMountedAncestor.return = fiber), + (nextEffect = nearestMountedAncestor); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + nearestMountedAncestor = nextEffect; + offscreenFiber = nearestMountedAncestor.sibling; + instance = nearestMountedAncestor.return; + detachFiberAfterEffects(nearestMountedAncestor); + if (nearestMountedAncestor === fiber) { + nextEffect = null; + break a; + } + if (null !== offscreenFiber) { + offscreenFiber.return = instance; + nextEffect = offscreenFiber; + break a; + } + nextEffect = instance; + } + } } -function attachPingListener(root, wakeable, lanes) { - var pingCache = root.pingCache; - if (null === pingCache) { - pingCache = root.pingCache = new PossiblyWeakMap(); - var threadIDs = new Set(); - pingCache.set(wakeable, threadIDs); - } else - (threadIDs = pingCache.get(wakeable)), - void 0 === threadIDs && - ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); - threadIDs.has(lanes) || - ((workInProgressRootDidAttachPingListener = !0), - threadIDs.add(lanes), - (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), - wakeable.then(root, root)); -} -function pingSuspendedRoot(root, wakeable, pingedLanes) { - var pingCache = root.pingCache; - null !== pingCache && pingCache.delete(wakeable); - root.pingedLanes |= root.suspendedLanes & pingedLanes; - enableInfiniteRenderLoopDetection && - (executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), - throwIfInfiniteUpdateLoopDetected()); - workInProgressRoot === root && - (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && - (4 === workInProgressRootExitStatus || - (3 === workInProgressRootExitStatus && - (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes && - 300 > now() - globalMostRecentFallbackTime) - ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); - ensureRootIsScheduled(root); -} -function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && - (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); - boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); - null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), - ensureRootIsScheduled(boundaryFiber)); +var DefaultCacheDispatcher = { + getCacheSignal: function () { + return readContext(CacheContext).controller.signal; + }, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentCache = ReactSharedInternals.ReactCurrentCache, + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + workInProgressSuspendedReason = 0, + workInProgressThrownValue = null, + workInProgressRootDidAttachPingListener = !1, + entangledRenderLanes = 0, + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootInterleavedUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + workInProgressDeferredLane = 0, + workInProgressRootConcurrentErrors = null, + workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + workInProgressTransitions = null, + currentPendingTransitionCallbacks = null, + currentEndTime = null; +function addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries +) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: new Map(), + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.markerProgress && + (currentPendingTransitionCallbacks.markerProgress = new Map()), + currentPendingTransitionCallbacks.markerProgress.set(markerName, { + pendingBoundaries: pendingBoundaries, + transitions: transitions + })); } -function retryDehydratedSuspenseBoundary(boundaryFiber) { - var suspenseState = boundaryFiber.memoizedState, - retryLane = 0; - null !== suspenseState && (retryLane = suspenseState.retryLane); - retryTimedOutBoundary(boundaryFiber, retryLane); +function addMarkerCompleteCallbackToPendingTransition(markerName, transitions) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: new Map() + }), + null === currentPendingTransitionCallbacks.markerComplete && + (currentPendingTransitionCallbacks.markerComplete = new Map()), + currentPendingTransitionCallbacks.markerComplete.set( + markerName, + transitions + )); } -function resolveRetryWakeable(boundaryFiber, wakeable) { - var retryLane = 0; - switch (boundaryFiber.tag) { - case 13: - var retryCache = boundaryFiber.stateNode; - var suspenseState = boundaryFiber.memoizedState; - null !== suspenseState && (retryLane = suspenseState.retryLane); - break; - case 19: - retryCache = boundaryFiber.stateNode; - break; - case 22: - retryCache = boundaryFiber.stateNode._retryCache; - break; - default: - throw Error(formatProdErrorMessage(314)); - } - null !== retryCache && retryCache.delete(wakeable); - retryTimedOutBoundary(boundaryFiber, retryLane); +function addTransitionProgressCallbackToPendingTransition( + transition, + boundaries +) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: new Map(), + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionProgress && + (currentPendingTransitionCallbacks.transitionProgress = new Map()), + currentPendingTransitionCallbacks.transitionProgress.set( + transition, + boundaries + )); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - enableInfiniteRenderLoopDetection && - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) +var hasUncaughtError = !1, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = !1, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveTransitions = null, + nestedUpdateCount = 0, + rootWithNestedUpdates = null; +function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 2; + if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) + return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (null !== requestCurrentTransition()) + return ( + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); + fiber = currentUpdatePriority; + return 0 !== fiber ? fiber : 32; } -var beginWork; -beginWork = function (current, workInProgress, renderLanes) { - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current - ) - didReceiveUpdate = !0; - else { +function requestDeferredLane() { + 0 === workInProgressDeferredLane && + (workInProgressDeferredLane = + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 + : claimNextTransitionLane()); + var suspenseHandler = suspenseHandlerStackCursor.current; + null !== suspenseHandler && (suspenseHandler.flags |= 32); + return workInProgressDeferredLane; +} +function scheduleUpdateOnFiber(root, fiber, lane) { + if ( + (root === workInProgressRoot && 2 === workInProgressSuspendedReason) || + null !== root.cancelPendingCommit + ) + prepareFreshStack(root, 0), + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane + ); + markRootUpdated(root, lane); + if (0 === (executionContext & 2) || root !== workInProgressRoot) { + if (enableTransitionTracing) { + var transition = ReactCurrentBatchConfig.transition; if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$7 = 31 - clz32(lane), + transitions = transitionLanesMap[index$7]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$7] = transitions; + } } - else didReceiveUpdate = !1; - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var context = getMaskedContext( - workInProgress, - contextStackCursor$1.current - ); - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - context, - renderLanes - ); - workInProgress.flags |= 1; - workInProgress.tag = 0; - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; - case 16: - Component = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - context = Component._init; - Component = context(Component._payload); - workInProgress.type = Component; - context = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (context) { - case 0: - workInProgress = updateFunctionComponent( - null, - workInProgress, - Component, - current, - renderLanes - ); - break a; - case 1: - workInProgress = updateClassComponent( - null, - workInProgress, - Component, - current, - renderLanes - ); - break a; - case 11: - workInProgress = updateForwardRef( - null, - workInProgress, - Component, - current, - renderLanes + root === workInProgressRoot && + (0 === (executionContext & 2) && + (workInProgressRootInterleavedUpdatedLanes |= lane), + 4 === workInProgressRootExitStatus && + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane + )); + ensureRootIsScheduled(root); + 2 === lane && + 0 === executionContext && + 0 === (fiber.mode & 1) && + ((workInProgressRootRenderTargetTime = now() + 500), + flushSyncWorkAcrossRoots_impl(!0)); + } +} +function performConcurrentWorkOnRoot(root, didTimeout) { + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var lanes = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes : 0 + ); + if (0 === lanes) return null; + var exitStatus = (didTimeout = + !includesBlockingLane(root, lanes) && + 0 === (lanes & root.expiredLanes) && + (disableSchedulerTimeoutInWorkLoop || !didTimeout)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); + if (0 !== exitStatus) { + var renderWasConcurrent = didTimeout; + do { + if (6 === exitStatus) markRootSuspended(root, lanes, 0); + else { + didTimeout = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(didTimeout) + ) { + exitStatus = renderRootSync(root, lanes); + renderWasConcurrent = !1; + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + var errorRetryLanes = getLanesToRetrySynchronouslyOnError( + root, + renderWasConcurrent + ); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), + (exitStatus = recoverFromConcurrentError( + root, + renderWasConcurrent, + errorRetryLanes + ))); + } + if (1 === exitStatus) + throw ( + ((originalCallbackNode = workInProgressRootFatalError), + prepareFreshStack(root, 0), + markRootSuspended(root, lanes, 0), + ensureRootIsScheduled(root), + originalCallbackNode) + ); + root.finishedWork = didTimeout; + root.finishedLanes = lanes; + a: { + renderWasConcurrent = root; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === exitStatus) && + ((exitStatus = globalMostRecentFallbackTime + 300 - now()), + 10 < exitStatus) + ) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane ); - break a; - case 14: - workInProgress = updateMemoComponent( - null, - workInProgress, - Component, - resolveDefaultProps(Component.type, current), - renderLanes + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + didTimeout, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane + ), + exitStatus ); break a; + } + commitRootWhenReady( + renderWasConcurrent, + didTimeout, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane + ); } - throw Error(formatProdErrorMessage(306, Component, "")); } - return workInProgress; - case 0: - return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), - updateFunctionComponent( - current, - workInProgress, - Component, - context, - renderLanes - ) - ); - case 1: - return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), - updateClassComponent( - current, - workInProgress, - Component, - context, - renderLanes - ) - ); - case 3: - pushHostRootContext(workInProgress); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - context = workInProgress.memoizedState; - Component = context.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - nextProps = workInProgress.memoizedState; - enableTransitionTracing && - push(transitionStack, workInProgressTransitions); - enableTransitionTracing && pushRootMarkerInstance(workInProgress); - var nextCache = nextProps.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== context.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - context = nextProps.element; - context === Component - ? (workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )) - : (reconcileChildren(current, workInProgress, context, renderLanes), - (workInProgress = workInProgress.child)); - return workInProgress; - case 26: - case 27: - case 5: - return ( - pushHostContext(workInProgress), - (context = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextCache = null !== current ? current.memoizedProps : null), - (Component = nextProps.children), - shouldSetTextContent(context, nextProps) - ? (Component = null) - : null !== nextCache && - shouldSetTextContent(context, nextCache) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((context = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue2 = context), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== context && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 6: - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (Component = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - )) - : reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 11: - return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), - updateForwardRef( - current, - workInProgress, - Component, - context, - renderLanes - ) - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: + break; + } while (1); + } + ensureRootIsScheduled(root); + scheduleTaskForRootDuringMicrotask(root, now()); + root = + root.callbackNode === originalCallbackNode + ? performConcurrentWorkOnRoot.bind(null, root) + : null; + return root; +} +function recoverFromConcurrentError( + root, + originallyAttemptedLanes, + errorRetryLanes +) { + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, + JSCompiler_inline_result; + (JSCompiler_inline_result = root.current.memoizedState.isDehydrated) && + (prepareFreshStack(root, errorRetryLanes).flags |= 256); + errorRetryLanes = renderRootSync(root, errorRetryLanes); + if (2 !== errorRetryLanes) { + if (workInProgressRootDidAttachPingListener && !JSCompiler_inline_result) return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), + (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), + 4 ); - case 12: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + root = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorsFromFirstAttempt; + null !== root && queueRecoverableErrors(root); + } + return errorRetryLanes; +} +function queueRecoverableErrors(errors) { + null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = errors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + errors ); - case 10: - a: { - Component = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - context = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = context.value; - pushProvider(workInProgress, Component, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if ( - nextProps.children === context.children && - !didPerformWorkStackCursor.current - ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; +} +function commitRootWhenReady( + root, + finishedWork, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane +) { + 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); +} +function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork; ; ) { + if (node.flags & 16384) { + var updateQueue = node.updateQueue; + if ( + null !== updateQueue && + ((updateQueue = updateQueue.stores), null !== updateQueue) + ) + for (var i = 0; i < updateQueue.length; i++) { + var check = updateQueue[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + } + updateQueue = node.child; + if (node.subtreeFlags & 16384 && null !== updateQueue) + (updateQueue.return = node), (node = updateQueue); + else { + if (node === finishedWork) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return !0; +} +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} +function markRootSuspended(root, suspendedLanes, spawnedLane) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4; + expirationTimes[index$4] = -1; + lanes &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); +} +function resetWorkInProgressStack() { + if (null !== workInProgress) { + if (0 === workInProgressSuspendedReason) + var interruptedWork = workInProgress.return; + else + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), + (thenableState$1 = null), + (thenableIndexCounter$1 = 0), + (interruptedWork = workInProgress); + for (; null !== interruptedWork; ) + unwindInterruptedWork(interruptedWork.alternate, interruptedWork), + (interruptedWork = interruptedWork.return); + workInProgress = null; + } +} +function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = 0; + var timeoutHandle = root.timeoutHandle; + -1 !== timeoutHandle && + ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); + timeoutHandle = root.cancelPendingCommit; + null !== timeoutHandle && + ((root.cancelPendingCommit = null), timeoutHandle()); + resetWorkInProgressStack(); + workInProgressRoot = root; + workInProgress = timeoutHandle = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = lanes; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + workInProgressRootDidAttachPingListener = !1; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressDeferredLane = + workInProgressRootPingedLanes = + workInProgressRootInterleavedUpdatedLanes = + workInProgressRootSkippedLanes = + 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = + null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; + 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + var allEntangledLanes = root.entangledLanes; + if (0 !== allEntangledLanes) + for ( + root = root.entanglements, allEntangledLanes &= lanes; + 0 < allEntangledLanes; + + ) { + var index$2 = 31 - clz32(allEntangledLanes), + lane = 1 << index$2; + lanes |= root[index$2]; + allEntangledLanes &= ~lane; + } + entangledRenderLanes = lanes; + finishQueueingConcurrentUpdates(); + return timeoutHandle; +} +function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + ReactCurrentOwner.current = null; + thrownValue === SuspenseException + ? ((thrownValue = getSuspendedThenable()), + (root = suspenseHandlerStackCursor.current), + (workInProgressSuspendedReason = + (null !== root && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + root !== shellBoundary)) || + 0 !== (workInProgressRootSkippedLanes & 134217727) || + 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? 3 + : 2)) + : thrownValue === SuspenseyCommitException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = 4)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? 8 + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); + workInProgressThrownValue = thrownValue; + null === workInProgress && + ((workInProgressRootExitStatus = 1), + (workInProgressRootFatalError = thrownValue)); +} +function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; +} +function pushCacheDispatcher() { + var prevCacheDispatcher = ReactCurrentCache.current; + ReactCurrentCache.current = DefaultCacheDispatcher; + return prevCacheDispatcher; +} +function renderDidSuspendDelayIfPossible() { + workInProgressRootExitStatus = 4; + (0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || + null === workInProgressRoot || + markRootSuspended( + workInProgressRoot, + workInProgressRootRenderLanes, + workInProgressDeferredLane + ); +} +function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevCacheDispatcher = pushCacheDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) + (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + prepareFreshStack(root, lanes); + lanes = !1; + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) { + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; + switch (workInProgressSuspendedReason) { + case 8: + resetWorkInProgressStack(); + workInProgressRootExitStatus = 6; + break a; + case 3: + case 2: + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + } + } + workLoopSync(); + break; + } catch (thrownValue$129) { + handleThrow(root, thrownValue$129); + } + while (1); + lanes && root.shellSuspendCounter++; + resetContextDependencies(); + executionContext = prevExecutionContext; + ReactCurrentDispatcher.current = prevDispatcher; + ReactCurrentCache.current = prevCacheDispatcher; + if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; +} +function workLoopSync() { + for (; null !== workInProgress; ) performUnitOfWork(workInProgress); +} +function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevCacheDispatcher = pushCacheDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) + (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, lanes); + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) { + lanes = workInProgress; + var thrownValue = workInProgressThrownValue; + b: switch (workInProgressSuspendedReason) { + case 1: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 2: + if (isThenableResolved(thrownValue)) { + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + replaySuspendedUnitOfWork(lanes); + break; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren( - current, - workInProgress, - context.children, - renderLanes - ); - workInProgress = workInProgress.child; + lanes = function () { + 2 === workInProgressSuspendedReason && + workInProgressRoot === root && + (workInProgressSuspendedReason = 7); + ensureRootIsScheduled(root); + }; + thrownValue.then(lanes, lanes); + break a; + case 3: + workInProgressSuspendedReason = 7; + break a; + case 4: + workInProgressSuspendedReason = 5; + break a; + case 7: + isThenableResolved(thrownValue) + ? ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + replaySuspendedUnitOfWork(lanes)) + : ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, lanes, thrownValue)); + break; + case 5: + switch (workInProgress.tag) { + case 5: + case 26: + case 27: + lanes = workInProgress; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + var sibling = lanes.sibling; + if (null !== sibling) workInProgress = sibling; + else { + var returnFiber = lanes.return; + null !== returnFiber + ? ((workInProgress = returnFiber), + completeUnitOfWork(returnFiber)) + : (workInProgress = null); + } + break b; + } + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 6: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 8: + resetWorkInProgressStack(); + workInProgressRootExitStatus = 6; + break a; + default: + throw Error(formatProdErrorMessage(462)); + } } - return workInProgress; - case 9: - return ( - (context = enableRenderableContext - ? workInProgress.type._context - : workInProgress.type), - (Component = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), - (context = readContext(context)), - (Component = Component(context)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 14: - return ( - (Component = workInProgress.type), - (context = resolveDefaultProps(Component, workInProgress.pendingProps)), - (context = resolveDefaultProps(Component.type, context)), - updateMemoComponent( - current, - workInProgress, - Component, - context, - renderLanes - ) - ); + workLoopConcurrent(); + break; + } catch (thrownValue$131) { + handleThrow(root, thrownValue$131); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher.current = prevDispatcher; + ReactCurrentCache.current = prevCacheDispatcher; + executionContext = prevExecutionContext; + if (null !== workInProgress) return 0; + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; +} +function workLoopConcurrent() { + for (; null !== workInProgress && !shouldYield(); ) + performUnitOfWork(workInProgress); +} +function performUnitOfWork(unitOfWork) { + var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); + ReactCurrentOwner.current = null; +} +function replaySuspendedUnitOfWork(unitOfWork) { + var current = unitOfWork.alternate; + switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: - return updateSimpleMemoComponent( + case 0: + var Component = unitOfWork.type, + unresolvedProps = unitOfWork.pendingProps; + unresolvedProps = + unitOfWork.elementType === Component + ? unresolvedProps + : resolveDefaultProps(Component, unresolvedProps); + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor$1.current; + context = getMaskedContext(unitOfWork, context); + current = replayFunctionComponent( current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(Component) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, context), - mountClassInstance(workInProgress, Component, context, renderLanes), - finishClassComponent( - null, - workInProgress, - Component, - !0, - current, - renderLanes - ) + unitOfWork, + unresolvedProps, + Component, + context, + workInProgressRootRenderLanes ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 21: - return ( - (Component = workInProgress.pendingProps.children), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child + break; + case 11: + Component = unitOfWork.type.render; + unresolvedProps = unitOfWork.pendingProps; + unresolvedProps = + unitOfWork.elementType === Component + ? unresolvedProps + : resolveDefaultProps(Component, unresolvedProps); + current = replayFunctionComponent( + current, + unitOfWork, + unresolvedProps, + Component, + unitOfWork.ref, + workInProgressRootRenderLanes ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 23: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + break; + case 5: + resetHooksOnUnwind(unitOfWork); + default: + unwindInterruptedWork(current, unitOfWork), + (unitOfWork = workInProgress = + resetWorkInProgress(unitOfWork, entangledRenderLanes)), + (current = beginWork(current, unitOfWork, entangledRenderLanes)); + } + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === current + ? completeUnitOfWork(unitOfWork) + : (workInProgress = current); + ReactCurrentOwner.current = null; +} +function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { + resetContextDependencies(); + resetHooksOnUnwind(unitOfWork); + thenableState$1 = null; + thenableIndexCounter$1 = 0; + var returnFiber = unitOfWork.return; + try { + if ( + throwException( + root, + returnFiber, + unitOfWork, + thrownValue, + workInProgressRootRenderLanes + ) + ) { + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + return; + } + } catch (error) { + if (null !== returnFiber) throw ((workInProgress = returnFiber), error); + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + return; + } + if (unitOfWork.flags & 32768) + a: { + root = unitOfWork; + do { + unitOfWork = unwindWork(root.alternate, root); + if (null !== unitOfWork) { + unitOfWork.flags &= 32767; + workInProgress = unitOfWork; + break a; + } + root = root.return; + null !== root && + ((root.flags |= 32768), + (root.subtreeFlags = 0), + (root.deletions = null)); + workInProgress = root; + } while (null !== root); + workInProgressRootExitStatus = 6; + workInProgress = null; + } + else completeUnitOfWork(unitOfWork); +} +function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + unitOfWork = completedWork.return; + var next = completeWork( + completedWork.alternate, + completedWork, + entangledRenderLanes + ); + if (null !== next) { + workInProgress = next; + return; + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); +} +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig.transition; + try { + (ReactCurrentBatchConfig.transition = null), + (currentUpdatePriority = 2), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + previousUpdateLanePriority, + spawnedLane + ); + } finally { + (ReactCurrentBatchConfig.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + return null; +} +function commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + renderPriorityLevel, + spawnedLane +) { + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; + if (null === finishedWork) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + root.callbackNode = null; + root.callbackPriority = 0; + root.cancelPendingCommit = null; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || + rootDoesHavePassiveEffects || + ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(); + return null; + })); + transitions = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactCurrentBatchConfig.transition; + ReactCurrentBatchConfig.transition = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + ReactCurrentOwner.current = null; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + requestPaint(); + executionContext = prevExecutionContext; + currentUpdatePriority = spawnedLane; + ReactCurrentBatchConfig.transition = transitions; + } else root.current = finishedWork; + rootDoesHavePassiveEffects + ? ((rootDoesHavePassiveEffects = !1), + (rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root, remainingLanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root); + if (null !== recoverableErrors) + for ( + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) + (remainingLanes = recoverableErrors[finishedWork]), + (transitions = { + digest: remainingLanes.digest, + componentStack: remainingLanes.stack + }), + renderPriorityLevel(remainingLanes.value, transitions); + if (hasUncaughtError) + throw ( + ((hasUncaughtError = !1), + (root = firstUncaughtError), + (firstUncaughtError = null), + root) + ); + 0 !== (pendingPassiveEffectsLanes & 3) && + 0 !== root.tag && + flushPassiveEffects(); + remainingLanes = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(!1); + return null; +} +function releaseRootPooledCache(root, remainingLanes) { + 0 === (root.pooledCacheLanes &= remainingLanes) && + ((remainingLanes = root.pooledCache), + null != remainingLanes && + ((root.pooledCache = null), releaseCache(remainingLanes))); +} +function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var root = rootWithPendingPassiveEffects, + remainingLanes = pendingPassiveEffectsRemainingLanes; + pendingPassiveEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactCurrentBatchConfig.transition, + previousPriority = currentUpdatePriority; + try { return ( - prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), - null === current - ? ((context = peekCacheFromPool()), - null === context && - ((context = workInProgressRoot), - (nextProps = createCache()), - (context.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (context.pooledCacheLanes |= renderLanes), - (context = nextProps)), - (workInProgress.memoizedState = { - parent: Component, - cache: context - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, context)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (context = current.memoizedState), - (nextProps = workInProgress.memoizedState), - context.parent !== Component - ? ((context = { parent: Component, cache: Component }), - (workInProgress.memoizedState = context), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - context), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = nextProps.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== context.cache && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (ReactCurrentBatchConfig.transition = null), + (currentUpdatePriority = renderPriority), + flushPassiveEffectsImpl() ); - case 25: - if (enableTransitionTracing) - return ( - enableTransitionTracing - ? (null === current && - ((Component = enableTransitionTracing - ? transitionStack.current - : null), - null !== Component && - ((Component = { - tag: 1, - transitions: new Set(Component), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }), - (workInProgress.stateNode = Component), - (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - (workInProgress = workInProgress.child)) - : (workInProgress = null), - workInProgress + } finally { + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig.transition = prevTransition), + releaseRootPooledCache(root, remainingLanes); + } + } + return !1; +} +function flushPassiveEffectsImpl() { + if (null === rootWithPendingPassiveEffects) return !1; + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root = rootWithPendingPassiveEffects, + lanes = pendingPassiveEffectsLanes; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); + var prevExecutionContext = executionContext; + executionContext |= 4; + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); + executionContext = prevExecutionContext; + flushSyncWorkAcrossRoots_impl(!1); + if (enableTransitionTracing) { + var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, + prevRootTransitionCallbacks = root.transitionCallbacks, + prevEndTime = currentEndTime; + null !== prevPendingTransitionCallbacks && + null !== prevRootTransitionCallbacks && + null !== prevEndTime && + ((currentEndTime = currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + prevEndTime, + prevRootTransitionCallbacks ); + })); } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -}; + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) {} + return !0; +} +function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); + null !== rootFiber && + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); +} +function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + else + for (; null !== nearestMountedAncestor; ) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot( + nearestMountedAncestor, + sourceFiber, + error + ); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + if ( + "function" === + typeof nearestMountedAncestor.type.getDerivedStateFromError || + ("function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + ) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createClassErrorUpdate( + nearestMountedAncestor, + sourceFiber, + 2 + ); + nearestMountedAncestor = enqueueUpdate( + nearestMountedAncestor, + sourceFiber, + 2 + ); + null !== nearestMountedAncestor && + (markRootUpdated(nearestMountedAncestor, 2), + ensureRootIsScheduled(nearestMountedAncestor)); + break; + } + } + nearestMountedAncestor = nearestMountedAncestor.return; + } +} +function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else + (threadIDs = pingCache.get(wakeable)), + void 0 === threadIDs && + ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || + ((workInProgressRootDidAttachPingListener = !0), + threadIDs.add(lanes), + (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), + wakeable.then(root, root)); +} +function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); + workInProgressRoot === root && + (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && + (4 === workInProgressRootExitStatus || + (3 === workInProgressRootExitStatus && + (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes && + 300 > now() - globalMostRecentFallbackTime) + ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) + : (workInProgressRootPingedLanes |= pingedLanes)); + ensureRootIsScheduled(root); +} +function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && + (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); + boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + null !== boundaryFiber && + (markRootUpdated(boundaryFiber, retryLane), + ensureRootIsScheduled(boundaryFiber)); +} +function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); +} +function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + case 22: + retryCache = boundaryFiber.stateNode._retryCache; + break; + default: + throw Error(formatProdErrorMessage(314)); + } + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); +} +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + executionContext & 2 && + null !== workInProgressRoot && + (workInProgressRoot.errorRecoveryDisabledLanes |= + workInProgressRootRenderLanes), + Error(formatProdErrorMessage(185))) + ); +} function scheduleCallback(priorityLevel, callback) { return scheduleCallback$3(priorityLevel, callback); } @@ -10600,7 +10597,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-classic-988117e8", + version: "18.3.0-www-classic-9b508310", rendererPackageName: "react-art" }; var internals$jscomp$inline_1320 = { @@ -10631,7 +10628,7 @@ var internals$jscomp$inline_1320 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-988117e8" + reconcilerVersion: "18.3.0-www-classic-9b508310" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1321 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 163bd63eb5395..71abfe1022d2c 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -5359,4407 +5359,4404 @@ function attemptEarlyBailoutIfNoScheduledUpdate( } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null; -function resetContextDependencies() { - lastFullyObservedContext = - lastContextDependency = - currentlyRenderingFiber = - null; -} -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2); - context._currentValue2 = nextValue; -} -function popProvider(context) { - context._currentValue2 = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } -} -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if (current.memoizedProps !== workInProgress.pendingProps) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; } - null !== current && - propagateContextChanges( + else didReceiveUpdate = !1; + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, workInProgress, + Component, current, - renderLanes, - forcePropagateEntireTree + void 0, + renderLanes ); - workInProgress.flags |= 262144; - } -} -function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress, renderLanes) { - currentlyRenderingFiber = workInProgress; - lastFullyObservedContext = lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconcilation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - if (lastFullyObservedContext !== context) - if ( - ((context = { context: context, memoizedValue: value, next: null }), - null === lastContextDependency) - ) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$1 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); -} -var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; -function requestCurrentTransition() { - var transition = ReactCurrentBatchConfig$1.transition; - null !== transition && transition._callbacks.add(handleAsyncAction); - return transition; -} -function handleAsyncAction(transition, thenable) { - entangleAsyncAction(transition, thenable); -} -function notifyTransitionCallbacks(transition, returnValue) { - transition._callbacks.forEach(function (callback) { - return callback(transition, returnValue); - }); -} -var resumedCache = createCursor(null), - transitionStack = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition( - offscreenWorkInProgress, - prevCachePool, - newTransitions -) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); - enableTransitionTracing && - (null === transitionStack.current - ? push(transitionStack, newTransitions) - : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); -} -function popTransition(workInProgress, current) { - null !== current && - (enableTransitionTracing && pop(transitionStack), pop(resumedCache)); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; -} -var emptyObject = {}; -function collectScopedNodesFromChildren( - startingChild, - fn$jscomp$0, - scopedNodes$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - fn = fn$jscomp$0, - scopedNodes = scopedNodes$jscomp$0; - if (5 === node.tag) { - var type = node.type, - memoizedProps = node.memoizedProps, - instance = node.stateNode; - null !== instance && - !0 === fn(type, memoizedProps || emptyObject, instance) && - scopedNodes.push(instance); - } - type = node.child; - isFiberSuspenseAndTimedOut(node) && (type = node.child.sibling.child); - null !== type && collectScopedNodesFromChildren(type, fn, scopedNodes); - startingChild = startingChild.sibling; - } -} -function collectFirstScopedNodeFromChildren(startingChild, fn$jscomp$0) { - for (; null !== startingChild; ) { - a: { - var JSCompiler_inline_result = startingChild; - var fn = fn$jscomp$0; - if (5 === JSCompiler_inline_result.tag) { - var type = JSCompiler_inline_result.type, - memoizedProps = JSCompiler_inline_result.memoizedProps, - instance = JSCompiler_inline_result.stateNode; - if (null !== instance && !0 === fn(type, memoizedProps, instance)) { - JSCompiler_inline_result = instance; - break a; - } - } - type = JSCompiler_inline_result.child; - isFiberSuspenseAndTimedOut(JSCompiler_inline_result) && - (type = JSCompiler_inline_result.child.sibling.child); - JSCompiler_inline_result = - null !== type ? collectFirstScopedNodeFromChildren(type, fn) : null; - } - if (null !== JSCompiler_inline_result) return JSCompiler_inline_result; - startingChild = startingChild.sibling; - } - return null; -} -function collectNearestChildContextValues( - startingChild, - context$jscomp$0, - childContextValues$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - context = context$jscomp$0, - childContextValues = childContextValues$jscomp$0; - if ( - 10 === node.tag && - (enableRenderableContext ? node.type : node.type._context) === context - ) - childContextValues.push(node.memoizedProps.value); - else { - var child = node.child; - isFiberSuspenseAndTimedOut(node) && (child = node.child.sibling.child); - null !== child && - collectNearestChildContextValues(child, context, childContextValues); - } - startingChild = startingChild.sibling; - } -} -function DO_NOT_USE_queryAllNodes(fn) { - var currentFiber = shim$1(); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - var scopedNodes = []; - null !== currentFiber && - collectScopedNodesFromChildren(currentFiber, fn, scopedNodes); - return 0 === scopedNodes.length ? null : scopedNodes; -} -function DO_NOT_USE_queryFirstNode(fn) { - var currentFiber = shim$1(); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - return null !== currentFiber - ? collectFirstScopedNodeFromChildren(currentFiber, fn) - : null; -} -function containsNode() { - throw Error(formatProdErrorMessage(248)); -} -function getChildContextValues(context) { - var currentFiber = shim$1(); - if (null === currentFiber) return []; - currentFiber = currentFiber.child; - var childContextValues = []; - null !== currentFiber && - collectNearestChildContextValues(currentFiber, context, childContextValues); - return childContextValues; -} -function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); -} -function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { - switch (renderState.tailMode) { - case "hidden": - hasRenderedATailFallback = renderState.tail; - for (var lastTailNode = null; null !== hasRenderedATailFallback; ) - null !== hasRenderedATailFallback.alternate && - (lastTailNode = hasRenderedATailFallback), - (hasRenderedATailFallback = hasRenderedATailFallback.sibling); - null === lastTailNode - ? (renderState.tail = null) - : (lastTailNode.sibling = null); - break; - case "collapsed": - lastTailNode = renderState.tail; - for (var lastTailNode$78 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode), - (lastTailNode = lastTailNode.sibling); - null === lastTailNode$78 - ? hasRenderedATailFallback || null === renderState.tail - ? (renderState.tail = null) - : (renderState.tail.sibling = null) - : (lastTailNode$78.sibling = null); - } -} -function bubbleProperties(completedWork) { - var didBailout = - null !== completedWork.alternate && - completedWork.alternate.child === completedWork.child, - newChildLanes = 0, - subtreeFlags = 0; - if (didBailout) - for (var child$79 = completedWork.child; null !== child$79; ) - (newChildLanes |= child$79.lanes | child$79.childLanes), - (subtreeFlags |= child$79.subtreeFlags & 31457280), - (subtreeFlags |= child$79.flags & 31457280), - (child$79.return = completedWork), - (child$79 = child$79.sibling); - else - for (child$79 = completedWork.child; null !== child$79; ) - (newChildLanes |= child$79.lanes | child$79.childLanes), - (subtreeFlags |= child$79.subtreeFlags), - (subtreeFlags |= child$79.flags), - (child$79.return = completedWork), - (child$79 = child$79.sibling); - completedWork.subtreeFlags |= subtreeFlags; - completedWork.childLanes = newChildLanes; - return didBailout; -} -function completeWork(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - switch (workInProgress.tag) { - case 2: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return bubbleProperties(workInProgress), null; - case 1: - return bubbleProperties(workInProgress), null; - case 3: - return ( - (renderLanes = workInProgress.stateNode), - enableTransitionTracing && - null !== workInProgressTransitions && - (workInProgress.flags |= 2048), - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack), - enableTransitionTracing && pop(transitionStack), - popHostContainer(), - renderLanes.pendingContext && - ((renderLanes.context = renderLanes.pendingContext), - (renderLanes.pendingContext = null)), - (null !== current && null !== current.child) || - null === current || - (current.memoizedState.isDehydrated && - 0 === (workInProgress.flags & 256)) || - ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), - bubbleProperties(workInProgress), - enableTransitionTracing && - 0 !== (workInProgress.subtreeFlags & 8192) && - (workInProgress.flags |= 2048), - null - ); - case 26: - case 27: - case 5: - popHostContext(workInProgress); - renderLanes = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && (workInProgress.flags |= 4); - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - bubbleProperties(workInProgress); - return null; - } - switch (renderLanes) { - case TYPES.CLIPPING_RECTANGLE: - var instance = Mode$1.ClippingRectangle(); - instance._applyProps = applyClippingRectangleProps; - break; - case TYPES.GROUP: - instance = Mode$1.Group(); - instance._applyProps = applyGroupProps; - break; - case TYPES.SHAPE: - instance = Mode$1.Shape(); - instance._applyProps = applyShapeProps; - break; - case TYPES.TEXT: - (instance = Mode$1.Text( - newProps.children, - newProps.font, - newProps.alignment, - newProps.path - )), - (instance._applyProps = applyTextProps); - } - if (!instance) throw Error(formatProdErrorMessage(217, renderLanes)); - instance._applyProps(instance, newProps); - current = instance; - a: for (renderLanes = workInProgress.child; null !== renderLanes; ) { - if (5 === renderLanes.tag || 6 === renderLanes.tag) { - newProps = current; - instance = renderLanes.stateNode; - if ("string" === typeof instance) - throw Error(formatProdErrorMessage(216)); - instance.inject(newProps); - } else if (4 !== renderLanes.tag && null !== renderLanes.child) { - renderLanes.child.return = renderLanes; - renderLanes = renderLanes.child; - continue; - } - if (renderLanes === workInProgress) break a; - for (; null === renderLanes.sibling; ) { - if ( - null === renderLanes.return || - renderLanes.return === workInProgress - ) - break a; - renderLanes = renderLanes.return; - } - renderLanes.sibling.return = renderLanes.return; - renderLanes = renderLanes.sibling; - } - workInProgress.stateNode = current; - } - bubbleProperties(workInProgress); - workInProgress.flags &= -16777217; - return null; - case 6: - if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && (workInProgress.flags |= 4); - else { - if ("string" !== typeof newProps && null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - workInProgress.stateNode = newProps; - } - bubbleProperties(workInProgress); - return null; - case 13: - newProps = workInProgress.memoizedState; - if ( - null === current || - (null !== current.memoizedState && - null !== current.memoizedState.dehydrated) - ) { - if (null !== newProps && null !== newProps.dehydrated) { - if (null === current) { - throw Error(formatProdErrorMessage(318)); - throw Error(formatProdErrorMessage(344)); - } - 0 === (workInProgress.flags & 128) && - (workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - instance = !1; - } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), - (instance = !0); - if (!instance) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; + case 16: + Component = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var init = Component._init; + Component = init(Component._payload); + workInProgress.type = Component; + init = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (init) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error(formatProdErrorMessage(306, Component, "")); } - popSuspenseHandler(workInProgress); - if (0 !== (workInProgress.flags & 128)) - return (workInProgress.lanes = renderLanes), workInProgress; - renderLanes = null !== newProps; - current = null !== current && null !== current.memoizedState; - if (renderLanes) { - newProps = workInProgress.child; - instance = null; - null !== newProps.alternate && - null !== newProps.alternate.memoizedState && - null !== newProps.alternate.memoizedState.cachePool && - (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$83 = null; - null !== newProps.memoizedState && - null !== newProps.memoizedState.cachePool && - (cache$83 = newProps.memoizedState.cachePool.pool); - cache$83 !== instance && (newProps.flags |= 2048); - } - renderLanes !== current && - (enableTransitionTracing && (workInProgress.child.flags |= 2048), - renderLanes && (workInProgress.child.flags |= 8192)); - scheduleRetryEffect(workInProgress, workInProgress.updateQueue); - null !== workInProgress.updateQueue && - null != workInProgress.memoizedProps.suspenseCallback && - (workInProgress.flags |= 4); - bubbleProperties(workInProgress); - return null; - case 4: - return popHostContainer(), bubbleProperties(workInProgress), null; - case 10: + return workInProgress; + case 0: return ( - popProvider( - enableRenderableContext - ? workInProgress.type - : workInProgress.type._context - ), - bubbleProperties(workInProgress), - null + (Component = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === Component + ? init + : resolveDefaultProps(Component, init)), + updateFunctionComponent( + current, + workInProgress, + Component, + init, + renderLanes + ) ); - case 17: - return bubbleProperties(workInProgress), null; - case 19: - pop(suspenseStackCursor); - instance = workInProgress.memoizedState; - if (null === instance) return bubbleProperties(workInProgress), null; - newProps = 0 !== (workInProgress.flags & 128); - cache$83 = instance.rendering; - if (null === cache$83) - if (newProps) cutOffTailIfNeeded(instance, !1); - else { - if ( - 0 !== workInProgressRootExitStatus || - (null !== current && 0 !== (current.flags & 128)) - ) - for (current = workInProgress.child; null !== current; ) { - cache$83 = findFirstSuspended(current); - if (null !== cache$83) { - workInProgress.flags |= 128; - cutOffTailIfNeeded(instance, !1); - current = cache$83.updateQueue; - workInProgress.updateQueue = current; - scheduleRetryEffect(workInProgress, current); - workInProgress.subtreeFlags = 0; - current = renderLanes; - for (renderLanes = workInProgress.child; null !== renderLanes; ) - resetWorkInProgress(renderLanes, current), - (renderLanes = renderLanes.sibling); - push( - suspenseStackCursor, - (suspenseStackCursor.current & 1) | 2 - ); - return workInProgress.child; - } - current = current.sibling; - } - null !== instance.tail && - now() > workInProgressRootRenderTargetTime && - ((workInProgress.flags |= 128), - (newProps = !0), - cutOffTailIfNeeded(instance, !1), - (workInProgress.lanes = 4194304)); - } - else { - if (!newProps) - if (((current = findFirstSuspended(cache$83)), null !== current)) { - if ( - ((workInProgress.flags |= 128), - (newProps = !0), - (current = current.updateQueue), - (workInProgress.updateQueue = current), - scheduleRetryEffect(workInProgress, current), - cutOffTailIfNeeded(instance, !0), - null === instance.tail && - "hidden" === instance.tailMode && - !cache$83.alternate) - ) - return bubbleProperties(workInProgress), null; - } else - 2 * now() - instance.renderingStartTime > - workInProgressRootRenderTargetTime && - 536870912 !== renderLanes && - ((workInProgress.flags |= 128), - (newProps = !0), - cutOffTailIfNeeded(instance, !1), - (workInProgress.lanes = 4194304)); - instance.isBackwards - ? ((cache$83.sibling = workInProgress.child), - (workInProgress.child = cache$83)) - : ((current = instance.last), - null !== current - ? (current.sibling = cache$83) - : (workInProgress.child = cache$83), - (instance.last = cache$83)); - } - if (null !== instance.tail) - return ( - (workInProgress = instance.tail), - (instance.rendering = workInProgress), - (instance.tail = workInProgress.sibling), - (instance.renderingStartTime = now()), - (workInProgress.sibling = null), - (current = suspenseStackCursor.current), - push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1), - workInProgress - ); - bubbleProperties(workInProgress); - return null; - case 21: + case 1: return ( - null === current && - ((workInProgress.stateNode = { - DO_NOT_USE_queryAllNodes: DO_NOT_USE_queryAllNodes, - DO_NOT_USE_queryFirstNode: DO_NOT_USE_queryFirstNode, - containsNode: containsNode, - getChildContextValues: getChildContextValues - }), - shim$1()), - null !== workInProgress.ref && (workInProgress.flags |= 4), - bubbleProperties(workInProgress), - null + (Component = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === Component + ? init + : resolveDefaultProps(Component, init)), + updateClassComponent( + current, + workInProgress, + Component, + init, + renderLanes + ) ); - case 22: - case 23: + case 3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + Component = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + nextProps = workInProgress.memoizedState; + enableTransitionTracing && + push(transitionStack, workInProgressTransitions); + enableTransitionTracing && pushRootMarkerInstance(workInProgress); + var nextCache = nextProps.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== init.cache && + propagateContextChange(workInProgress, CacheContext, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + init = nextProps.element; + init === Component + ? (workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + )) + : (reconcileChildren(current, workInProgress, init, renderLanes), + (workInProgress = workInProgress.child)); + return workInProgress; + case 26: + case 27: + case 5: return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - (newProps = null !== workInProgress.memoizedState), - 23 !== workInProgress.tag && - (null !== current - ? (null !== current.memoizedState) !== newProps && - (workInProgress.flags |= 8192) - : newProps && (workInProgress.flags |= 8192)), - newProps && 0 !== (workInProgress.mode & 1) - ? 0 !== (renderLanes & 536870912) && - 0 === (workInProgress.flags & 128) && - (bubbleProperties(workInProgress), - 23 !== workInProgress.tag && - workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), - (renderLanes = workInProgress.updateQueue), - null !== renderLanes && - scheduleRetryEffect(workInProgress, renderLanes.retryQueue), - (renderLanes = null), - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (renderLanes = current.memoizedState.cachePool.pool), - (newProps = null), + pushHostContext(workInProgress), + (init = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextCache = null !== current ? current.memoizedProps : null), + (Component = nextProps.children), + shouldSetTextContent(init, nextProps) + ? (Component = null) + : null !== nextCache && + shouldSetTextContent(init, nextCache) && + (workInProgress.flags |= 32), null !== workInProgress.memoizedState && - null !== workInProgress.memoizedState.cachePool && - (newProps = workInProgress.memoizedState.cachePool.pool), - newProps !== renderLanes && (workInProgress.flags |= 2048), - popTransition(workInProgress, current), - null + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue2 = init), + enableLazyContextPropagation || + (didReceiveUpdate && + null !== current && + current.memoizedState.memoizedState !== init && + propagateContextChange( + workInProgress, + HostTransitionContext, + renderLanes + ))), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - case 24: + case 6: + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: return ( - (renderLanes = null), - null !== current && (renderLanes = current.memoizedState.cache), - workInProgress.memoizedState.cache !== renderLanes && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - bubbleProperties(workInProgress), - null + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (Component = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + )) + : reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - case 25: + case 11: return ( - enableTransitionTracing && - (null !== workInProgress.stateNode && - enableTransitionTracing && - pop(markerInstanceStack), - bubbleProperties(workInProgress)), - null + (Component = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === Component + ? init + : resolveDefaultProps(Component, init)), + updateForwardRef(current, workInProgress, Component, init, renderLanes) ); - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -function unwindWork(current, workInProgress) { - switch (workInProgress.tag) { - case 1: + case 7: return ( - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child ); - case 3: + case 8: return ( - popProvider(CacheContext), - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack), - enableTransitionTracing && pop(transitionStack), - popHostContainer(), - (current = workInProgress.flags), - 0 !== (current & 65536) && 0 === (current & 128) - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - case 26: - case 27: - case 5: - return popHostContext(workInProgress), null; - case 13: - popSuspenseHandler(workInProgress); - current = workInProgress.memoizedState; - if ( - null !== current && - null !== current.dehydrated && - null === workInProgress.alternate - ) - throw Error(formatProdErrorMessage(340)); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null; - case 19: - return pop(suspenseStackCursor), null; - case 4: - return popHostContainer(), null; - case 10: + case 12: return ( - popProvider( - enableRenderableContext - ? workInProgress.type - : workInProgress.type._context + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ), - null + workInProgress.child + ); + case 10: + a: { + Component = enableRenderableContext + ? workInProgress.type + : workInProgress.type._context; + init = workInProgress.pendingProps; + nextProps = workInProgress.memoizedProps; + nextCache = init.value; + pushProvider(workInProgress, Component, nextCache); + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextCache)) { + if (nextProps.children === init.children) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, init.children, renderLanes); + workInProgress = workInProgress.child; + } + return workInProgress; + case 9: + return ( + (init = enableRenderableContext + ? workInProgress.type._context + : workInProgress.type), + (Component = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress, renderLanes), + (init = readContext(init)), + (Component = Component(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child + ); + case 14: + return ( + (Component = workInProgress.type), + (init = resolveDefaultProps(Component, workInProgress.pendingProps)), + (init = resolveDefaultProps(Component.type, init)), + updateMemoComponent( + current, + workInProgress, + Component, + init, + renderLanes + ) ); - case 22: - case 23: - return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - popTransition(workInProgress, current), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes ); - case 24: - return popProvider(CacheContext), null; - case 25: + case 17: return ( - enableTransitionTracing && - null !== workInProgress.stateNode && - enableTransitionTracing && - pop(markerInstanceStack), - null + (Component = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === Component + ? init + : resolveDefaultProps(Component, init)), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + prepareToReadContext(workInProgress, renderLanes), + constructClassInstance(workInProgress, Component, init), + mountClassInstance(workInProgress, Component, init, renderLanes), + finishClassComponent( + null, + workInProgress, + Component, + !0, + !1, + renderLanes + ) ); - default: - return null; - } -} -function unwindInterruptedWork(current, interruptedWork) { - switch (interruptedWork.tag) { - case 3: - popProvider(CacheContext); - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack); - enableTransitionTracing && pop(transitionStack); - popHostContainer(); - break; - case 26: - case 27: - case 5: - popHostContext(interruptedWork); - break; - case 4: - popHostContainer(); - break; - case 13: - popSuspenseHandler(interruptedWork); - break; case 19: - pop(suspenseStackCursor); - break; - case 10: - popProvider( - enableRenderableContext - ? interruptedWork.type - : interruptedWork.type._context + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 21: + return ( + (Component = workInProgress.pendingProps.children), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component, renderLanes), + workInProgress.child ); - break; case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: - popSuspenseHandler(interruptedWork); - popHiddenContext(); - popTransition(interruptedWork, current); - break; + return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: - popProvider(CacheContext); - break; + return ( + prepareToReadContext(workInProgress, renderLanes), + (Component = readContext(CacheContext)), + null === current + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { parent: Component, cache: init }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, init)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (init = current.memoizedState), + (nextProps = workInProgress.memoizedState), + init.parent !== Component + ? ((init = { parent: Component, cache: Component }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== init.cache && + propagateContextChange( + workInProgress, + CacheContext, + renderLanes + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); case 25: - enableTransitionTracing && - null !== interruptedWork.stateNode && - enableTransitionTracing && - pop(markerInstanceStack); + if (enableTransitionTracing) + return ( + enableTransitionTracing + ? (null === current && + ((Component = enableTransitionTracing + ? transitionStack.current + : null), + null !== Component && + ((Component = { + tag: 1, + transitions: new Set(Component), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }), + (workInProgress.stateNode = Component), + (workInProgress.flags |= 2048))), + (Component = workInProgress.stateNode), + null !== Component && + pushMarkerInstance(workInProgress, Component), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + (workInProgress = workInProgress.child)) + : (workInProgress = null), + workInProgress + ); } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } -if ("function" !== typeof require("ReactFbErrorUtils").invokeGuardedCallback) - throw Error(formatProdErrorMessage(255)); -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; -function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - "function" === typeof ref - ? (current.refCleanup = ref(instanceToUse)) - : (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } +var valueCursor = createCursor(null), + currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null; +function resetContextDependencies() { + lastFullyObservedContext = + lastContextDependency = + currentlyRenderingFiber = + null; } -function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - ref(null); - } catch (error$100) { - captureCommitPhaseError(current, nearestMountedAncestor, error$100); - } - else ref.current = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2); + context._currentValue2 = nextValue; } -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); +function popProvider(context) { + context._currentValue2 = valueCursor.current; + pop(valueCursor); +} +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } } -var focusedInstanceHandle = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - focusedInstanceHandle = null; - for (nextEffect = firstChild; null !== nextEffect; ) { - root = nextEffect; - firstChild = root.deletions; - if (null !== firstChild) - for (var i = 0; i < firstChild.length; i++) - doesFiberContain(firstChild[i], focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - firstChild = root.child; - if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - try { - var current = root.alternate, - flags = root.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === root.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = root.memoizedState; - JSCompiler_temp = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp = !1; +function propagateContextChange(workInProgress, context, renderLanes) { + if (enableLazyContextPropagation) + propagateContextChanges(workInProgress, [context], renderLanes, !0); + else if (!enableLazyContextPropagation) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + for (var dependency = list.firstContext; null !== dependency; ) { + if (dependency.context === context) { + if (1 === fiber.tag) { + dependency = createUpdate(renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = fiber.updateQueue; + if (null !== updateQueue) { + updateQueue = updateQueue.shared; + var pending = updateQueue.pending; + null === pending + ? (dependency.next = dependency) + : ((dependency.next = pending.next), + (pending.next = dependency)); + updateQueue.pending = dependency; } - JSCompiler_temp && - doesFiberContain(root, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); + } + fiber.lanes |= renderLanes; + dependency = fiber.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + workInProgress + ); + list.lanes |= renderLanes; + break; } - switch (root.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = root.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for ( - firstChild = 0; - firstChild < eventPayloads.length; - firstChild++ - ) { - var _eventPayloads$ii = eventPayloads[firstChild]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevProps = current.memoizedProps, - prevState = current.memoizedState, - instance = root.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - root.elementType === root.type - ? prevProps - : resolveDefaultProps(root.type, prevProps), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); + dependency = dependency.next; + } + } else if (10 === fiber.tag) + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = fiber.sibling; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } catch (error) { - captureCommitPhaseError(root, root.return, error); + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; + fiber = nextFiber; + } + } +} +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + if (enableLazyContextPropagation) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; } - nextEffect = root.return; + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } + } +} +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + if (enableLazyContextPropagation) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - current = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - focusedInstanceHandle = null; - return current; } -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); +function checkIfContextChanged(currentDependencies) { + if (!enableLazyContextPropagation) return !1; + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; } -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; - } - effect = effect.next; - } while (effect !== finishedWork); - } +function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && + (enableLazyContextPropagation + ? (workInProgress.firstContext = null) + : null !== workInProgress.firstContext && + (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), + (workInProgress.firstContext = null))); } -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber, context); } -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } +function readContextDuringReconcilation(consumer, context, renderLanes) { + null === currentlyRenderingFiber && + prepareToReadContext(consumer, renderLanes); + return readContextForConsumer(consumer, context); } -function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); - break; - case 1: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 4) - if (((finishedRoot = finishedWork.stateNode), null === current)) - try { - finishedRoot.componentDidMount(); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - else { - var prevProps = - finishedWork.elementType === finishedWork.type - ? current.memoizedProps - : resolveDefaultProps(finishedWork.type, current.memoizedProps); - current = current.memoizedState; - try { - finishedRoot.componentDidUpdate( - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$101) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$101 - ); - } - } - flags & 64 && commitClassCallbacks(finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 3: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { - finishedRoot = null; - if (null !== finishedWork.child) - switch (finishedWork.child.tag) { - case 27: - case 5: - finishedRoot = finishedWork.child.stateNode; - break; - case 1: - finishedRoot = finishedWork.child.stateNode; - } - try { - commitCallbacks(flags, finishedRoot); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - break; - case 26: - case 27: - case 5: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 13: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 22: - if (0 !== (finishedWork.mode & 1)) { - if ( - ((prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !prevProps) - ) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && - ("manual" === finishedWork.memoizedProps.mode - ? safelyAttachRef(finishedWork, finishedWork.return) - : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - } +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { context: context, memoizedValue: value, next: null }), + null === lastContextDependency) + ) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + enableLazyContextPropagation && (consumer.flags |= 524288); + } else lastContextDependency = lastContextDependency.next = context; + return value; } -function abortRootTransitions( - root, - abort, - deletedTransitions, - deletedOffscreenInstance -) { - if (enableTransitionTracing) { - var rootTransitions = root.incompleteTransitions; - deletedTransitions.forEach(function (transition) { - rootTransitions.has(transition) && - ((transition = rootTransitions.get(transition)), - null === transition.aborts && (transition.aborts = []), - transition.aborts.push(abort), - null !== deletedOffscreenInstance && - null !== transition.pendingBoundaries && - transition.pendingBoundaries.has(deletedOffscreenInstance) && - transition.pendingBoundaries.delete(deletedOffscreenInstance)); +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; +} +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); }); - } } -function abortTracingMarkerTransitions( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree -) { - if (enableTransitionTracing) { - var markerInstance = abortedFiber.stateNode, - markerTransitions = markerInstance.transitions, - pendingBoundaries = markerInstance.pendingBoundaries; - null !== markerTransitions && - deletedTransitions.forEach(function (transition) { - if ( - null !== abortedFiber && - markerTransitions.has(transition) && - (null === markerInstance.aborts || - !markerInstance.aborts.includes(abort)) && - null !== markerInstance.transitions - ) { - if (null === markerInstance.aborts) { - markerInstance.aborts = [abort]; - transition = abortedFiber.memoizedProps.name; - var transitions = markerInstance.transitions, - aborts = markerInstance.aborts; - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: new Map(), - markerComplete: null - }), - null === currentPendingTransitionCallbacks.markerIncomplete && - (currentPendingTransitionCallbacks.markerIncomplete = - new Map()), - currentPendingTransitionCallbacks.markerIncomplete.set( - transition, - { transitions: transitions, aborts: aborts } - )); - } else markerInstance.aborts.push(abort); - null !== deletedOffscreenInstance && - !isInDeletedTree && - null !== pendingBoundaries && - pendingBoundaries.has(deletedOffscreenInstance) && - (pendingBoundaries.delete(deletedOffscreenInstance), - addMarkerProgressCallbackToPendingTransition( - abortedFiber.memoizedProps.name, - deletedTransitions, - pendingBoundaries - )); - } - }); - } +var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; +function requestCurrentTransition() { + var transition = ReactCurrentBatchConfig$1.transition; + null !== transition && transition._callbacks.add(handleAsyncAction); + return transition; } -function abortParentMarkerTransitionsForDeletedFiber( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree -) { - if (enableTransitionTracing) - for (; null !== abortedFiber; ) { - switch (abortedFiber.tag) { - case 25: - abortTracingMarkerTransitions( - abortedFiber, - abort, - deletedTransitions, - deletedOffscreenInstance, - isInDeletedTree - ); - break; - case 3: - abortRootTransitions( - abortedFiber.stateNode, - abort, - deletedTransitions, - deletedOffscreenInstance - ); - } - abortedFiber = abortedFiber.return; - } +function handleAsyncAction(transition, thenable) { + entangleAsyncAction(transition, thenable); } -function commitTransitionProgress(offscreenFiber) { - if (enableTransitionTracing) { - var offscreenInstance = offscreenFiber.stateNode, - prevState = null, - previousFiber = offscreenFiber.alternate; - null !== previousFiber && - null !== previousFiber.memoizedState && - (prevState = previousFiber.memoizedState); - prevState = null !== prevState; - previousFiber = null !== offscreenFiber.memoizedState; - var pendingMarkers = offscreenInstance._pendingMarkers, - name = null; - offscreenFiber = offscreenFiber.return; - null !== offscreenFiber && - 13 === offscreenFiber.tag && - offscreenFiber.memoizedProps.unstable_name && - (name = offscreenFiber.memoizedProps.unstable_name); - !prevState && previousFiber - ? null !== pendingMarkers && - pendingMarkers.forEach(function (markerInstance) { - var pendingBoundaries = markerInstance.pendingBoundaries, - transitions = markerInstance.transitions, - markerName = markerInstance.name; - null === pendingBoundaries || - pendingBoundaries.has(offscreenInstance) || - (pendingBoundaries.set(offscreenInstance, { name: name }), - null !== transitions && - (1 === markerInstance.tag && null !== markerName - ? addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries - ) - : 0 === markerInstance.tag && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }) - : prevState && - !previousFiber && - null !== pendingMarkers && - pendingMarkers.forEach(function (markerInstance) { - var pendingBoundaries = markerInstance.pendingBoundaries, - transitions = markerInstance.transitions, - markerName = markerInstance.name; - null !== pendingBoundaries && - pendingBoundaries.has(offscreenInstance) && - (pendingBoundaries.delete(offscreenInstance), - null !== transitions && - (1 === markerInstance.tag && null !== markerName - ? (addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries - ), - 0 === pendingBoundaries.size && - (null === markerInstance.aborts && - addMarkerCompleteCallbackToPendingTransition( - markerName, - transitions - ), - (markerInstance.transitions = null), - (markerInstance.pendingBoundaries = null), - (markerInstance.aborts = null))) - : 0 === markerInstance.tag && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }); - } +function notifyTransitionCallbacks(transition, returnValue) { + transition._callbacks.forEach(function (callback) { + return callback(transition, returnValue); + }); } -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; +var resumedCache = createCursor(null), + transitionStack = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function isHostParent(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; +function pushTransition( + offscreenWorkInProgress, + prevCachePool, + newTransitions +) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); + enableTransitionTracing && + (null === transitionStack.current + ? push(transitionStack, newTransitions) + : null === newTransitions + ? push(transitionStack, transitionStack.current) + : push(transitionStack, transitionStack.current.concat(newTransitions))); } -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; +function popTransition(workInProgress, current) { + null !== current && + (enableTransitionTracing && pop(transitionStack), pop(resumedCache)); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +} +var emptyObject = {}; +function collectScopedNodesFromChildren( + startingChild, + fn$jscomp$0, + scopedNodes$jscomp$0 +) { + for (; null !== startingChild; ) { + var node = startingChild, + fn = fn$jscomp$0, + scopedNodes = scopedNodes$jscomp$0; + if (5 === node.tag) { + var type = node.type, + memoizedProps = node.memoizedProps, + instance = node.stateNode; + null !== instance && + !0 === fn(type, memoizedProps || emptyObject, instance) && + scopedNodes.push(instance); } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); + type = node.child; + isFiberSuspenseAndTimedOut(node) && (type = node.child.sibling.child); + null !== type && collectScopedNodesFromChildren(type, fn, scopedNodes); + startingChild = startingChild.sibling; + } +} +function collectFirstScopedNodeFromChildren(startingChild, fn$jscomp$0) { + for (; null !== startingChild; ) { + a: { + var JSCompiler_inline_result = startingChild; + var fn = fn$jscomp$0; + if (5 === JSCompiler_inline_result.tag) { + var type = JSCompiler_inline_result.type, + memoizedProps = JSCompiler_inline_result.memoizedProps, + instance = JSCompiler_inline_result.stateNode; + if (null !== instance && !0 === fn(type, memoizedProps, instance)) { + JSCompiler_inline_result = instance; + break a; + } + } + type = JSCompiler_inline_result.child; + isFiberSuspenseAndTimedOut(JSCompiler_inline_result) && + (type = JSCompiler_inline_result.child.sibling.child); + JSCompiler_inline_result = + null !== type ? collectFirstScopedNodeFromChildren(type, fn) : null; } - if (!(fiber.flags & 2)) return fiber.stateNode; + if (null !== JSCompiler_inline_result) return JSCompiler_inline_result; + startingChild = startingChild.sibling; } + return null; } -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - +function collectNearestChildContextValues( + startingChild, + context$jscomp$0, + childContextValues$jscomp$0 +) { + for (; null !== startingChild; ) { + var node = startingChild, + context = context$jscomp$0, + childContextValues = childContextValues$jscomp$0; + if ( + 10 === node.tag && + (enableRenderableContext ? node.type : node.type._context) === context ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); + childContextValues.push(node.memoizedProps.value); + else { + var child = node.child; + isFiberSuspenseAndTimedOut(node) && (child = node.child.sibling.child); + null !== child && + collectNearestChildContextValues(child, context, childContextValues); + } + startingChild = startingChild.sibling; + } } -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function DO_NOT_USE_queryAllNodes(fn) { + var currentFiber = shim$1(); + if (null === currentFiber) return null; + currentFiber = currentFiber.child; + var scopedNodes = []; + null !== currentFiber && + collectScopedNodesFromChildren(currentFiber, fn, scopedNodes); + return 0 === scopedNodes.length ? null : scopedNodes; } -var hostParent = null, - hostParentIsContainer = !1; -function recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - parent -) { - for (parent = parent.child; null !== parent; ) - commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), - (parent = parent.sibling); +function DO_NOT_USE_queryFirstNode(fn) { + var currentFiber = shim$1(); + if (null === currentFiber) return null; + currentFiber = currentFiber.child; + return null !== currentFiber + ? collectFirstScopedNodeFromChildren(currentFiber, fn) + : null; } -function commitDeletionEffectsOnFiber( - finishedRoot, - nearestMountedAncestor, - deletedFiber -) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) - try { - injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); - } catch (err) {} - switch (deletedFiber.tag) { - case 26: - case 27: - case 5: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor); - case 6: - var prevHostParent = hostParent, - prevHostParentIsContainer = hostParentIsContainer; - hostParent = null; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); - break; - case 18: - finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); - null !== hostParent && shim$2(); +function containsNode() { + throw Error(formatProdErrorMessage(248)); +} +function getChildContextValues(context) { + var currentFiber = shim$1(); + if (null === currentFiber) return []; + currentFiber = currentFiber.child; + var childContextValues = []; + null !== currentFiber && + collectNearestChildContextValues(currentFiber, context, childContextValues); + return childContextValues; +} +function scheduleRetryEffect(workInProgress, retryQueue) { + null !== retryQueue + ? (workInProgress.flags |= 4) + : workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue)); +} +function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + hasRenderedATailFallback = renderState.tail; + for (var lastTailNode = null; null !== hasRenderedATailFallback; ) + null !== hasRenderedATailFallback.alternate && + (lastTailNode = hasRenderedATailFallback), + (hasRenderedATailFallback = hasRenderedATailFallback.sibling); + null === lastTailNode + ? (renderState.tail = null) + : (lastTailNode.sibling = null); break; - case 4: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; - hostParent = deletedFiber.stateNode.containerInfo; - hostParentIsContainer = !0; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case "collapsed": + lastTailNode = renderState.tail; + for (var lastTailNode$78 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode), + (lastTailNode = lastTailNode.sibling); + null === lastTailNode$78 + ? hasRenderedATailFallback || null === renderState.tail + ? (renderState.tail = null) + : (renderState.tail.sibling = null) + : (lastTailNode$78.sibling = null); + } +} +function bubbleProperties(completedWork) { + var didBailout = + null !== completedWork.alternate && + completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) + for (var child$79 = completedWork.child; null !== child$79; ) + (newChildLanes |= child$79.lanes | child$79.childLanes), + (subtreeFlags |= child$79.subtreeFlags & 31457280), + (subtreeFlags |= child$79.flags & 31457280), + (child$79.return = completedWork), + (child$79 = child$79.sibling); + else + for (child$79 = completedWork.child; null !== child$79; ) + (newChildLanes |= child$79.lanes | child$79.childLanes), + (subtreeFlags |= child$79.subtreeFlags), + (subtreeFlags |= child$79.flags), + (child$79.return = completedWork), + (child$79 = child$79.sibling); + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; +} +function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + switch (workInProgress.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; + case 1: + return bubbleProperties(workInProgress), null; + case 3: + return ( + (renderLanes = workInProgress.stateNode), + enableTransitionTracing && + null !== workInProgressTransitions && + (workInProgress.flags |= 2048), + (newProps = null), + null !== current && (newProps = current.memoizedState.cache), + workInProgress.memoizedState.cache !== newProps && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack), + enableTransitionTracing && pop(transitionStack), + popHostContainer(), + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)), + (null !== current && null !== current.child) || + null === current || + (current.memoizedState.isDehydrated && + 0 === (workInProgress.flags & 256)) || + ((workInProgress.flags |= 1024), + null !== hydrationErrors && + (queueRecoverableErrors(hydrationErrors), + (hydrationErrors = null))), + bubbleProperties(workInProgress), + enableTransitionTracing && + 0 !== (workInProgress.subtreeFlags & 8192) && + (workInProgress.flags |= 2048), + null ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - break; - case 0: - case 11: - case 14: - case 15: + case 26: + case 27: + case 5: + popHostContext(workInProgress); + renderLanes = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) + current.memoizedProps !== newProps && (workInProgress.flags |= 4); + else { + if (!newProps) { + if (null === workInProgress.stateNode) + throw Error(formatProdErrorMessage(166)); + bubbleProperties(workInProgress); + return null; + } + switch (renderLanes) { + case TYPES.CLIPPING_RECTANGLE: + var instance = Mode$1.ClippingRectangle(); + instance._applyProps = applyClippingRectangleProps; + break; + case TYPES.GROUP: + instance = Mode$1.Group(); + instance._applyProps = applyGroupProps; + break; + case TYPES.SHAPE: + instance = Mode$1.Shape(); + instance._applyProps = applyShapeProps; + break; + case TYPES.TEXT: + (instance = Mode$1.Text( + newProps.children, + newProps.font, + newProps.alignment, + newProps.path + )), + (instance._applyProps = applyTextProps); + } + if (!instance) throw Error(formatProdErrorMessage(217, renderLanes)); + instance._applyProps(instance, newProps); + current = instance; + a: for (renderLanes = workInProgress.child; null !== renderLanes; ) { + if (5 === renderLanes.tag || 6 === renderLanes.tag) { + newProps = current; + instance = renderLanes.stateNode; + if ("string" === typeof instance) + throw Error(formatProdErrorMessage(216)); + instance.inject(newProps); + } else if (4 !== renderLanes.tag && null !== renderLanes.child) { + renderLanes.child.return = renderLanes; + renderLanes = renderLanes.child; + continue; + } + if (renderLanes === workInProgress) break a; + for (; null === renderLanes.sibling; ) { + if ( + null === renderLanes.return || + renderLanes.return === workInProgress + ) + break a; + renderLanes = renderLanes.return; + } + renderLanes.sibling.return = renderLanes.return; + renderLanes = renderLanes.sibling; + } + workInProgress.stateNode = current; + } + bubbleProperties(workInProgress); + workInProgress.flags &= -16777217; + return null; + case 6: + if (current && null != workInProgress.stateNode) + current.memoizedProps !== newProps && (workInProgress.flags |= 4); + else { + if ("string" !== typeof newProps && null === workInProgress.stateNode) + throw Error(formatProdErrorMessage(166)); + workInProgress.stateNode = newProps; + } + bubbleProperties(workInProgress); + return null; + case 13: + newProps = workInProgress.memoizedState; if ( - !offscreenSubtreeWasHidden && - ((prevHostParent = deletedFiber.updateQueue), - null !== prevHostParent && - ((prevHostParent = prevHostParent.lastEffect), - null !== prevHostParent)) + null === current || + (null !== current.memoizedState && + null !== current.memoizedState.dehydrated) ) { - prevHostParentIsContainer = prevHostParent = prevHostParent.next; - do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - (0 !== (tag & 2) - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : 0 !== (tag & 4) && - ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ))); - prevHostParentIsContainer = prevHostParentIsContainer.next; - } while (prevHostParentIsContainer !== prevHostParent); + if (null !== newProps && null !== newProps.dehydrated) { + if (null === current) { + throw Error(formatProdErrorMessage(318)); + throw Error(formatProdErrorMessage(344)); + } + 0 === (workInProgress.flags & 128) && + (workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + instance = !1; + } else + null !== hydrationErrors && + (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (instance = !0); + if (!instance) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; + } } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + popSuspenseHandler(workInProgress); + if (0 !== (workInProgress.flags & 128)) + return (workInProgress.lanes = renderLanes), workInProgress; + renderLanes = null !== newProps; + current = null !== current && null !== current.memoizedState; + if (renderLanes) { + newProps = workInProgress.child; + instance = null; + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (instance = newProps.alternate.memoizedState.cachePool.pool); + var cache$83 = null; + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (cache$83 = newProps.memoizedState.cachePool.pool); + cache$83 !== instance && (newProps.flags |= 2048); + } + renderLanes !== current && + (enableTransitionTracing && (workInProgress.child.flags |= 2048), + renderLanes && (workInProgress.child.flags |= 8192)); + scheduleRetryEffect(workInProgress, workInProgress.updateQueue); + null !== workInProgress.updateQueue && + null != workInProgress.memoizedProps.suspenseCallback && + (workInProgress.flags |= 4); + bubbleProperties(workInProgress); + return null; + case 4: + return popHostContainer(), bubbleProperties(workInProgress), null; + case 10: + return ( + popProvider( + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context + ), + bubbleProperties(workInProgress), + null ); - break; - case 1: - if ( - !offscreenSubtreeWasHidden && - (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - (prevHostParent.props = deletedFiber.memoizedProps), - (prevHostParent.state = deletedFiber.memoizedState), - prevHostParent.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + case 17: + return bubbleProperties(workInProgress), null; + case 19: + pop(suspenseStackCursor); + instance = workInProgress.memoizedState; + if (null === instance) return bubbleProperties(workInProgress), null; + newProps = 0 !== (workInProgress.flags & 128); + cache$83 = instance.rendering; + if (null === cache$83) + if (newProps) cutOffTailIfNeeded(instance, !1); + else { + if ( + 0 !== workInProgressRootExitStatus || + (null !== current && 0 !== (current.flags & 128)) + ) + for (current = workInProgress.child; null !== current; ) { + cache$83 = findFirstSuspended(current); + if (null !== cache$83) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(instance, !1); + current = cache$83.updateQueue; + workInProgress.updateQueue = current; + scheduleRetryEffect(workInProgress, current); + workInProgress.subtreeFlags = 0; + current = renderLanes; + for (renderLanes = workInProgress.child; null !== renderLanes; ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); + push( + suspenseStackCursor, + (suspenseStackCursor.current & 1) | 2 + ); + return workInProgress.child; + } + current = current.sibling; + } + null !== instance.tail && + now() > workInProgressRootRenderTargetTime && + ((workInProgress.flags |= 128), + (newProps = !0), + cutOffTailIfNeeded(instance, !1), + (workInProgress.lanes = 4194304)); } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; + else { + if (!newProps) + if (((current = findFirstSuspended(cache$83)), null !== current)) { + if ( + ((workInProgress.flags |= 128), + (newProps = !0), + (current = current.updateQueue), + (workInProgress.updateQueue = current), + scheduleRetryEffect(workInProgress, current), + cutOffTailIfNeeded(instance, !0), + null === instance.tail && + "hidden" === instance.tailMode && + !cache$83.alternate) + ) + return bubbleProperties(workInProgress), null; + } else + 2 * now() - instance.renderingStartTime > + workInProgressRootRenderTargetTime && + 536870912 !== renderLanes && + ((workInProgress.flags |= 128), + (newProps = !0), + cutOffTailIfNeeded(instance, !1), + (workInProgress.lanes = 4194304)); + instance.isBackwards + ? ((cache$83.sibling = workInProgress.child), + (workInProgress.child = cache$83)) + : ((current = instance.last), + null !== current + ? (current.sibling = cache$83) + : (workInProgress.child = cache$83), + (instance.last = cache$83)); + } + if (null !== instance.tail) + return ( + (workInProgress = instance.tail), + (instance.rendering = workInProgress), + (instance.tail = workInProgress.sibling), + (instance.renderingStartTime = now()), + (workInProgress.sibling = null), + (current = suspenseStackCursor.current), + push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1), + workInProgress + ); + bubbleProperties(workInProgress); + return null; case 21: - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + return ( + null === current && + ((workInProgress.stateNode = { + DO_NOT_USE_queryAllNodes: DO_NOT_USE_queryAllNodes, + DO_NOT_USE_queryFirstNode: DO_NOT_USE_queryFirstNode, + containsNode: containsNode, + getChildContextValues: getChildContextValues + }), + shim$1()), + null !== workInProgress.ref && (workInProgress.flags |= 4), + bubbleProperties(workInProgress), + null ); - break; case 22: - safelyDetachRef(deletedFiber, nearestMountedAncestor); - deletedFiber.mode & 1 - ? ((offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState), - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ), - (offscreenSubtreeWasHidden = prevHostParent)) - : recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - default: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(), + (newProps = null !== workInProgress.memoizedState), + 23 !== workInProgress.tag && + (null !== current + ? (null !== current.memoizedState) !== newProps && + (workInProgress.flags |= 8192) + : newProps && (workInProgress.flags |= 8192)), + newProps && 0 !== (workInProgress.mode & 1) + ? 0 !== (renderLanes & 536870912) && + 0 === (workInProgress.flags & 128) && + (bubbleProperties(workInProgress), + 23 !== workInProgress.tag && + workInProgress.subtreeFlags & 6 && + (workInProgress.flags |= 8192)) + : bubbleProperties(workInProgress), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), + null !== workInProgress.memoizedState && + null !== workInProgress.memoizedState.cachePool && + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), + popTransition(workInProgress, current), + null ); - } -} -function getRetryCache(finishedWork) { - switch (finishedWork.tag) { - case 13: - case 19: - var retryCache = finishedWork.stateNode; - null === retryCache && - (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); - return retryCache; - case 22: + case 24: return ( - (finishedWork = finishedWork.stateNode), - (retryCache = finishedWork._retryCache), - null === retryCache && - (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), - retryCache + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + bubbleProperties(workInProgress), + null ); - default: - throw Error(formatProdErrorMessage(435, finishedWork.tag)); - } -} -function detachOffscreenInstance(instance) { - var fiber = instance._current; - if (null === fiber) throw Error(formatProdErrorMessage(456)); - if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && - ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, 2)); - } -} -function attachOffscreenInstance(instance) { - var fiber = instance._current; - if (null === fiber) throw Error(formatProdErrorMessage(456)); - if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && - ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, 2)); - } -} -function attachSuspenseRetryListeners(finishedWork, wakeables) { - var retryCache = getRetryCache(finishedWork); - wakeables.forEach(function (wakeable) { - var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); - retryCache.has(wakeable) || - (retryCache.add(wakeable), wakeable.then(retry, retry)); - }); -} -function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { - var deletions = parentFiber.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; - } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); - } - } - if (parentFiber.subtreeFlags & 12854) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), - (parentFiber = parentFiber.sibling); -} -function commitMutationEffectsOnFiber(finishedWork, root) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$109) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$109); - } - } - break; + case 25: + return ( + enableTransitionTracing && + (null !== workInProgress.stateNode && + enableTransitionTracing && + pop(markerInstanceStack), + bubbleProperties(workInProgress)), + null + ); + } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); +} +function unwindWork(current, workInProgress) { + switch (workInProgress.tag) { case 1: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - flags & 64 && - offscreenSubtreeIsHidden && - ((finishedWork = finishedWork.updateQueue), - null !== finishedWork && - ((flags = finishedWork.callbacks), - null !== flags && - ((current = finishedWork.shared.hiddenCallbacks), - (finishedWork.shared.hiddenCallbacks = - null === current ? flags : current.concat(flags))))); - break; + return ( + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); + case 3: + return ( + popProvider(CacheContext), + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack), + enableTransitionTracing && pop(transitionStack), + popHostContainer(), + (current = workInProgress.flags), + 0 !== (current & 65536) && 0 === (current & 128) + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && + return popHostContext(workInProgress), null; + case 13: + popSuspenseHandler(workInProgress); + current = workInProgress.memoizedState; + if ( null !== current && - safelyDetachRef(current, current.return); - if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; - finishedWork.updateQueue = null; - try { - flags._applyProps(flags, newProps, current); - } catch (error$112) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$112); - } - } - break; - case 6: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - if (flags & 4 && null === finishedWork.stateNode) - throw Error(formatProdErrorMessage(162)); - break; + null !== current.dehydrated && + null === workInProgress.alternate + ) + throw Error(formatProdErrorMessage(340)); + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null; + case 19: + return pop(suspenseStackCursor), null; + case 4: + return popHostContainer(), null; + case 10: + return ( + popProvider( + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context + ), + null + ); + case 22: + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(), + popTransition(workInProgress, current), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); + case 24: + return popProvider(CacheContext), null; + case 25: + return ( + enableTransitionTracing && + null !== workInProgress.stateNode && + enableTransitionTracing && + pop(markerInstanceStack), + null + ); + default: + return null; + } +} +function unwindInterruptedWork(current, interruptedWork) { + switch (interruptedWork.tag) { case 3: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); + popProvider(CacheContext); + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack); + enableTransitionTracing && pop(transitionStack); + popHostContainer(); + break; + case 26: + case 27: + case 5: + popHostContext(interruptedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); + popHostContainer(); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((newProps = null !== finishedWork.memoizedState), - (current = null !== current && null !== current.memoizedState), - alwaysThrottleRetries - ? newProps !== current && (globalMostRecentFallbackTime = now()) - : newProps && !current && (globalMostRecentFallbackTime = now())); - if (flags & 4) { - try { - if (null !== finishedWork.memoizedState) { - var suspenseCallback = finishedWork.memoizedProps.suspenseCallback; - if ("function" === typeof suspenseCallback) { - var retryQueue = finishedWork.updateQueue; - null !== retryQueue && suspenseCallback(new Set(retryQueue)); - } - } - } catch (error$114) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$114); - } - flags = finishedWork.updateQueue; - null !== flags && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, flags)); - } - break; - case 22: - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - suspenseCallback = null !== finishedWork.memoizedState; - retryQueue = null !== current && null !== current.memoizedState; - if (finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - } else recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - root = finishedWork.stateNode; - root._current = finishedWork; - root._visibility &= -3; - root._visibility |= root._pendingVisibility & 2; - if ( - flags & 8192 && - ((root._visibility = suspenseCallback - ? root._visibility & -2 - : root._visibility | 1), - suspenseCallback && - ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), - null === current || - retryQueue || - root || - (0 !== (finishedWork.mode & 1) && - recursivelyTraverseDisappearLayoutEffects(finishedWork))), - null === finishedWork.memoizedProps || - "manual" !== finishedWork.memoizedProps.mode) - ) - a: for (current = null, root = finishedWork; ; ) { - if (5 === root.tag) { - if (null === current) { - current = root; - try { - if (((newProps = root.stateNode), suspenseCallback)) - newProps.hide(); - else { - var props = root.memoizedProps; - (null == props.visible || props.visible) && - root.stateNode.show(); - } - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } - } - } else if ( - 6 !== root.tag && - ((22 !== root.tag && 23 !== root.tag) || - null === root.memoizedState || - root === finishedWork) && - null !== root.child - ) { - root.child.return = root; - root = root.child; - continue; - } - if (root === finishedWork) break a; - for (; null === root.sibling; ) { - if (null === root.return || root.return === finishedWork) break a; - current === root && (current = null); - root = root.return; - } - current === root && (current = null); - root.sibling.return = root.return; - root = root.sibling; - } - flags & 4 && - ((flags = finishedWork.updateQueue), - null !== flags && - ((current = flags.retryQueue), - null !== current && - ((flags.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, current)))); + popSuspenseHandler(interruptedWork); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((flags = finishedWork.updateQueue), - null !== flags && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, flags))); + pop(suspenseStackCursor); + break; + case 10: + popProvider( + enableRenderableContext + ? interruptedWork.type + : interruptedWork.type._context + ); + break; + case 22: + case 23: + popSuspenseHandler(interruptedWork); + popHiddenContext(); + popTransition(interruptedWork, current); break; - case 21: - recursivelyTraverseMutationEffects(root, finishedWork); - commitReconciliationEffects(finishedWork); - flags & 512 && - (null !== current && safelyDetachRef(finishedWork, finishedWork.return), - safelyAttachRef(finishedWork, finishedWork.return)); - flags & 4 && shim$1(); + case 24: + popProvider(CacheContext); break; - default: - recursivelyTraverseMutationEffects(root, finishedWork), - commitReconciliationEffects(finishedWork); + case 25: + enableTransitionTracing && + null !== interruptedWork.stateNode && + enableTransitionTracing && + pop(markerInstanceStack); } } -function commitReconciliationEffects(finishedWork) { - var flags = finishedWork.flags; - if (flags & 2) { - try { - a: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var JSCompiler_inline_result = parent; - break a; - } - parent = parent.return; - } - throw Error(formatProdErrorMessage(160)); - } - switch (JSCompiler_inline_result.tag) { +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null; +function safelyAttachRef(current, nearestMountedAncestor) { + try { + var ref = current.ref; + if (null !== ref) { + var instance = current.stateNode; + switch (current.tag) { + case 26: case 27: case 5: - var parent$jscomp$0 = JSCompiler_inline_result.stateNode; - JSCompiler_inline_result.flags & 32 && - (JSCompiler_inline_result.flags &= -33); - var before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); - break; - case 3: - case 4: - var parent$104 = JSCompiler_inline_result.stateNode.containerInfo, - before$105 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - before$105, - parent$104 - ); + var instanceToUse = instance; break; default: - throw Error(formatProdErrorMessage(161)); + instanceToUse = instance; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + 21 === current.tag && (instanceToUse = instance); + "function" === typeof ref + ? (current.refCleanup = ref(instanceToUse)) + : (ref.current = instanceToUse); } - finishedWork.flags &= -3; + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); } - flags & 4096 && (finishedWork.flags &= -4097); } -function recursivelyTraverseLayoutEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 8772) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), - (parentFiber = parentFiber.sibling); +function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + refCleanup(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + ref(null); + } catch (error$100) { + captureCommitPhaseError(current, nearestMountedAncestor, error$100); + } + else ref.current = null; } -function recursivelyTraverseDisappearLayoutEffects(parentFiber) { - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedWork = parentFiber; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - commitHookEffectListUnmount(4, finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 1: - safelyDetachRef(finishedWork, finishedWork.return); - var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - var current$jscomp$0 = current; - instance.props = current$jscomp$0.memoizedProps; - instance.state = current$jscomp$0.memoizedState; - instance.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 26: - case 27: - case 5: - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 22: - safelyDetachRef(finishedWork, finishedWork.return); - null === finishedWork.memoizedState && - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - default: - recursivelyTraverseDisappearLayoutEffects(finishedWork); - } - parentFiber = parentFiber.sibling; +function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); } } -function recursivelyTraverseReappearLayoutEffects( - finishedRoot$jscomp$0, - parentFiber, - includeWorkInProgressEffects -) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitHookLayoutEffects(finishedWork, 4); - break; - case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +var focusedInstanceHandle = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = null; + for (nextEffect = firstChild; null !== nextEffect; ) { + root = nextEffect; + firstChild = root.deletions; + if (null !== firstChild) + for (var i = 0; i < firstChild.length; i++) + doesFiberContain(firstChild[i], focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + firstChild = root.child; + if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + root = nextEffect; + try { + var current = root.alternate, + flags = root.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === root.tag)) + a: { + if (null !== current) { + var oldState = current.memoizedState; + if (null === oldState || null !== oldState.dehydrated) { + var newState = root.memoizedState; + JSCompiler_temp = + null !== newState && null === newState.dehydrated; + break a; + } + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(root, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (root.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = root.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + firstChild = 0; + firstChild < eventPayloads.length; + firstChild++ + ) { + var _eventPayloads$ii = eventPayloads[firstChild]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = root.stateNode, + snapshot = instance.getSnapshotBeforeUpdate( + root.elementType === root.type + ? prevProps + : resolveDefaultProps(root.type, prevProps), + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + break; + case 3: + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); } - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(root, root.return, error); } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 26: - case 27: - case 5: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 13: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - } - parentFiber = parentFiber.sibling; + firstChild = root.sibling; + if (null !== firstChild) { + firstChild.return = root.return; + nextEffect = firstChild; + break; + } + nextEffect = root.return; + } } + current = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return current; } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor +) { + var updateQueue = finishedWork.updateQueue; + updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== updateQueue) { + var effect = (updateQueue = updateQueue.next); + do { + if ((effect.tag & flags) === flags) { + var inst = effect.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + effect = effect.next; + } while (effect !== updateQueue); + } +} +function commitHookEffectListMount(flags, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + if (null !== finishedWork) { + var effect = (finishedWork = finishedWork.next); + do { + if ((effect.tag & flags) === flags) { + var create = effect.create, + inst = effect.inst; + create = create(); + inst.destroy = create; + } + effect = effect.next; + } while (effect !== finishedWork); + } +} +function commitHookLayoutEffects(finishedWork, hookFlags) { try { commitHookEffectListMount(hookFlags, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } -function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { - var previousCache = null; - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (previousCache = current.memoizedState.cachePool.pool); - current = null; - null !== finishedWork.memoizedState && - null !== finishedWork.memoizedState.cachePool && - (current = finishedWork.memoizedState.cachePool.pool); - current !== previousCache && - (null != current && current.refCount++, - null != previousCache && releaseCache(previousCache)); - if (enableTransitionTracing) { - current = finishedWork.updateQueue; - previousCache = null !== finishedWork.memoizedState; - if (null !== current) { - if (previousCache) { - var transitions = current.transitions; - null !== transitions && - transitions.forEach(function (transition) { - null === instance._transitions && - (instance._transitions = new Set()); - instance._transitions.add(transition); - }); - current = current.markerInstances; - null !== current && - current.forEach(function (markerInstance) { - var markerTransitions = markerInstance.transitions; - null !== markerTransitions && - markerTransitions.forEach(function (transition) { - null === instance._transitions - ? (instance._transitions = new Set()) - : instance._transitions.has(transition) && - (null === markerInstance.pendingBoundaries && - (markerInstance.pendingBoundaries = new Map()), - null === instance._pendingMarkers && - (instance._pendingMarkers = new Set()), - instance._pendingMarkers.add(markerInstance)); - }); - }); - } - finishedWork.updateQueue = null; +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - commitTransitionProgress(finishedWork); - previousCache || - ((instance._transitions = null), (instance._pendingMarkers = null)); } } -function commitCachePassiveMountEffect(current, finishedWork) { - current = null; - null !== finishedWork.alternate && - (current = finishedWork.alternate.memoizedState.cache); - finishedWork = finishedWork.memoizedState.cache; - finishedWork !== current && - (finishedWork.refCount++, null != current && releaseCache(current)); -} -function commitTracingMarkerPassiveMountEffect(finishedWork) { - var instance = finishedWork.stateNode; - null !== instance.transitions && - null === instance.pendingBoundaries && - (addMarkerCompleteCallbackToPendingTransition( - finishedWork.memoizedProps.name, - instance.transitions - ), - (instance.transitions = null), - (instance.pendingBoundaries = null), - (instance.aborts = null), - (instance.name = null)); -} -function recursivelyTraversePassiveMountEffects( - root, - parentFiber, - committedLanes, - committedTransitions -) { - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveMountOnFiber( - root, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); -} -function commitPassiveMountOnFiber( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions -) { +function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 4 && commitHookLayoutEffects(finishedWork, 5); + break; + case 1: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + try { + finishedRoot.componentDidMount(); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + else { + var prevProps = + finishedWork.elementType === finishedWork.type + ? current.memoizedProps + : resolveDefaultProps(finishedWork.type, current.memoizedProps); + current = current.memoizedState; + try { + finishedRoot.componentDidUpdate( + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } catch (error$101) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$101 + ); + } + } + flags & 64 && commitClassCallbacks(finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - if (flags & 2048) { - flags = null; - null !== finishedWork.alternate && - (flags = finishedWork.alternate.memoizedState.cache); - var nextCache = finishedWork.memoizedState.cache; - nextCache !== flags && - (nextCache.refCount++, null != flags && releaseCache(flags)); - if (enableTransitionTracing) { - var incompleteTransitions = - finishedWork.stateNode.incompleteTransitions; - null !== committedTransitions && - (committedTransitions.forEach(function (transition) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: [], - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionStart && - (currentPendingTransitionCallbacks.transitionStart = []), - currentPendingTransitionCallbacks.transitionStart.push( - transition - )); - }), - clearTransitionsForLanes(finishedRoot, committedLanes)); - incompleteTransitions.forEach(function (markerInstance, transition) { - var pendingBoundaries = markerInstance.pendingBoundaries; - if (null === pendingBoundaries || 0 === pendingBoundaries.size) - null === markerInstance.aborts && - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: [], - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionComplete && - (currentPendingTransitionCallbacks.transitionComplete = []), - currentPendingTransitionCallbacks.transitionComplete.push( - transition - )), - incompleteTransitions.delete(transition); - }); - clearTransitionsForLanes(finishedRoot, committedLanes); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { + finishedRoot = null; + if (null !== finishedWork.child) + switch (finishedWork.child.tag) { + case 27: + case 5: + finishedRoot = finishedWork.child.stateNode; + break; + case 1: + finishedRoot = finishedWork.child.stateNode; + } + try { + commitCallbacks(flags, finishedRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; - case 23: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); + case 26: + case 27: + case 5: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; - case 22: - nextCache = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - nextCache - ); + case 12: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; - case 24: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + case 13: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + break; + case 22: + if (0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && + ("manual" === finishedWork.memoizedProps.mode + ? safelyAttachRef(finishedWork, finishedWork.return) + : safelyDetachRef(finishedWork, finishedWork.return)); break; - case 25: - if (enableTransitionTracing) { - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && commitTracingMarkerPassiveMountEffect(finishedWork); - break; - } default: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } +} +function abortRootTransitions( + root, + abort, + deletedTransitions, + deletedOffscreenInstance +) { + if (enableTransitionTracing) { + var rootTransitions = root.incompleteTransitions; + deletedTransitions.forEach(function (transition) { + rootTransitions.has(transition) && + ((transition = rootTransitions.get(transition)), + null === transition.aborts && (transition.aborts = []), + transition.aborts.push(abort), + null !== deletedOffscreenInstance && + null !== transition.pendingBoundaries && + transition.pendingBoundaries.has(deletedOffscreenInstance) && + transition.pendingBoundaries.delete(deletedOffscreenInstance)); + }); + } +} +function abortTracingMarkerTransitions( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree +) { + if (enableTransitionTracing) { + var markerInstance = abortedFiber.stateNode, + markerTransitions = markerInstance.transitions, + pendingBoundaries = markerInstance.pendingBoundaries; + null !== markerTransitions && + deletedTransitions.forEach(function (transition) { + if ( + null !== abortedFiber && + markerTransitions.has(transition) && + (null === markerInstance.aborts || + !markerInstance.aborts.includes(abort)) && + null !== markerInstance.transitions + ) { + if (null === markerInstance.aborts) { + markerInstance.aborts = [abort]; + transition = abortedFiber.memoizedProps.name; + var transitions = markerInstance.transitions, + aborts = markerInstance.aborts; + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: new Map(), + markerComplete: null + }), + null === currentPendingTransitionCallbacks.markerIncomplete && + (currentPendingTransitionCallbacks.markerIncomplete = + new Map()), + currentPendingTransitionCallbacks.markerIncomplete.set( + transition, + { transitions: transitions, aborts: aborts } + )); + } else markerInstance.aborts.push(abort); + null !== deletedOffscreenInstance && + !isInDeletedTree && + null !== pendingBoundaries && + pendingBoundaries.has(deletedOffscreenInstance) && + (pendingBoundaries.delete(deletedOffscreenInstance), + addMarkerProgressCallbackToPendingTransition( + abortedFiber.memoizedProps.name, + deletedTransitions, + pendingBoundaries + )); + } + }); } } -function recursivelyTraverseReconnectPassiveEffects( - finishedRoot$jscomp$0, - parentFiber, - committedLanes$jscomp$0, - committedTransitions$jscomp$0, - includeWorkInProgressEffects +function abortParentMarkerTransitionsForDeletedFiber( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - committedLanes = committedLanes$jscomp$0, - committedTransitions = committedTransitions$jscomp$0, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - commitHookPassiveMountEffects(finishedWork, 8); - break; - case 23: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); - break; - case 22: - var instance$120 = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? instance$120._visibility & 4 - ? recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork - ) - : ((instance$120._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((instance$120._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - instance$120 - ); - break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - case 25: - if (enableTransitionTracing) { - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects + if (enableTransitionTracing) + for (; null !== abortedFiber; ) { + switch (abortedFiber.tag) { + case 25: + abortTracingMarkerTransitions( + abortedFiber, + abort, + deletedTransitions, + deletedOffscreenInstance, + isInDeletedTree ); - includeWorkInProgressEffects && - flags & 2048 && - commitTracingMarkerPassiveMountEffect(finishedWork); break; - } - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); + case 3: + abortRootTransitions( + abortedFiber.stateNode, + abort, + deletedTransitions, + deletedOffscreenInstance + ); + } + abortedFiber = abortedFiber.return; + } +} +function commitTransitionProgress(offscreenFiber) { + if (enableTransitionTracing) { + var offscreenInstance = offscreenFiber.stateNode, + prevState = null, + previousFiber = offscreenFiber.alternate; + null !== previousFiber && + null !== previousFiber.memoizedState && + (prevState = previousFiber.memoizedState); + prevState = null !== prevState; + previousFiber = null !== offscreenFiber.memoizedState; + var pendingMarkers = offscreenInstance._pendingMarkers, + name = null; + offscreenFiber = offscreenFiber.return; + null !== offscreenFiber && + 13 === offscreenFiber.tag && + offscreenFiber.memoizedProps.unstable_name && + (name = offscreenFiber.memoizedProps.unstable_name); + !prevState && previousFiber + ? null !== pendingMarkers && + pendingMarkers.forEach(function (markerInstance) { + var pendingBoundaries = markerInstance.pendingBoundaries, + transitions = markerInstance.transitions, + markerName = markerInstance.name; + null === pendingBoundaries || + pendingBoundaries.has(offscreenInstance) || + (pendingBoundaries.set(offscreenInstance, { name: name }), + null !== transitions && + (1 === markerInstance.tag && null !== markerName + ? addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries + ) + : 0 === markerInstance.tag && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }) + : prevState && + !previousFiber && + null !== pendingMarkers && + pendingMarkers.forEach(function (markerInstance) { + var pendingBoundaries = markerInstance.pendingBoundaries, + transitions = markerInstance.transitions, + markerName = markerInstance.name; + null !== pendingBoundaries && + pendingBoundaries.has(offscreenInstance) && + (pendingBoundaries.delete(offscreenInstance), + null !== transitions && + (1 === markerInstance.tag && null !== markerName + ? (addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries + ), + 0 === pendingBoundaries.size && + (null === markerInstance.aborts && + addMarkerCompleteCallbackToPendingTransition( + markerName, + transitions + ), + (markerInstance.transitions = null), + (markerInstance.pendingBoundaries = null), + (markerInstance.aborts = null))) + : 0 === markerInstance.tag && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }); + } +} +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; +} +function isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; } - parentFiber = parentFiber.sibling; + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; } } -function recursivelyTraverseAtomicPassiveEffects( - finishedRoot$jscomp$0, - parentFiber -) { - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - } - parentFiber = parentFiber.sibling; - } +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); } -var suspenseyCommitFlag = 8192; -function recursivelyAccumulateSuspenseyCommit(parentFiber) { - if (parentFiber.subtreeFlags & suspenseyCommitFlag) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - accumulateSuspenseyCommitOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } -function accumulateSuspenseyCommitOnFiber(fiber) { - switch (fiber.tag) { +var hostParent = null, + hostParentIsContainer = !1; +function recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + parent +) { + for (parent = parent.child; null !== parent; ) + commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), + (parent = parent.sibling); +} +function commitDeletionEffectsOnFiber( + finishedRoot, + nearestMountedAncestor, + deletedFiber +) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) + try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) {} + switch (deletedFiber.tag) { case 26: - recursivelyAccumulateSuspenseyCommit(fiber); - if (fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState) - throw Error(formatProdErrorMessage(442)); - break; + case 27: case 5: - recursivelyAccumulateSuspenseyCommit(fiber); + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor); + case 6: + var prevHostParent = hostParent, + prevHostParentIsContainer = hostParentIsContainer; + hostParent = null; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; + null !== hostParent && + ((deletedFiber = deletedFiber.stateNode), + destroyEventListeners(deletedFiber), + deletedFiber.eject()); break; - case 3: - case 4: - recursivelyAccumulateSuspenseyCommit(fiber); + case 18: + finishedRoot = finishedRoot.hydrationCallbacks; + null !== finishedRoot && + (finishedRoot = finishedRoot.onDeleted) && + finishedRoot(deletedFiber.stateNode); + null !== hostParent && shim$2(); break; - case 22: - if (null === fiber.memoizedState) { - var current = fiber.alternate; - null !== current && null !== current.memoizedState - ? ((current = suspenseyCommitFlag), - (suspenseyCommitFlag = 16777216), - recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current)) - : recursivelyAccumulateSuspenseyCommit(fiber); - } + case 4: + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; + hostParent = deletedFiber.stateNode.containerInfo; + hostParentIsContainer = !0; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; break; - default: - recursivelyAccumulateSuspenseyCommit(fiber); - } -} -function detachAlternateSiblings(parentFiber) { - var previousFiber = parentFiber.alternate; - if ( - null !== previousFiber && - ((parentFiber = previousFiber.child), null !== parentFiber) - ) { - previousFiber.child = null; - do - (previousFiber = parentFiber.sibling), - (parentFiber.sibling = null), - (parentFiber = previousFiber); - while (null !== parentFiber); - } -} -function recursivelyTraversePassiveUnmountEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - } - detachAlternateSiblings(parentFiber); - } - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveUnmountOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); -} -function commitPassiveUnmountOnFiber(finishedWork) { - switch (finishedWork.tag) { case 0: case 11: + case 14: case 15: - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.flags & 2048 && - commitHookEffectListUnmount(9, finishedWork, finishedWork.return); + if ( + !offscreenSubtreeWasHidden && + ((prevHostParent = deletedFiber.updateQueue), + null !== prevHostParent && + ((prevHostParent = prevHostParent.lastEffect), + null !== prevHostParent)) + ) { + prevHostParentIsContainer = prevHostParent = prevHostParent.next; + do { + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, + destroy = inst.destroy; + void 0 !== destroy && + (0 !== (tag & 2) + ? ((inst.destroy = void 0), + safelyCallDestroy( + deletedFiber, + nearestMountedAncestor, + destroy + )) + : 0 !== (tag & 4) && + ((inst.destroy = void 0), + safelyCallDestroy( + deletedFiber, + nearestMountedAncestor, + destroy + ))); + prevHostParentIsContainer = prevHostParentIsContainer.next; + } while (prevHostParentIsContainer !== prevHostParent); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 1: + if ( + !offscreenSubtreeWasHidden && + (safelyDetachRef(deletedFiber, nearestMountedAncestor), + (prevHostParent = deletedFiber.stateNode), + "function" === typeof prevHostParent.componentWillUnmount) + ) + try { + (prevHostParent.props = deletedFiber.memoizedProps), + (prevHostParent.state = deletedFiber.memoizedState), + prevHostParent.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 21: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; case 22: - var instance = finishedWork.stateNode; - null !== finishedWork.memoizedState && - instance._visibility & 4 && - (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((instance._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(finishedWork)) - : recursivelyTraversePassiveUnmountEffects(finishedWork); + safelyDetachRef(deletedFiber, nearestMountedAncestor); + deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: - recursivelyTraversePassiveUnmountEffects(finishedWork); - } -} -function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - } - detachAlternateSiblings(parentFiber); - } - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - deletions = parentFiber; - switch (deletions.tag) { - case 0: - case 11: - case 15: - commitHookEffectListUnmount(8, deletions, deletions.return); - recursivelyTraverseDisconnectPassiveEffects(deletions); - break; - case 22: - i = deletions.stateNode; - i._visibility & 4 && - ((i._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(deletions)); - break; - default: - recursivelyTraverseDisconnectPassiveEffects(deletions); - } - parentFiber = parentFiber.sibling; - } -} -function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - deletedSubtreeRoot, - nearestMountedAncestor$jscomp$0 -) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookEffectListUnmount(8, fiber, nearestMountedAncestor); - break; - case 23: - case 22: - null !== fiber.memoizedState && - null !== fiber.memoizedState.cachePool && - ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), - null != nearestMountedAncestor && nearestMountedAncestor.refCount++); - break; - case 13: - if (enableTransitionTracing) { - var offscreenFiber = fiber.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: fiber.memoizedProps.unstable_name || null - }; - if ( - null === fiber.memoizedState || - null === fiber.memoizedState.dehydrated - ) - abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(fiber.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = fiber.stateNode.transitions), - null !== offscreenFiber && - ((instance = { reason: "marker", name: fiber.memoizedProps.name }), - abortParentMarkerTransitionsForDeletedFiber( - fiber, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - instance, - offscreenFiber, - null, - !1 - ))); - } - nearestMountedAncestor = fiber.child; - if (null !== nearestMountedAncestor) - (nearestMountedAncestor.return = fiber), - (nextEffect = nearestMountedAncestor); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - nearestMountedAncestor = nextEffect; - offscreenFiber = nearestMountedAncestor.sibling; - instance = nearestMountedAncestor.return; - detachFiberAfterEffects(nearestMountedAncestor); - if (nearestMountedAncestor === fiber) { - nextEffect = null; - break a; - } - if (null !== offscreenFiber) { - offscreenFiber.return = instance; - nextEffect = offscreenFiber; - break a; - } - nextEffect = instance; - } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); } } -var DefaultCacheDispatcher = { - getCacheSignal: function () { - return readContext(CacheContext).controller.signal; - }, - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - } - }, - PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, - ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, - ReactCurrentCache = ReactSharedInternals.ReactCurrentCache, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig, - executionContext = 0, - workInProgressRoot = null, - workInProgress = null, - workInProgressRootRenderLanes = 0, - workInProgressSuspendedReason = 0, - workInProgressThrownValue = null, - workInProgressRootDidAttachPingListener = !1, - entangledRenderLanes = 0, - workInProgressRootExitStatus = 0, - workInProgressRootFatalError = null, - workInProgressRootSkippedLanes = 0, - workInProgressRootInterleavedUpdatedLanes = 0, - workInProgressRootPingedLanes = 0, - workInProgressDeferredLane = 0, - workInProgressRootConcurrentErrors = null, - workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, - globalMostRecentFallbackTime = 0, - workInProgressRootRenderTargetTime = Infinity, - workInProgressTransitions = null, - currentPendingTransitionCallbacks = null, - currentEndTime = null; -function addMarkerProgressCallbackToPendingTransition( - markerName, - transitions, - pendingBoundaries -) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: new Map(), - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.markerProgress && - (currentPendingTransitionCallbacks.markerProgress = new Map()), - currentPendingTransitionCallbacks.markerProgress.set(markerName, { - pendingBoundaries: pendingBoundaries, - transitions: transitions - })); -} -function addMarkerCompleteCallbackToPendingTransition(markerName, transitions) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: null, - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: new Map() - }), - null === currentPendingTransitionCallbacks.markerComplete && - (currentPendingTransitionCallbacks.markerComplete = new Map()), - currentPendingTransitionCallbacks.markerComplete.set( - markerName, - transitions - )); -} -function addTransitionProgressCallbackToPendingTransition( - transition, - boundaries -) { - enableTransitionTracing && - (null === currentPendingTransitionCallbacks && - (currentPendingTransitionCallbacks = { - transitionStart: null, - transitionProgress: new Map(), - transitionComplete: null, - markerProgress: null, - markerIncomplete: null, - markerComplete: null - }), - null === currentPendingTransitionCallbacks.transitionProgress && - (currentPendingTransitionCallbacks.transitionProgress = new Map()), - currentPendingTransitionCallbacks.transitionProgress.set( - transition, - boundaries - )); +function getRetryCache(finishedWork) { + switch (finishedWork.tag) { + case 13: + case 19: + var retryCache = finishedWork.stateNode; + null === retryCache && + (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + return retryCache; + case 22: + return ( + (finishedWork = finishedWork.stateNode), + (retryCache = finishedWork._retryCache), + null === retryCache && + (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), + retryCache + ); + default: + throw Error(formatProdErrorMessage(435, finishedWork.tag)); + } } -var hasUncaughtError = !1, - firstUncaughtError = null, - legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, - pendingPassiveTransitions = null, - nestedUpdateCount = 0, - rootWithNestedUpdates = null; -function requestUpdateLane(fiber) { - if (0 === (fiber.mode & 1)) return 2; - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== requestCurrentTransition()) - return ( - (fiber = currentEntangledLane), - 0 !== fiber ? fiber : requestTransitionLane() - ); - fiber = currentUpdatePriority; - return 0 !== fiber ? fiber : 32; +function detachOffscreenInstance(instance) { + var fiber = instance._current; + if (null === fiber) throw Error(formatProdErrorMessage(456)); + if (0 === (instance._pendingVisibility & 2)) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && + ((instance._pendingVisibility |= 2), + scheduleUpdateOnFiber(root, fiber, 2)); + } } -function requestDeferredLane() { - 0 === workInProgressDeferredLane && - (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & 536870912) - ? 536870912 - : claimNextTransitionLane()); - var suspenseHandler = suspenseHandlerStackCursor.current; - null !== suspenseHandler && (suspenseHandler.flags |= 32); - return workInProgressDeferredLane; +function attachOffscreenInstance(instance) { + var fiber = instance._current; + if (null === fiber) throw Error(formatProdErrorMessage(456)); + if (0 !== (instance._pendingVisibility & 2)) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && + ((instance._pendingVisibility &= -3), + scheduleUpdateOnFiber(root, fiber, 2)); + } } -function scheduleUpdateOnFiber(root, fiber, lane) { - if ( - (root === workInProgressRoot && 2 === workInProgressSuspendedReason) || - null !== root.cancelPendingCommit - ) - prepareFreshStack(root, 0), - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane - ); - markRootUpdated(root, lane); - if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if (enableTransitionTracing) { - var transition = ReactCurrentBatchConfig.transition; - if ( - null !== transition && - null != transition.name && - (-1 === transition.startTime && (transition.startTime = now()), - enableTransitionTracing) - ) { - var transitionLanesMap = root.transitionLanes, - index$7 = 31 - clz32(lane), - transitions = transitionLanesMap[index$7]; - null === transitions && (transitions = new Set()); - transitions.add(transition); - transitionLanesMap[index$7] = transitions; +function attachSuspenseRetryListeners(finishedWork, wakeables) { + var retryCache = getRetryCache(finishedWork); + wakeables.forEach(function (wakeable) { + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + retryCache.has(wakeable) || + (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); +} +function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { + var deletions = parentFiber.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + var root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + } + parent = parent.return; + } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); } } - root === workInProgressRoot && - (0 === (executionContext & 2) && - (workInProgressRootInterleavedUpdatedLanes |= lane), - 4 === workInProgressRootExitStatus && - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane - )); - ensureRootIsScheduled(root); - 2 === lane && - 0 === executionContext && - 0 === (fiber.mode & 1) && - ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(!0)); - } + if (parentFiber.subtreeFlags & 12854) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), + (parentFiber = parentFiber.sibling); } -function performConcurrentWorkOnRoot(root, didTimeout) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; +function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + try { + commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - ))); + try { + commitHookEffectListUnmount(5, finishedWork, finishedWork.return); + } catch (error$109) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$109); + } + } + break; + case 1: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + flags & 64 && + offscreenSubtreeIsHidden && + ((finishedWork = finishedWork.updateQueue), + null !== finishedWork && + ((flags = finishedWork.callbacks), + null !== flags && + ((current = finishedWork.shared.hiddenCallbacks), + (finishedWork.shared.hiddenCallbacks = + null === current ? flags : current.concat(flags))))); + break; + case 26: + case 27: + case 5: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { + var newProps = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : newProps; + finishedWork.updateQueue = null; + try { + flags._applyProps(flags, newProps, current); + } catch (error$112) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$112); } - if (1 === exitStatus) - throw ( - ((originalCallbackNode = workInProgressRootFatalError), - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - originalCallbackNode) - ); - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - break a; - } - break; - case 2: - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); - } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; + } + break; + case 6: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4 && null === finishedWork.stateNode) + throw Error(formatProdErrorMessage(162)); + break; + case 3: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 4: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 13: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + finishedWork.child.flags & 8192 && + ((newProps = null !== finishedWork.memoizedState), + (current = null !== current && null !== current.memoizedState), + alwaysThrottleRetries + ? newProps !== current && (globalMostRecentFallbackTime = now()) + : newProps && !current && (globalMostRecentFallbackTime = now())); + if (flags & 4) { + try { + if (null !== finishedWork.memoizedState) { + var suspenseCallback = finishedWork.memoizedProps.suspenseCallback; + if ("function" === typeof suspenseCallback) { + var retryQueue = finishedWork.updateQueue; + null !== retryQueue && suspenseCallback(new Set(retryQueue)); + } } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ); + } catch (error$114) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$114); } + flags = finishedWork.updateQueue; + null !== flags && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, flags)); } break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - JSCompiler_inline_result; - (JSCompiler_inline_result = root.current.memoizedState.isDehydrated) && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !JSCompiler_inline_result) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; -} -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} -function commitRootWhenReady( - root, - finishedWork, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane -) { - 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); -} -function isRenderConsistentWithExternalStores(finishedWork) { - for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; + case 22: + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; + if (finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + root = finishedWork.stateNode; + root._current = finishedWork; + root._visibility &= -3; + root._visibility |= root._pendingVisibility & 2; if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) + flags & 8192 && + ((root._visibility = suspenseCallback + ? root._visibility & -2 + : root._visibility | 1), + suspenseCallback && + ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), + null === current || + retryQueue || + root || + (0 !== (finishedWork.mode & 1) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), + null === finishedWork.memoizedProps || + "manual" !== finishedWork.memoizedProps.mode) ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; + a: for (current = null, root = finishedWork; ; ) { + if (5 === root.tag) { + if (null === current) { + current = root; + try { + if (((newProps = root.stateNode), suspenseCallback)) + newProps.hide(); + else { + var props = root.memoizedProps; + (null == props.visible || props.visible) && + root.stateNode.show(); + } + } catch (error) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error + ); + } + } + } else if ( + 6 !== root.tag && + ((22 !== root.tag && 23 !== root.tag) || + null === root.memoizedState || + root === finishedWork) && + null !== root.child + ) { + root.child.return = root; + root = root.child; + continue; + } + if (root === finishedWork) break a; + for (; null === root.sibling; ) { + if (null === root.return || root.return === finishedWork) break a; + current === root && (current = null); + root = root.return; } + current === root && (current = null); + root.sibling.return = root.return; + root = root.sibling; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); - else { - if (node === finishedWork) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === finishedWork) return !0; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - } - return !0; -} -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - enableInfiniteRenderLoopDetection && - (executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), - throwIfInfiniteUpdateLoopDetected()); -} -function markRootSuspended(root, suspendedLanes, spawnedLane) { - suspendedLanes &= ~workInProgressRootPingedLanes; - suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; - root.suspendedLanes |= suspendedLanes; - root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4; - expirationTimes[index$4] = -1; - lanes &= ~lane; - } - 0 !== spawnedLane && - markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); -} -function resetWorkInProgressStack() { - if (null !== workInProgress) { - if (0 === workInProgressSuspendedReason) - var interruptedWork = workInProgress.return; - else - (interruptedWork = workInProgress), - resetContextDependencies(), - resetHooksOnUnwind(interruptedWork), - (thenableState$1 = null), - (thenableIndexCounter$1 = 0), - (interruptedWork = workInProgress); - for (; null !== interruptedWork; ) - unwindInterruptedWork(interruptedWork.alternate, interruptedWork), - (interruptedWork = interruptedWork.return); - workInProgress = null; + flags & 4 && + ((flags = finishedWork.updateQueue), + null !== flags && + ((current = flags.retryQueue), + null !== current && + ((flags.retryQueue = null), + attachSuspenseRetryListeners(finishedWork, current)))); + break; + case 19: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((flags = finishedWork.updateQueue), + null !== flags && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, flags))); + break; + case 21: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + (null !== current && safelyDetachRef(finishedWork, finishedWork.return), + safelyAttachRef(finishedWork, finishedWork.return)); + flags & 4 && shim$1(); + break; + default: + recursivelyTraverseMutationEffects(root, finishedWork), + commitReconciliationEffects(finishedWork); } } -function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; - var timeoutHandle = root.timeoutHandle; - -1 !== timeoutHandle && - ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); - timeoutHandle = root.cancelPendingCommit; - null !== timeoutHandle && - ((root.cancelPendingCommit = null), timeoutHandle()); - resetWorkInProgressStack(); - workInProgressRoot = root; - workInProgress = timeoutHandle = createWorkInProgress(root.current, null); - workInProgressRootRenderLanes = lanes; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressRootExitStatus = 0; - workInProgressRootFatalError = null; - workInProgressDeferredLane = - workInProgressRootPingedLanes = - workInProgressRootInterleavedUpdatedLanes = - workInProgressRootSkippedLanes = - 0; - workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = - null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); - var allEntangledLanes = root.entangledLanes; - if (0 !== allEntangledLanes) - for ( - root = root.entanglements, allEntangledLanes &= lanes; - 0 < allEntangledLanes; - - ) { - var index$2 = 31 - clz32(allEntangledLanes), - lane = 1 << index$2; - lanes |= root[index$2]; - allEntangledLanes &= ~lane; - } - entangledRenderLanes = lanes; - finishQueueingConcurrentUpdates(); - return timeoutHandle; -} -function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; - ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - ReactCurrentOwner.current = null; - thrownValue === SuspenseException - ? ((thrownValue = getSuspendedThenable()), - (root = suspenseHandlerStackCursor.current), - (workInProgressSuspendedReason = - (null !== root && - ((workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - root !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 3 - : 2)) - : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = 4)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? 8 - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); - workInProgressThrownValue = thrownValue; - null === workInProgress && - ((workInProgressRootExitStatus = 1), - (workInProgressRootFatalError = thrownValue)); -} -function pushDispatcher() { - var prevDispatcher = ReactCurrentDispatcher.current; - ReactCurrentDispatcher.current = ContextOnlyDispatcher; - return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; -} -function pushCacheDispatcher() { - var prevCacheDispatcher = ReactCurrentCache.current; - ReactCurrentCache.current = DefaultCacheDispatcher; - return prevCacheDispatcher; -} -function renderDidSuspendDelayIfPossible() { - workInProgressRootExitStatus = 4; - (0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || - null === workInProgressRoot || - markRootSuspended( - workInProgressRoot, - workInProgressRootRenderLanes, - workInProgressDeferredLane - ); -} -function renderRootSync(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevCacheDispatcher = pushCacheDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), - prepareFreshStack(root, lanes); - lanes = !1; - a: do +function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + if (flags & 2) { try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; - switch (workInProgressSuspendedReason) { - case 8: - resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var JSCompiler_inline_result = parent; break a; - case 3: - case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + } + parent = parent.return; } + throw Error(formatProdErrorMessage(160)); + } + switch (JSCompiler_inline_result.tag) { + case 27: + case 5: + var parent$jscomp$0 = JSCompiler_inline_result.stateNode; + JSCompiler_inline_result.flags & 32 && + (JSCompiler_inline_result.flags &= -33); + var before = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); + break; + case 3: + case 4: + var parent$104 = JSCompiler_inline_result.stateNode.containerInfo, + before$105 = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + before$105, + parent$104 + ); + break; + default: + throw Error(formatProdErrorMessage(161)); } - workLoopSync(); - break; - } catch (thrownValue$128) { - handleThrow(root, thrownValue$128); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - while (1); - lanes && root.shellSuspendCounter++; - resetContextDependencies(); - executionContext = prevExecutionContext; - ReactCurrentDispatcher.current = prevDispatcher; - ReactCurrentCache.current = prevCacheDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + finishedWork.flags &= -3; + } + flags & 4096 && (finishedWork.flags &= -4097); } -function workLoopSync() { - for (; null !== workInProgress; ) performUnitOfWork(workInProgress); +function recursivelyTraverseLayoutEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 8772) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), + (parentFiber = parentFiber.sibling); } -function renderRootConcurrent(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevCacheDispatcher = pushCacheDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), - (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); - a: do - try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - lanes = workInProgress; - var thrownValue = workInProgressThrownValue; - b: switch (workInProgressSuspendedReason) { - case 1: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 2: - if (isThenableResolved(thrownValue)) { - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - replaySuspendedUnitOfWork(lanes); - break; - } - lanes = function () { - 2 === workInProgressSuspendedReason && - workInProgressRoot === root && - (workInProgressSuspendedReason = 7); - ensureRootIsScheduled(root); - }; - thrownValue.then(lanes, lanes); - break a; - case 3: - workInProgressSuspendedReason = 7; - break a; - case 4: - workInProgressSuspendedReason = 5; - break a; - case 7: - isThenableResolved(thrownValue) - ? ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - replaySuspendedUnitOfWork(lanes)) - : ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); - break; - case 5: - switch (workInProgress.tag) { - case 5: - case 26: - case 27: - lanes = workInProgress; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - var sibling = lanes.sibling; - if (null !== sibling) workInProgress = sibling; - else { - var returnFiber = lanes.return; - null !== returnFiber - ? ((workInProgress = returnFiber), - completeUnitOfWork(returnFiber)) - : (workInProgress = null); - } - break b; - } - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 6: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); - break; - case 8: - resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; - break a; - default: - throw Error(formatProdErrorMessage(462)); +function recursivelyTraverseDisappearLayoutEffects(parentFiber) { + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedWork = parentFiber; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + commitHookEffectListUnmount(4, finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 1: + safelyDetachRef(finishedWork, finishedWork.return); + var instance = finishedWork.stateNode; + if ("function" === typeof instance.componentWillUnmount) { + var current = finishedWork, + nearestMountedAncestor = finishedWork.return; + try { + var current$jscomp$0 = current; + instance.props = current$jscomp$0.memoizedProps; + instance.state = current$jscomp$0.memoizedState; + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 26: + case 27: + case 5: + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 22: + safelyDetachRef(finishedWork, finishedWork.return); + null === finishedWork.memoizedState && + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + default: + recursivelyTraverseDisappearLayoutEffects(finishedWork); + } + parentFiber = parentFiber.sibling; + } +} +function recursivelyTraverseReappearLayoutEffects( + finishedRoot$jscomp$0, + parentFiber, + includeWorkInProgressEffects +) { + includeWorkInProgressEffects = + includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + commitHookLayoutEffects(finishedWork, 4); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + var instance = finishedWork.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + finishedRoot = finishedWork.updateQueue; + if (null !== finishedRoot) { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); } + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 26: + case 27: + case 5: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 13: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; + } +} +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + try { + commitHookEffectListMount(hookFlags, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { + var previousCache = null; + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (previousCache = current.memoizedState.cachePool.pool); + current = null; + null !== finishedWork.memoizedState && + null !== finishedWork.memoizedState.cachePool && + (current = finishedWork.memoizedState.cachePool.pool); + current !== previousCache && + (null != current && current.refCount++, + null != previousCache && releaseCache(previousCache)); + if (enableTransitionTracing) { + current = finishedWork.updateQueue; + previousCache = null !== finishedWork.memoizedState; + if (null !== current) { + if (previousCache) { + var transitions = current.transitions; + null !== transitions && + transitions.forEach(function (transition) { + null === instance._transitions && + (instance._transitions = new Set()); + instance._transitions.add(transition); + }); + current = current.markerInstances; + null !== current && + current.forEach(function (markerInstance) { + var markerTransitions = markerInstance.transitions; + null !== markerTransitions && + markerTransitions.forEach(function (transition) { + null === instance._transitions + ? (instance._transitions = new Set()) + : instance._transitions.has(transition) && + (null === markerInstance.pendingBoundaries && + (markerInstance.pendingBoundaries = new Map()), + null === instance._pendingMarkers && + (instance._pendingMarkers = new Set()), + instance._pendingMarkers.add(markerInstance)); + }); + }); } - workLoopConcurrent(); - break; - } catch (thrownValue$130) { - handleThrow(root, thrownValue$130); + finishedWork.updateQueue = null; } - while (1); - resetContextDependencies(); - ReactCurrentDispatcher.current = prevDispatcher; - ReactCurrentCache.current = prevCacheDispatcher; - executionContext = prevExecutionContext; - if (null !== workInProgress) return 0; - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + commitTransitionProgress(finishedWork); + previousCache || + ((instance._transitions = null), (instance._pendingMarkers = null)); + } } -function workLoopConcurrent() { - for (; null !== workInProgress && !shouldYield(); ) - performUnitOfWork(workInProgress); +function commitCachePassiveMountEffect(current, finishedWork) { + current = null; + null !== finishedWork.alternate && + (current = finishedWork.alternate.memoizedState.cache); + finishedWork = finishedWork.memoizedState.cache; + finishedWork !== current && + (finishedWork.refCount++, null != current && releaseCache(current)); } -function performUnitOfWork(unitOfWork) { - var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); - ReactCurrentOwner.current = null; +function commitTracingMarkerPassiveMountEffect(finishedWork) { + var instance = finishedWork.stateNode; + null !== instance.transitions && + null === instance.pendingBoundaries && + (addMarkerCompleteCallbackToPendingTransition( + finishedWork.memoizedProps.name, + instance.transitions + ), + (instance.transitions = null), + (instance.pendingBoundaries = null), + (instance.aborts = null), + (instance.name = null)); } -function replaySuspendedUnitOfWork(unitOfWork) { - var current = unitOfWork.alternate; - switch (unitOfWork.tag) { - case 2: - unitOfWork.tag = 0; - case 15: +function recursivelyTraversePassiveMountEffects( + root, + parentFiber, + committedLanes, + committedTransitions +) { + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveMountOnFiber( + root, + parentFiber, + committedLanes, + committedTransitions + ), + (parentFiber = parentFiber.sibling); +} +function commitPassiveMountOnFiber( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions +) { + var flags = finishedWork.flags; + switch (finishedWork.tag) { case 0: - var Component = unitOfWork.type, - unresolvedProps = unitOfWork.pendingProps; - unresolvedProps = - unitOfWork.elementType === Component - ? unresolvedProps - : resolveDefaultProps(Component, unresolvedProps); - current = replayFunctionComponent( - current, - unitOfWork, - unresolvedProps, - Component, - void 0, - workInProgressRootRenderLanes + case 11: + case 15: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + break; + case 3: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + if (flags & 2048) { + flags = null; + null !== finishedWork.alternate && + (flags = finishedWork.alternate.memoizedState.cache); + var nextCache = finishedWork.memoizedState.cache; + nextCache !== flags && + (nextCache.refCount++, null != flags && releaseCache(flags)); + if (enableTransitionTracing) { + var incompleteTransitions = + finishedWork.stateNode.incompleteTransitions; + null !== committedTransitions && + (committedTransitions.forEach(function (transition) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: [], + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionStart && + (currentPendingTransitionCallbacks.transitionStart = []), + currentPendingTransitionCallbacks.transitionStart.push( + transition + )); + }), + clearTransitionsForLanes(finishedRoot, committedLanes)); + incompleteTransitions.forEach(function (markerInstance, transition) { + var pendingBoundaries = markerInstance.pendingBoundaries; + if (null === pendingBoundaries || 0 === pendingBoundaries.size) + null === markerInstance.aborts && + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: [], + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionComplete && + (currentPendingTransitionCallbacks.transitionComplete = []), + currentPendingTransitionCallbacks.transitionComplete.push( + transition + )), + incompleteTransitions.delete(transition); + }); + clearTransitionsForLanes(finishedRoot, committedLanes); + } + } + break; + case 23: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 22: + nextCache = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + nextCache + ); break; - case 11: - Component = unitOfWork.type.render; - unresolvedProps = unitOfWork.pendingProps; - unresolvedProps = - unitOfWork.elementType === Component - ? unresolvedProps - : resolveDefaultProps(Component, unresolvedProps); - current = replayFunctionComponent( - current, - unitOfWork, - unresolvedProps, - Component, - unitOfWork.ref, - workInProgressRootRenderLanes + case 24: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions ); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; - case 5: - resetHooksOnUnwind(unitOfWork); + case 25: + if (enableTransitionTracing) { + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + flags & 2048 && commitTracingMarkerPassiveMountEffect(finishedWork); + break; + } default: - unwindInterruptedWork(current, unitOfWork), - (unitOfWork = workInProgress = - resetWorkInProgress(unitOfWork, entangledRenderLanes)), - (current = beginWork(current, unitOfWork, entangledRenderLanes)); - } - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === current - ? completeUnitOfWork(unitOfWork) - : (workInProgress = current); - ReactCurrentOwner.current = null; -} -function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { - resetContextDependencies(); - resetHooksOnUnwind(unitOfWork); - thenableState$1 = null; - thenableIndexCounter$1 = 0; - var returnFiber = unitOfWork.return; - try { - if ( - throwException( - root, - returnFiber, - unitOfWork, - thrownValue, - workInProgressRootRenderLanes - ) - ) { - workInProgressRootExitStatus = 1; - workInProgressRootFatalError = thrownValue; - workInProgress = null; - return; - } - } catch (error) { - if (null !== returnFiber) throw ((workInProgress = returnFiber), error); - workInProgressRootExitStatus = 1; - workInProgressRootFatalError = thrownValue; - workInProgress = null; - return; + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); -} -function completeUnitOfWork(unitOfWork) { - var completedWork = unitOfWork; - do { - unitOfWork = completedWork.return; - var next = completeWork( - completedWork.alternate, - completedWork, - entangledRenderLanes - ); - if (null !== next) { - workInProgress = next; - return; - } - completedWork = completedWork.sibling; - if (null !== completedWork) { - workInProgress = completedWork; - return; - } - workInProgress = completedWork = unitOfWork; - } while (null !== completedWork); - 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane +function recursivelyTraverseReconnectPassiveEffects( + finishedRoot$jscomp$0, + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + includeWorkInProgressEffects ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; - try { - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactCurrentBatchConfig.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + includeWorkInProgressEffects = + includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + commitHookPassiveMountEffects(finishedWork, 8); + break; + case 23: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 22: + var instance$120 = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? instance$120._visibility & 4 + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ) + : finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((instance$120._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$120._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + instance$120 + ); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + case 25: + if (enableTransitionTracing) { + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + flags & 2048 && + commitTracingMarkerPassiveMountEffect(finishedWork); + break; + } + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; } - return null; } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane +function recursivelyTraverseAtomicPassiveEffects( + finishedRoot$jscomp$0, + parentFiber ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); - return null; - })); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactCurrentBatchConfig.transition; - ReactCurrentBatchConfig.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactCurrentBatchConfig.transition = transitions; - } else root.current = finishedWork; - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (transitions = { - digest: remainingLanes.digest, - componentStack: remainingLanes.stack - }), - renderPriorityLevel(remainingLanes.value, transitions); - if (hasUncaughtError) - throw ( - ((hasUncaughtError = !1), - (root = firstUncaughtError), - (firstUncaughtError = null), - root) - ); - 0 !== (pendingPassiveEffectsLanes & 3) && - 0 !== root.tag && - flushPassiveEffects(); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); - return null; + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork, + finishedWork.stateNode + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + default: + recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + } + parentFiber = parentFiber.sibling; + } } -function releaseRootPooledCache(root, remainingLanes) { - 0 === (root.pooledCacheLanes &= remainingLanes) && - ((remainingLanes = root.pooledCache), - null != remainingLanes && - ((root.pooledCache = null), releaseCache(remainingLanes))); +var suspenseyCommitFlag = 8192; +function recursivelyAccumulateSuspenseyCommit(parentFiber) { + if (parentFiber.subtreeFlags & suspenseyCommitFlag) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + accumulateSuspenseyCommitOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); } -function flushPassiveEffects() { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig.transition, - previousPriority = currentUpdatePriority; - try { - return ( - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = renderPriority), - flushPassiveEffectsImpl() - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactCurrentBatchConfig.transition = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } +function accumulateSuspenseyCommitOnFiber(fiber) { + switch (fiber.tag) { + case 26: + recursivelyAccumulateSuspenseyCommit(fiber); + if (fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState) + throw Error(formatProdErrorMessage(442)); + break; + case 5: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 3: + case 4: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 22: + if (null === fiber.memoizedState) { + var current = fiber.alternate; + null !== current && null !== current.memoizedState + ? ((current = suspenseyCommitFlag), + (suspenseyCommitFlag = 16777216), + recursivelyAccumulateSuspenseyCommit(fiber), + (suspenseyCommitFlag = current)) + : recursivelyAccumulateSuspenseyCommit(fiber); + } + break; + default: + recursivelyAccumulateSuspenseyCommit(fiber); } - return !1; } -function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; - var transitions = pendingPassiveTransitions; - pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); - var prevExecutionContext = executionContext; - executionContext |= 4; - commitPassiveUnmountOnFiber(root.current); - commitPassiveMountOnFiber(root, root.current, lanes, transitions); - executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); - if (enableTransitionTracing) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, - prevRootTransitionCallbacks = root.transitionCallbacks, - prevEndTime = currentEndTime; - null !== prevPendingTransitionCallbacks && - null !== prevRootTransitionCallbacks && - null !== prevEndTime && - ((currentEndTime = currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - prevEndTime, - prevRootTransitionCallbacks +function detachAlternateSiblings(parentFiber) { + var previousFiber = parentFiber.alternate; + if ( + null !== previousFiber && + ((parentFiber = previousFiber.child), null !== parentFiber) + ) { + previousFiber.child = null; + do + (previousFiber = parentFiber.sibling), + (parentFiber.sibling = null), + (parentFiber = previousFiber); + while (null !== parentFiber); + } +} +function recursivelyTraversePassiveUnmountEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber ); - })); + } + detachAlternateSiblings(parentFiber); } - if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) - try { - injectedHook.onPostCommitFiberRoot(rendererID, root); - } catch (err) {} - return !0; + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveUnmountOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); } -function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); - null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); +function commitPassiveUnmountOnFiber(finishedWork) { + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.flags & 2048 && + commitHookEffectListUnmount(9, finishedWork, finishedWork.return); + break; + case 22: + var instance = finishedWork.stateNode; + null !== finishedWork.memoizedState && + instance._visibility & 4 && + (null === finishedWork.return || 13 !== finishedWork.return.tag) + ? ((instance._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(finishedWork)) + : recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + default: + recursivelyTraversePassiveUnmountEffects(finishedWork); + } } -function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { - if (3 === sourceFiber.tag) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); - else - for (; null !== nearestMountedAncestor; ) { - if (3 === nearestMountedAncestor.tag) { - captureCommitPhaseErrorOnRoot( - nearestMountedAncestor, - sourceFiber, - error +function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber ); - break; - } else if (1 === nearestMountedAncestor.tag) { - var instance = nearestMountedAncestor.stateNode; - if ( - "function" === - typeof nearestMountedAncestor.type.getDerivedStateFromError || - ("function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance))) - ) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createClassErrorUpdate( - nearestMountedAncestor, - sourceFiber, - 2 - ); - nearestMountedAncestor = enqueueUpdate( - nearestMountedAncestor, - sourceFiber, - 2 - ); - null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), - ensureRootIsScheduled(nearestMountedAncestor)); - break; - } } - nearestMountedAncestor = nearestMountedAncestor.return; + detachAlternateSiblings(parentFiber); + } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + deletions = parentFiber; + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(8, deletions, deletions.return); + recursivelyTraverseDisconnectPassiveEffects(deletions); + break; + case 22: + i = deletions.stateNode; + i._visibility & 4 && + ((i._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(deletions)); + break; + default: + recursivelyTraverseDisconnectPassiveEffects(deletions); } + parentFiber = parentFiber.sibling; + } } -function attachPingListener(root, wakeable, lanes) { - var pingCache = root.pingCache; - if (null === pingCache) { - pingCache = root.pingCache = new PossiblyWeakMap(); - var threadIDs = new Set(); - pingCache.set(wakeable, threadIDs); - } else - (threadIDs = pingCache.get(wakeable)), - void 0 === threadIDs && - ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); - threadIDs.has(lanes) || - ((workInProgressRootDidAttachPingListener = !0), - threadIDs.add(lanes), - (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), - wakeable.then(root, root)); -} -function pingSuspendedRoot(root, wakeable, pingedLanes) { - var pingCache = root.pingCache; - null !== pingCache && pingCache.delete(wakeable); - root.pingedLanes |= root.suspendedLanes & pingedLanes; - enableInfiniteRenderLoopDetection && - (executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), - throwIfInfiniteUpdateLoopDetected()); - workInProgressRoot === root && - (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && - (4 === workInProgressRootExitStatus || - (3 === workInProgressRootExitStatus && - (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes && - 300 > now() - globalMostRecentFallbackTime) - ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); - ensureRootIsScheduled(root); +function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + deletedSubtreeRoot, + nearestMountedAncestor$jscomp$0 +) { + for (; null !== nextEffect; ) { + var fiber = nextEffect, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(8, fiber, nearestMountedAncestor); + break; + case 23: + case 22: + null !== fiber.memoizedState && + null !== fiber.memoizedState.cachePool && + ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), + null != nearestMountedAncestor && nearestMountedAncestor.refCount++); + break; + case 13: + if (enableTransitionTracing) { + var offscreenFiber = fiber.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: fiber.memoizedProps.unstable_name || null + }; + if ( + null === fiber.memoizedState || + null === fiber.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } + } + break; + case 24: + releaseCache(fiber.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = fiber.stateNode.transitions), + null !== offscreenFiber && + ((instance = { reason: "marker", name: fiber.memoizedProps.name }), + abortParentMarkerTransitionsForDeletedFiber( + fiber, + instance, + offscreenFiber, + null, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + nearestMountedAncestor = fiber.child; + if (null !== nearestMountedAncestor) + (nearestMountedAncestor.return = fiber), + (nextEffect = nearestMountedAncestor); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + nearestMountedAncestor = nextEffect; + offscreenFiber = nearestMountedAncestor.sibling; + instance = nearestMountedAncestor.return; + detachFiberAfterEffects(nearestMountedAncestor); + if (nearestMountedAncestor === fiber) { + nextEffect = null; + break a; + } + if (null !== offscreenFiber) { + offscreenFiber.return = instance; + nextEffect = offscreenFiber; + break a; + } + nextEffect = instance; + } + } } -function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && - (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); - boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); - null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), - ensureRootIsScheduled(boundaryFiber)); +var DefaultCacheDispatcher = { + getCacheSignal: function () { + return readContext(CacheContext).controller.signal; + }, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentCache = ReactSharedInternals.ReactCurrentCache, + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + workInProgressSuspendedReason = 0, + workInProgressThrownValue = null, + workInProgressRootDidAttachPingListener = !1, + entangledRenderLanes = 0, + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootInterleavedUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + workInProgressDeferredLane = 0, + workInProgressRootConcurrentErrors = null, + workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + workInProgressTransitions = null, + currentPendingTransitionCallbacks = null, + currentEndTime = null; +function addMarkerProgressCallbackToPendingTransition( + markerName, + transitions, + pendingBoundaries +) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: new Map(), + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.markerProgress && + (currentPendingTransitionCallbacks.markerProgress = new Map()), + currentPendingTransitionCallbacks.markerProgress.set(markerName, { + pendingBoundaries: pendingBoundaries, + transitions: transitions + })); } -function retryDehydratedSuspenseBoundary(boundaryFiber) { - var suspenseState = boundaryFiber.memoizedState, - retryLane = 0; - null !== suspenseState && (retryLane = suspenseState.retryLane); - retryTimedOutBoundary(boundaryFiber, retryLane); +function addMarkerCompleteCallbackToPendingTransition(markerName, transitions) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: null, + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: new Map() + }), + null === currentPendingTransitionCallbacks.markerComplete && + (currentPendingTransitionCallbacks.markerComplete = new Map()), + currentPendingTransitionCallbacks.markerComplete.set( + markerName, + transitions + )); } -function resolveRetryWakeable(boundaryFiber, wakeable) { - var retryLane = 0; - switch (boundaryFiber.tag) { - case 13: - var retryCache = boundaryFiber.stateNode; - var suspenseState = boundaryFiber.memoizedState; - null !== suspenseState && (retryLane = suspenseState.retryLane); - break; - case 19: - retryCache = boundaryFiber.stateNode; - break; - case 22: - retryCache = boundaryFiber.stateNode._retryCache; - break; - default: - throw Error(formatProdErrorMessage(314)); - } - null !== retryCache && retryCache.delete(wakeable); - retryTimedOutBoundary(boundaryFiber, retryLane); +function addTransitionProgressCallbackToPendingTransition( + transition, + boundaries +) { + enableTransitionTracing && + (null === currentPendingTransitionCallbacks && + (currentPendingTransitionCallbacks = { + transitionStart: null, + transitionProgress: new Map(), + transitionComplete: null, + markerProgress: null, + markerIncomplete: null, + markerComplete: null + }), + null === currentPendingTransitionCallbacks.transitionProgress && + (currentPendingTransitionCallbacks.transitionProgress = new Map()), + currentPendingTransitionCallbacks.transitionProgress.set( + transition, + boundaries + )); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - enableInfiniteRenderLoopDetection && - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) +var hasUncaughtError = !1, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = !1, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveTransitions = null, + nestedUpdateCount = 0, + rootWithNestedUpdates = null; +function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 2; + if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) + return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (null !== requestCurrentTransition()) + return ( + (fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane() ); + fiber = currentUpdatePriority; + return 0 !== fiber ? fiber : 32; } -var beginWork; -beginWork = function (current, workInProgress, renderLanes) { - if (null !== current) - if (current.memoizedProps !== workInProgress.pendingProps) - didReceiveUpdate = !0; - else { +function requestDeferredLane() { + 0 === workInProgressDeferredLane && + (workInProgressDeferredLane = + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 + : claimNextTransitionLane()); + var suspenseHandler = suspenseHandlerStackCursor.current; + null !== suspenseHandler && (suspenseHandler.flags |= 32); + return workInProgressDeferredLane; +} +function scheduleUpdateOnFiber(root, fiber, lane) { + if ( + (root === workInProgressRoot && 2 === workInProgressSuspendedReason) || + null !== root.cancelPendingCommit + ) + prepareFreshStack(root, 0), + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane + ); + markRootUpdated(root, lane); + if (0 === (executionContext & 2) || root !== workInProgressRoot) { + if (enableTransitionTracing) { + var transition = ReactCurrentBatchConfig.transition; if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$7 = 31 - clz32(lane), + transitions = transitionLanesMap[index$7]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$7] = transitions; + } } - else didReceiveUpdate = !1; - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - void 0, - renderLanes - ); - workInProgress.flags |= 1; - workInProgress.tag = 0; - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; - case 16: - Component = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var init = Component._init; - Component = init(Component._payload); - workInProgress.type = Component; - init = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (init) { - case 0: - workInProgress = updateFunctionComponent( - null, - workInProgress, - Component, - current, - renderLanes - ); - break a; - case 1: - workInProgress = updateClassComponent( - null, - workInProgress, - Component, - current, - renderLanes - ); - break a; - case 11: - workInProgress = updateForwardRef( - null, - workInProgress, - Component, - current, - renderLanes + root === workInProgressRoot && + (0 === (executionContext & 2) && + (workInProgressRootInterleavedUpdatedLanes |= lane), + 4 === workInProgressRootExitStatus && + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane + )); + ensureRootIsScheduled(root); + 2 === lane && + 0 === executionContext && + 0 === (fiber.mode & 1) && + ((workInProgressRootRenderTargetTime = now() + 500), + flushSyncWorkAcrossRoots_impl(!0)); + } +} +function performConcurrentWorkOnRoot(root, didTimeout) { + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var lanes = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes : 0 + ); + if (0 === lanes) return null; + var exitStatus = (didTimeout = + !includesBlockingLane(root, lanes) && + 0 === (lanes & root.expiredLanes) && + (disableSchedulerTimeoutInWorkLoop || !didTimeout)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); + if (0 !== exitStatus) { + var renderWasConcurrent = didTimeout; + do { + if (6 === exitStatus) markRootSuspended(root, lanes, 0); + else { + didTimeout = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(didTimeout) + ) { + exitStatus = renderRootSync(root, lanes); + renderWasConcurrent = !1; + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + var errorRetryLanes = getLanesToRetrySynchronouslyOnError( + root, + renderWasConcurrent + ); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), + (exitStatus = recoverFromConcurrentError( + root, + renderWasConcurrent, + errorRetryLanes + ))); + } + if (1 === exitStatus) + throw ( + ((originalCallbackNode = workInProgressRootFatalError), + prepareFreshStack(root, 0), + markRootSuspended(root, lanes, 0), + ensureRootIsScheduled(root), + originalCallbackNode) + ); + root.finishedWork = didTimeout; + root.finishedLanes = lanes; + a: { + renderWasConcurrent = root; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === exitStatus) && + ((exitStatus = globalMostRecentFallbackTime + 300 - now()), + 10 < exitStatus) + ) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane ); - break a; - case 14: - workInProgress = updateMemoComponent( - null, - workInProgress, - Component, - resolveDefaultProps(Component.type, current), - renderLanes + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + didTimeout, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane + ), + exitStatus ); break a; - } - throw Error(formatProdErrorMessage(306, Component, "")); - } - return workInProgress; - case 0: - return ( - (Component = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === Component - ? init - : resolveDefaultProps(Component, init)), - updateFunctionComponent( - current, - workInProgress, - Component, - init, - renderLanes - ) - ); - case 1: - return ( - (Component = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === Component - ? init - : resolveDefaultProps(Component, init)), - updateClassComponent( - current, - workInProgress, - Component, - init, - renderLanes - ) - ); - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - Component = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - nextProps = workInProgress.memoizedState; - enableTransitionTracing && - push(transitionStack, workInProgressTransitions); - enableTransitionTracing && pushRootMarkerInstance(workInProgress); - var nextCache = nextProps.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === Component - ? (workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )) - : (reconcileChildren(current, workInProgress, init, renderLanes), - (workInProgress = workInProgress.child)); - return workInProgress; - case 26: - case 27: - case 5: - return ( - pushHostContext(workInProgress), - (init = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextCache = null !== current ? current.memoizedProps : null), - (Component = nextProps.children), - shouldSetTextContent(init, nextProps) - ? (Component = null) - : null !== nextCache && - shouldSetTextContent(init, nextCache) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue2 = init), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== init && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 6: - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (Component = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - )) - : reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 11: - return ( - (Component = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === Component - ? init - : resolveDefaultProps(Component, init)), - updateForwardRef(current, workInProgress, Component, init, renderLanes) - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: + } + commitRootWhenReady( + renderWasConcurrent, + didTimeout, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane + ); + } + } + break; + } while (1); + } + ensureRootIsScheduled(root); + scheduleTaskForRootDuringMicrotask(root, now()); + root = + root.callbackNode === originalCallbackNode + ? performConcurrentWorkOnRoot.bind(null, root) + : null; + return root; +} +function recoverFromConcurrentError( + root, + originallyAttemptedLanes, + errorRetryLanes +) { + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, + JSCompiler_inline_result; + (JSCompiler_inline_result = root.current.memoizedState.isDehydrated) && + (prepareFreshStack(root, errorRetryLanes).flags |= 256); + errorRetryLanes = renderRootSync(root, errorRetryLanes); + if (2 !== errorRetryLanes) { + if (workInProgressRootDidAttachPingListener && !JSCompiler_inline_result) return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), + (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), + 4 ); - case 12: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + root = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorsFromFirstAttempt; + null !== root && queueRecoverableErrors(root); + } + return errorRetryLanes; +} +function queueRecoverableErrors(errors) { + null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = errors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + errors ); - case 10: - a: { - Component = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - init = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, Component, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if (nextProps.children === init.children) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; +} +function commitRootWhenReady( + root, + finishedWork, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane +) { + 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); +} +function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork; ; ) { + if (node.flags & 16384) { + var updateQueue = node.updateQueue; + if ( + null !== updateQueue && + ((updateQueue = updateQueue.stores), null !== updateQueue) + ) + for (var i = 0; i < updateQueue.length; i++) { + var check = updateQueue[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + } + updateQueue = node.child; + if (node.subtreeFlags & 16384 && null !== updateQueue) + (updateQueue.return = node), (node = updateQueue); + else { + if (node === finishedWork) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return !0; +} +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} +function markRootSuspended(root, suspendedLanes, spawnedLane) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4; + expirationTimes[index$4] = -1; + lanes &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); +} +function resetWorkInProgressStack() { + if (null !== workInProgress) { + if (0 === workInProgressSuspendedReason) + var interruptedWork = workInProgress.return; + else + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), + (thenableState$1 = null), + (thenableIndexCounter$1 = 0), + (interruptedWork = workInProgress); + for (; null !== interruptedWork; ) + unwindInterruptedWork(interruptedWork.alternate, interruptedWork), + (interruptedWork = interruptedWork.return); + workInProgress = null; + } +} +function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = 0; + var timeoutHandle = root.timeoutHandle; + -1 !== timeoutHandle && + ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); + timeoutHandle = root.cancelPendingCommit; + null !== timeoutHandle && + ((root.cancelPendingCommit = null), timeoutHandle()); + resetWorkInProgressStack(); + workInProgressRoot = root; + workInProgress = timeoutHandle = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = lanes; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + workInProgressRootDidAttachPingListener = !1; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressDeferredLane = + workInProgressRootPingedLanes = + workInProgressRootInterleavedUpdatedLanes = + workInProgressRootSkippedLanes = + 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = + null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; + 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + var allEntangledLanes = root.entangledLanes; + if (0 !== allEntangledLanes) + for ( + root = root.entanglements, allEntangledLanes &= lanes; + 0 < allEntangledLanes; + + ) { + var index$2 = 31 - clz32(allEntangledLanes), + lane = 1 << index$2; + lanes |= root[index$2]; + allEntangledLanes &= ~lane; + } + entangledRenderLanes = lanes; + finishQueueingConcurrentUpdates(); + return timeoutHandle; +} +function handleThrow(root, thrownValue) { + currentlyRenderingFiber$1 = null; + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + ReactCurrentOwner.current = null; + thrownValue === SuspenseException + ? ((thrownValue = getSuspendedThenable()), + (root = suspenseHandlerStackCursor.current), + (workInProgressSuspendedReason = + (null !== root && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + root !== shellBoundary)) || + 0 !== (workInProgressRootSkippedLanes & 134217727) || + 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? 3 + : 2)) + : thrownValue === SuspenseyCommitException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = 4)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? 8 + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); + workInProgressThrownValue = thrownValue; + null === workInProgress && + ((workInProgressRootExitStatus = 1), + (workInProgressRootFatalError = thrownValue)); +} +function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; +} +function pushCacheDispatcher() { + var prevCacheDispatcher = ReactCurrentCache.current; + ReactCurrentCache.current = DefaultCacheDispatcher; + return prevCacheDispatcher; +} +function renderDidSuspendDelayIfPossible() { + workInProgressRootExitStatus = 4; + (0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || + null === workInProgressRoot || + markRootSuspended( + workInProgressRoot, + workInProgressRootRenderLanes, + workInProgressDeferredLane + ); +} +function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevCacheDispatcher = pushCacheDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) + (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + prepareFreshStack(root, lanes); + lanes = !1; + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) { + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; + switch (workInProgressSuspendedReason) { + case 8: + resetWorkInProgressStack(); + workInProgressRootExitStatus = 6; + break a; + case 3: + case 2: + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + } + } + workLoopSync(); + break; + } catch (thrownValue$128) { + handleThrow(root, thrownValue$128); + } + while (1); + lanes && root.shellSuspendCounter++; + resetContextDependencies(); + executionContext = prevExecutionContext; + ReactCurrentDispatcher.current = prevDispatcher; + ReactCurrentCache.current = prevCacheDispatcher; + if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; +} +function workLoopSync() { + for (; null !== workInProgress; ) performUnitOfWork(workInProgress); +} +function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevCacheDispatcher = pushCacheDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) + (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + (workInProgressRootRenderTargetTime = now() + 500), + prepareFreshStack(root, lanes); + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) { + lanes = workInProgress; + var thrownValue = workInProgressThrownValue; + b: switch (workInProgressSuspendedReason) { + case 1: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 2: + if (isThenableResolved(thrownValue)) { + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + replaySuspendedUnitOfWork(lanes); + break; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); - workInProgress = workInProgress.child; + lanes = function () { + 2 === workInProgressSuspendedReason && + workInProgressRoot === root && + (workInProgressSuspendedReason = 7); + ensureRootIsScheduled(root); + }; + thrownValue.then(lanes, lanes); + break a; + case 3: + workInProgressSuspendedReason = 7; + break a; + case 4: + workInProgressSuspendedReason = 5; + break a; + case 7: + isThenableResolved(thrownValue) + ? ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + replaySuspendedUnitOfWork(lanes)) + : ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, lanes, thrownValue)); + break; + case 5: + switch (workInProgress.tag) { + case 5: + case 26: + case 27: + lanes = workInProgress; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + var sibling = lanes.sibling; + if (null !== sibling) workInProgress = sibling; + else { + var returnFiber = lanes.return; + null !== returnFiber + ? ((workInProgress = returnFiber), + completeUnitOfWork(returnFiber)) + : (workInProgress = null); + } + break b; + } + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 6: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, thrownValue); + break; + case 8: + resetWorkInProgressStack(); + workInProgressRootExitStatus = 6; + break a; + default: + throw Error(formatProdErrorMessage(462)); + } } - return workInProgress; - case 9: - return ( - (init = enableRenderableContext - ? workInProgress.type._context - : workInProgress.type), - (Component = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (Component = Component(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child - ); - case 14: - return ( - (Component = workInProgress.type), - (init = resolveDefaultProps(Component, workInProgress.pendingProps)), - (init = resolveDefaultProps(Component.type, init)), - updateMemoComponent( - current, - workInProgress, - Component, - init, - renderLanes - ) - ); + workLoopConcurrent(); + break; + } catch (thrownValue$130) { + handleThrow(root, thrownValue$130); + } + while (1); + resetContextDependencies(); + ReactCurrentDispatcher.current = prevDispatcher; + ReactCurrentCache.current = prevCacheDispatcher; + executionContext = prevExecutionContext; + if (null !== workInProgress) return 0; + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; +} +function workLoopConcurrent() { + for (; null !== workInProgress && !shouldYield(); ) + performUnitOfWork(workInProgress); +} +function performUnitOfWork(unitOfWork) { + var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); + ReactCurrentOwner.current = null; +} +function replaySuspendedUnitOfWork(unitOfWork) { + var current = unitOfWork.alternate; + switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (Component = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === Component - ? init - : resolveDefaultProps(Component, init)), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, init), - mountClassInstance(workInProgress, Component, init, renderLanes), - finishClassComponent( - null, - workInProgress, - Component, - !0, - !1, - renderLanes - ) + case 0: + var Component = unitOfWork.type, + unresolvedProps = unitOfWork.pendingProps; + unresolvedProps = + unitOfWork.elementType === Component + ? unresolvedProps + : resolveDefaultProps(Component, unresolvedProps); + current = replayFunctionComponent( + current, + unitOfWork, + unresolvedProps, + Component, + void 0, + workInProgressRootRenderLanes ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 21: - return ( - (Component = workInProgress.pendingProps.children), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), - workInProgress.child + break; + case 11: + Component = unitOfWork.type.render; + unresolvedProps = unitOfWork.pendingProps; + unresolvedProps = + unitOfWork.elementType === Component + ? unresolvedProps + : resolveDefaultProps(Component, unresolvedProps); + current = replayFunctionComponent( + current, + unitOfWork, + unresolvedProps, + Component, + unitOfWork.ref, + workInProgressRootRenderLanes ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 23: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + break; + case 5: + resetHooksOnUnwind(unitOfWork); + default: + unwindInterruptedWork(current, unitOfWork), + (unitOfWork = workInProgress = + resetWorkInProgress(unitOfWork, entangledRenderLanes)), + (current = beginWork(current, unitOfWork, entangledRenderLanes)); + } + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === current + ? completeUnitOfWork(unitOfWork) + : (workInProgress = current); + ReactCurrentOwner.current = null; +} +function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { + resetContextDependencies(); + resetHooksOnUnwind(unitOfWork); + thenableState$1 = null; + thenableIndexCounter$1 = 0; + var returnFiber = unitOfWork.return; + try { + if ( + throwException( + root, + returnFiber, + unitOfWork, + thrownValue, + workInProgressRootRenderLanes + ) + ) { + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + return; + } + } catch (error) { + if (null !== returnFiber) throw ((workInProgress = returnFiber), error); + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + return; + } + if (unitOfWork.flags & 32768) + a: { + root = unitOfWork; + do { + unitOfWork = unwindWork(root.alternate, root); + if (null !== unitOfWork) { + unitOfWork.flags &= 32767; + workInProgress = unitOfWork; + break a; + } + root = root.return; + null !== root && + ((root.flags |= 32768), + (root.subtreeFlags = 0), + (root.deletions = null)); + workInProgress = root; + } while (null !== root); + workInProgressRootExitStatus = 6; + workInProgress = null; + } + else completeUnitOfWork(unitOfWork); +} +function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + unitOfWork = completedWork.return; + var next = completeWork( + completedWork.alternate, + completedWork, + entangledRenderLanes + ); + if (null !== next) { + workInProgress = next; + return; + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); +} +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig.transition; + try { + (ReactCurrentBatchConfig.transition = null), + (currentUpdatePriority = 2), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + previousUpdateLanePriority, + spawnedLane + ); + } finally { + (ReactCurrentBatchConfig.transition = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + return null; +} +function commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + renderPriorityLevel, + spawnedLane +) { + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; + if (null === finishedWork) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + root.callbackNode = null; + root.callbackPriority = 0; + root.cancelPendingCommit = null; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || + rootDoesHavePassiveEffects || + ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(); + return null; + })); + transitions = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactCurrentBatchConfig.transition; + ReactCurrentBatchConfig.transition = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + ReactCurrentOwner.current = null; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + requestPaint(); + executionContext = prevExecutionContext; + currentUpdatePriority = spawnedLane; + ReactCurrentBatchConfig.transition = transitions; + } else root.current = finishedWork; + rootDoesHavePassiveEffects + ? ((rootDoesHavePassiveEffects = !1), + (rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root, remainingLanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root); + if (null !== recoverableErrors) + for ( + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) + (remainingLanes = recoverableErrors[finishedWork]), + (transitions = { + digest: remainingLanes.digest, + componentStack: remainingLanes.stack + }), + renderPriorityLevel(remainingLanes.value, transitions); + if (hasUncaughtError) + throw ( + ((hasUncaughtError = !1), + (root = firstUncaughtError), + (firstUncaughtError = null), + root) + ); + 0 !== (pendingPassiveEffectsLanes & 3) && + 0 !== root.tag && + flushPassiveEffects(); + remainingLanes = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(!1); + return null; +} +function releaseRootPooledCache(root, remainingLanes) { + 0 === (root.pooledCacheLanes &= remainingLanes) && + ((remainingLanes = root.pooledCache), + null != remainingLanes && + ((root.pooledCache = null), releaseCache(remainingLanes))); +} +function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var root = rootWithPendingPassiveEffects, + remainingLanes = pendingPassiveEffectsRemainingLanes; + pendingPassiveEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactCurrentBatchConfig.transition, + previousPriority = currentUpdatePriority; + try { return ( - prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), - null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), - (nextProps = createCache()), - (init.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: Component, cache: init }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), - (nextProps = workInProgress.memoizedState), - init.parent !== Component - ? ((init = { parent: Component, cache: Component }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = nextProps.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== init.cache && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (ReactCurrentBatchConfig.transition = null), + (currentUpdatePriority = renderPriority), + flushPassiveEffectsImpl() ); - case 25: - if (enableTransitionTracing) - return ( - enableTransitionTracing - ? (null === current && - ((Component = enableTransitionTracing - ? transitionStack.current - : null), - null !== Component && - ((Component = { - tag: 1, - transitions: new Set(Component), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }), - (workInProgress.stateNode = Component), - (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - (workInProgress = workInProgress.child)) - : (workInProgress = null), - workInProgress + } finally { + (currentUpdatePriority = previousPriority), + (ReactCurrentBatchConfig.transition = prevTransition), + releaseRootPooledCache(root, remainingLanes); + } + } + return !1; +} +function flushPassiveEffectsImpl() { + if (null === rootWithPendingPassiveEffects) return !1; + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root = rootWithPendingPassiveEffects, + lanes = pendingPassiveEffectsLanes; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); + var prevExecutionContext = executionContext; + executionContext |= 4; + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); + executionContext = prevExecutionContext; + flushSyncWorkAcrossRoots_impl(!1); + if (enableTransitionTracing) { + var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, + prevRootTransitionCallbacks = root.transitionCallbacks, + prevEndTime = currentEndTime; + null !== prevPendingTransitionCallbacks && + null !== prevRootTransitionCallbacks && + null !== prevEndTime && + ((currentEndTime = currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + prevEndTime, + prevRootTransitionCallbacks ); + })); } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -}; + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) {} + return !0; +} +function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); + null !== rootFiber && + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); +} +function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + else + for (; null !== nearestMountedAncestor; ) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot( + nearestMountedAncestor, + sourceFiber, + error + ); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + if ( + "function" === + typeof nearestMountedAncestor.type.getDerivedStateFromError || + ("function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + ) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createClassErrorUpdate( + nearestMountedAncestor, + sourceFiber, + 2 + ); + nearestMountedAncestor = enqueueUpdate( + nearestMountedAncestor, + sourceFiber, + 2 + ); + null !== nearestMountedAncestor && + (markRootUpdated(nearestMountedAncestor, 2), + ensureRootIsScheduled(nearestMountedAncestor)); + break; + } + } + nearestMountedAncestor = nearestMountedAncestor.return; + } +} +function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else + (threadIDs = pingCache.get(wakeable)), + void 0 === threadIDs && + ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || + ((workInProgressRootDidAttachPingListener = !0), + threadIDs.add(lanes), + (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), + wakeable.then(root, root)); +} +function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); + workInProgressRoot === root && + (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && + (4 === workInProgressRootExitStatus || + (3 === workInProgressRootExitStatus && + (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes && + 300 > now() - globalMostRecentFallbackTime) + ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) + : (workInProgressRootPingedLanes |= pingedLanes)); + ensureRootIsScheduled(root); +} +function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && + (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); + boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + null !== boundaryFiber && + (markRootUpdated(boundaryFiber, retryLane), + ensureRootIsScheduled(boundaryFiber)); +} +function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); +} +function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + case 22: + retryCache = boundaryFiber.stateNode._retryCache; + break; + default: + throw Error(formatProdErrorMessage(314)); + } + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); +} +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + executionContext & 2 && + null !== workInProgressRoot && + (workInProgressRoot.errorRecoveryDisabledLanes |= + workInProgressRootRenderLanes), + Error(formatProdErrorMessage(185))) + ); +} function scheduleCallback(priorityLevel, callback) { return scheduleCallback$3(priorityLevel, callback); } @@ -10255,7 +10252,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-modern-86dc6ab7", + version: "18.3.0-www-modern-c405fc15", rendererPackageName: "react-art" }; var internals$jscomp$inline_1300 = { @@ -10286,7 +10283,7 @@ var internals$jscomp$inline_1300 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-86dc6ab7" + reconcilerVersion: "18.3.0-www-modern-c405fc15" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1301 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 2d10eb3a0d915..b14a2d0a5f97e 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -127,8 +127,6 @@ if (__DEV__) { disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, - replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, @@ -8161,11 +8159,6 @@ if (__DEV__) { didSuspendOrErrorDEV = true; } } - function didSuspendOrErrorWhileHydratingDEV() { - { - return didSuspendOrErrorDEV; - } - } function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; @@ -18757,25 +18750,8 @@ if (__DEV__) { if (true) { var source = errorInfo.source; var stack = errorInfo.stack; - var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling - // `preventDefault()` in window `error` handler. - // We record this information as an expando on the error. - - if (error != null && error._suppressLogging) { - if (boundary.tag === ClassComponent) { - // The error is recoverable and was silenced. - // Ignore it and don't print the stack addendum. - // This is handy for testing error boundaries without noise. - return; - } // The error is fatal. Since the silencing might have - // been accidental, we'll surface it anyway. - // However, the browser would have silenced the original error - // so we'll print it first, and then print the stack addendum. - - console["error"](error); // Don't transform to our wrapper - // For a more detailed description of this block, see: - // https://github.com/facebook/react/pull/13384 - } + var componentStack = stack !== null ? stack : ""; // TODO: There's no longer a way to silence these warnings e.g. for tests. + // See https://github.com/facebook/react/pull/13384 var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName @@ -18797,19 +18773,17 @@ if (__DEV__) { ("using the error boundary you provided, " + errorBoundaryName + "."); - } + } // In development, we provide our own message which includes the component stack + // in addition to the error. - var combinedMessage = - componentNameMessage + - "\n" + - componentStack + - "\n\n" + - ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - - console["error"](combinedMessage); // Don't transform to our wrapper + console["error"]( + // Don't transform to our wrapper + "%o\n\n%s\n%s\n\n%s", + error, + componentNameMessage, + componentStack, + errorBoundaryMessage + ); } } catch (e) { // This method must not throw, or React internal state will get messed up. @@ -23155,7 +23129,7 @@ if (__DEV__) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } - function beginWork$1(current, workInProgress, renderLanes) { + function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. @@ -26172,113 +26146,6 @@ if (__DEV__) { } } - // Provided by www - var ReactFbErrorUtils = require("ReactFbErrorUtils"); - - if (typeof ReactFbErrorUtils.invokeGuardedCallback !== "function") { - throw new Error( - "Expected ReactFbErrorUtils.invokeGuardedCallback to be a function." - ); - } - - function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { - // This will call `this.onError(err)` if an error was caught. - ReactFbErrorUtils.invokeGuardedCallback.apply(this, arguments); - } - - var hasError = false; - var caughtError = null; // Used by event system to capture/rethrow the first error. - - var hasRethrowError = false; - var rethrowError = null; - var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } - }; - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl.apply(reporter, arguments); - } - /** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if caughtError and rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallbackAndCatchFirstError( - name, - func, - context, - a, - b, - c, - d, - e, - f - ) { - invokeGuardedCallback.apply(this, arguments); - - if (hasError) { - var error = clearCaughtError(); - - if (!hasRethrowError) { - hasRethrowError = true; - rethrowError = error; - } - } - } - /** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - - function rethrowCaughtError() { - if (hasRethrowError) { - var error = rethrowError; - hasRethrowError = false; - rethrowError = null; - throw error; - } - } - function hasCaughtError() { - return hasError; - } - function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - throw new Error( - "clearCaughtError was called but no error was captured. This error " + - "is likely caused by a bug in React. Please file an issue." - ); - } - } - var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { @@ -26301,20 +26168,6 @@ if (__DEV__) { ); } - function reportUncaughtErrorInDEV(error) { - // Wrapping each small part of the commit phase into a guarded - // callback is a bit too slow (https://github.com/facebook/react/pull/21666). - // But we rely on it to surface errors to DEV tools like overlays - // (https://github.com/facebook/react/issues/21712). - // As a compromise, rethrow only caught errors in a guard. - { - invokeGuardedCallback(null, function () { - throw error; - }); - clearCaughtError(); - } - } - function callComponentWillUnmountWithTimer(current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; @@ -33873,7 +33726,6 @@ if (__DEV__) { error$1 ) { { - reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } @@ -34377,83 +34229,6 @@ if (__DEV__) { } } } - var beginWork; - - if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { - var dummyFiber = null; - - beginWork = function (current, unitOfWork, lanes) { - // If a component throws an error, we replay it again in a synchronously - // dispatched event, so that the debugger will treat it as an uncaught - // error See ReactErrorUtils for more information. - // Before entering the begin phase, copy the work-in-progress onto a dummy - // fiber. If beginWork throws, we'll use this to reset the state. - var originalWorkInProgressCopy = assignFiberPropertiesInDEV( - dummyFiber, - unitOfWork - ); - - try { - return beginWork$1(current, unitOfWork, lanes); - } catch (originalError) { - if ( - didSuspendOrErrorWhileHydratingDEV() || - originalError === SuspenseException || - originalError === SelectiveHydrationException || - (originalError !== null && - typeof originalError === "object" && - typeof originalError.then === "function") - ) { - // Don't replay promises. - // Don't replay errors if we are hydrating and have already suspended or handled an error - throw originalError; - } // Don't reset current debug fiber, since we're about to work on the - // same fiber again. - // Unwind the failed stack frame - - resetSuspendedWorkLoopOnUnwind(unitOfWork); - unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. - - assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); - - if (unitOfWork.mode & ProfileMode) { - // Reset the profiler timer. - startProfilerTimer(unitOfWork); - } // Run beginWork again. - - invokeGuardedCallback( - null, - beginWork$1, - null, - current, - unitOfWork, - lanes - ); - - if (hasCaughtError()) { - var replayError = clearCaughtError(); - - if ( - typeof replayError === "object" && - replayError !== null && - replayError._suppressLogging && - typeof originalError === "object" && - originalError !== null && - !originalError._suppressLogging - ) { - // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. - originalError._suppressLogging = true; - } - } // We always throw the original error in case the second render pass is not idempotent. - // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. - - throw originalError; - } - }; - } else { - beginWork = beginWork$1; - } - var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; @@ -35791,55 +35566,6 @@ if (__DEV__) { implementation: portal.implementation }; return fiber; - } // Used for stashing WIP properties to replay failed work in DEV. - - function assignFiberPropertiesInDEV(target, source) { - if (target === null) { - // This Fiber's initial properties will always be overwritten. - // We only use a Fiber to ensure the same hidden class so DEV isn't slow. - target = createFiber(IndeterminateComponent, null, null, NoMode); - } // This is intentionally written as a list of all properties. - // We tried to use Object.assign() instead but this is called in - // the hottest path, and Object.assign() was too slow: - // https://github.com/facebook/react/issues/12502 - // This code is DEV-only so size is not a concern. - - target.tag = source.tag; - target.key = source.key; - target.elementType = source.elementType; - target.type = source.type; - target.stateNode = source.stateNode; - target.return = source.return; - target.child = source.child; - target.sibling = source.sibling; - target.index = source.index; - target.ref = source.ref; - target.refCleanup = source.refCleanup; - target.pendingProps = source.pendingProps; - target.memoizedProps = source.memoizedProps; - target.updateQueue = source.updateQueue; - target.memoizedState = source.memoizedState; - target.dependencies = source.dependencies; - target.mode = source.mode; - target.flags = source.flags; - target.subtreeFlags = source.subtreeFlags; - target.deletions = source.deletions; - target.lanes = source.lanes; - target.childLanes = source.childLanes; - target.alternate = source.alternate; - - { - target.actualDuration = source.actualDuration; - target.actualStartTime = source.actualStartTime; - target.selfBaseDuration = source.selfBaseDuration; - target.treeBaseDuration = source.treeBaseDuration; - } - - target._debugInfo = source._debugInfo; - target._debugOwner = source._debugOwner; - target._debugNeedsRemount = source._debugNeedsRemount; - target._debugHookTypes = source._debugHookTypes; - return target; } function FiberRootNode( @@ -35992,7 +35718,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-classic-8ac2daaf"; + var ReactVersion = "18.3.0-www-classic-c78276c3"; function createPortal$1( children, @@ -39662,11 +39388,21 @@ if (__DEV__) { "toggle" ].concat(mediaEventTypes) ); + var hasError = false; + var caughtError = null; function executeDispatch(event, listener, currentTarget) { - var type = event.type || "unknown-event"; event.currentTarget = currentTarget; - invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + + try { + listener(event); + } catch (error) { + if (!hasError) { + hasError = true; + caughtError = error; + } + } + event.currentTarget = null; } @@ -39718,7 +39454,12 @@ if (__DEV__) { processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); // event system doesn't use pooling. } // This would be a good time to rethrow if any of the event handlers threw. - rethrowCaughtError(); + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + throw error; + } } function dispatchEventsForPlugins( diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 5fa584255a020..8cd64af32f5ae 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -122,8 +122,6 @@ if (__DEV__) { disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, - replayFailedUnitOfWorkWithInvokeGuardedCallback = - dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback, enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning, @@ -8123,11 +8121,6 @@ if (__DEV__) { didSuspendOrErrorDEV = true; } } - function didSuspendOrErrorWhileHydratingDEV() { - { - return didSuspendOrErrorDEV; - } - } function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; @@ -18678,25 +18671,8 @@ if (__DEV__) { if (true) { var source = errorInfo.source; var stack = errorInfo.stack; - var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling - // `preventDefault()` in window `error` handler. - // We record this information as an expando on the error. - - if (error != null && error._suppressLogging) { - if (boundary.tag === ClassComponent) { - // The error is recoverable and was silenced. - // Ignore it and don't print the stack addendum. - // This is handy for testing error boundaries without noise. - return; - } // The error is fatal. Since the silencing might have - // been accidental, we'll surface it anyway. - // However, the browser would have silenced the original error - // so we'll print it first, and then print the stack addendum. - - console["error"](error); // Don't transform to our wrapper - // For a more detailed description of this block, see: - // https://github.com/facebook/react/pull/13384 - } + var componentStack = stack !== null ? stack : ""; // TODO: There's no longer a way to silence these warnings e.g. for tests. + // See https://github.com/facebook/react/pull/13384 var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName @@ -18718,19 +18694,17 @@ if (__DEV__) { ("using the error boundary you provided, " + errorBoundaryName + "."); - } + } // In development, we provide our own message which includes the component stack + // in addition to the error. - var combinedMessage = - componentNameMessage + - "\n" + - componentStack + - "\n\n" + - ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - - console["error"](combinedMessage); // Don't transform to our wrapper + console["error"]( + // Don't transform to our wrapper + "%o\n\n%s\n%s\n\n%s", + error, + componentNameMessage, + componentStack, + errorBoundaryMessage + ); } } catch (e) { // This method must not throw, or React internal state will get messed up. @@ -23040,7 +23014,7 @@ if (__DEV__) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } - function beginWork$1(current, workInProgress, renderLanes) { + function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. @@ -26028,113 +26002,6 @@ if (__DEV__) { } } - // Provided by www - var ReactFbErrorUtils = require("ReactFbErrorUtils"); - - if (typeof ReactFbErrorUtils.invokeGuardedCallback !== "function") { - throw new Error( - "Expected ReactFbErrorUtils.invokeGuardedCallback to be a function." - ); - } - - function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { - // This will call `this.onError(err)` if an error was caught. - ReactFbErrorUtils.invokeGuardedCallback.apply(this, arguments); - } - - var hasError = false; - var caughtError = null; // Used by event system to capture/rethrow the first error. - - var hasRethrowError = false; - var rethrowError = null; - var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } - }; - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl.apply(reporter, arguments); - } - /** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if caughtError and rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - - function invokeGuardedCallbackAndCatchFirstError( - name, - func, - context, - a, - b, - c, - d, - e, - f - ) { - invokeGuardedCallback.apply(this, arguments); - - if (hasError) { - var error = clearCaughtError(); - - if (!hasRethrowError) { - hasRethrowError = true; - rethrowError = error; - } - } - } - /** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - - function rethrowCaughtError() { - if (hasRethrowError) { - var error = rethrowError; - hasRethrowError = false; - rethrowError = null; - throw error; - } - } - function hasCaughtError() { - return hasError; - } - function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - throw new Error( - "clearCaughtError was called but no error was captured. This error " + - "is likely caused by a bug in React. Please file an issue." - ); - } - } - var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { @@ -26157,20 +26024,6 @@ if (__DEV__) { ); } - function reportUncaughtErrorInDEV(error) { - // Wrapping each small part of the commit phase into a guarded - // callback is a bit too slow (https://github.com/facebook/react/pull/21666). - // But we rely on it to surface errors to DEV tools like overlays - // (https://github.com/facebook/react/issues/21712). - // As a compromise, rethrow only caught errors in a guard. - { - invokeGuardedCallback(null, function () { - throw error; - }); - clearCaughtError(); - } - } - function callComponentWillUnmountWithTimer(current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; @@ -33720,7 +33573,6 @@ if (__DEV__) { error$1 ) { { - reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } @@ -34224,83 +34076,6 @@ if (__DEV__) { } } } - var beginWork; - - if (replayFailedUnitOfWorkWithInvokeGuardedCallback) { - var dummyFiber = null; - - beginWork = function (current, unitOfWork, lanes) { - // If a component throws an error, we replay it again in a synchronously - // dispatched event, so that the debugger will treat it as an uncaught - // error See ReactErrorUtils for more information. - // Before entering the begin phase, copy the work-in-progress onto a dummy - // fiber. If beginWork throws, we'll use this to reset the state. - var originalWorkInProgressCopy = assignFiberPropertiesInDEV( - dummyFiber, - unitOfWork - ); - - try { - return beginWork$1(current, unitOfWork, lanes); - } catch (originalError) { - if ( - didSuspendOrErrorWhileHydratingDEV() || - originalError === SuspenseException || - originalError === SelectiveHydrationException || - (originalError !== null && - typeof originalError === "object" && - typeof originalError.then === "function") - ) { - // Don't replay promises. - // Don't replay errors if we are hydrating and have already suspended or handled an error - throw originalError; - } // Don't reset current debug fiber, since we're about to work on the - // same fiber again. - // Unwind the failed stack frame - - resetSuspendedWorkLoopOnUnwind(unitOfWork); - unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. - - assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); - - if (unitOfWork.mode & ProfileMode) { - // Reset the profiler timer. - startProfilerTimer(unitOfWork); - } // Run beginWork again. - - invokeGuardedCallback( - null, - beginWork$1, - null, - current, - unitOfWork, - lanes - ); - - if (hasCaughtError()) { - var replayError = clearCaughtError(); - - if ( - typeof replayError === "object" && - replayError !== null && - replayError._suppressLogging && - typeof originalError === "object" && - originalError !== null && - !originalError._suppressLogging - ) { - // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. - originalError._suppressLogging = true; - } - } // We always throw the original error in case the second render pass is not idempotent. - // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. - - throw originalError; - } - }; - } else { - beginWork = beginWork$1; - } - var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; @@ -35638,55 +35413,6 @@ if (__DEV__) { implementation: portal.implementation }; return fiber; - } // Used for stashing WIP properties to replay failed work in DEV. - - function assignFiberPropertiesInDEV(target, source) { - if (target === null) { - // This Fiber's initial properties will always be overwritten. - // We only use a Fiber to ensure the same hidden class so DEV isn't slow. - target = createFiber(IndeterminateComponent, null, null, NoMode); - } // This is intentionally written as a list of all properties. - // We tried to use Object.assign() instead but this is called in - // the hottest path, and Object.assign() was too slow: - // https://github.com/facebook/react/issues/12502 - // This code is DEV-only so size is not a concern. - - target.tag = source.tag; - target.key = source.key; - target.elementType = source.elementType; - target.type = source.type; - target.stateNode = source.stateNode; - target.return = source.return; - target.child = source.child; - target.sibling = source.sibling; - target.index = source.index; - target.ref = source.ref; - target.refCleanup = source.refCleanup; - target.pendingProps = source.pendingProps; - target.memoizedProps = source.memoizedProps; - target.updateQueue = source.updateQueue; - target.memoizedState = source.memoizedState; - target.dependencies = source.dependencies; - target.mode = source.mode; - target.flags = source.flags; - target.subtreeFlags = source.subtreeFlags; - target.deletions = source.deletions; - target.lanes = source.lanes; - target.childLanes = source.childLanes; - target.alternate = source.alternate; - - { - target.actualDuration = source.actualDuration; - target.actualStartTime = source.actualStartTime; - target.selfBaseDuration = source.selfBaseDuration; - target.treeBaseDuration = source.treeBaseDuration; - } - - target._debugInfo = source._debugInfo; - target._debugOwner = source._debugOwner; - target._debugNeedsRemount = source._debugNeedsRemount; - target._debugHookTypes = source._debugHookTypes; - return target; } function FiberRootNode( @@ -35839,7 +35565,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-modern-5fbb2842"; + var ReactVersion = "18.3.0-www-modern-49a8d85d"; function createPortal$1( children, @@ -40317,11 +40043,21 @@ if (__DEV__) { "toggle" ].concat(mediaEventTypes) ); + var hasError = false; + var caughtError = null; function executeDispatch(event, listener, currentTarget) { - var type = event.type || "unknown-event"; event.currentTarget = currentTarget; - invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + + try { + listener(event); + } catch (error) { + if (!hasError) { + hasError = true; + caughtError = error; + } + } + event.currentTarget = null; } @@ -40373,7 +40109,12 @@ if (__DEV__) { processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); // event system doesn't use pooling. } // This would be a good time to rethrow if any of the event handlers threw. - rethrowCaughtError(); + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + throw error; + } } function dispatchEventsForPlugins( diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index a9423cd49fcaa..c08190e21ad72 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -6602,5422 +6602,5379 @@ function attemptEarlyBailoutIfNoScheduledUpdate( } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null; -function resetContextDependencies() { - lastFullyObservedContext = - lastContextDependency = - currentlyRenderingFiber = - null; -} -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } -} -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; } - null !== current && - propagateContextChanges( + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, workInProgress, + Component, current, - renderLanes, - forcePropagateEntireTree + context, + renderLanes ); - workInProgress.flags |= 262144; - } -} -function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress, renderLanes) { - currentlyRenderingFiber = workInProgress; - lastFullyObservedContext = lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconcilation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - if (lastFullyObservedContext !== context) - if ( - ((context = { context: context, memoizedValue: value, next: null }), - null === lastContextDependency) - ) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$1 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); -} -var ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig; -function requestCurrentTransition() { - var transition = ReactCurrentBatchConfig$2.transition; - null !== transition && transition._callbacks.add(handleAsyncAction); - return transition; -} -function handleAsyncAction(transition, thenable) { - entangleAsyncAction(transition, thenable); -} -function notifyTransitionCallbacks(transition, returnValue) { - transition._callbacks.forEach(function (callback) { - return callback(transition, returnValue); - }); -} -var resumedCache = createCursor(null), - transitionStack = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition( - offscreenWorkInProgress, - prevCachePool, - newTransitions -) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); - enableTransitionTracing && - (null === transitionStack.current - ? push(transitionStack, newTransitions) - : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); -} -function popTransition(workInProgress, current) { - null !== current && - (enableTransitionTracing && pop(transitionStack), pop(resumedCache)); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; -} -var emptyObject = {}; -function collectScopedNodesFromChildren( - startingChild, - fn$jscomp$0, - scopedNodes$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - fn = fn$jscomp$0, - scopedNodes = scopedNodes$jscomp$0; - if (5 === node.tag) { - var type = node.type, - memoizedProps = node.memoizedProps, - instance = node.stateNode; - null !== instance && - !0 === fn(type, memoizedProps || emptyObject, instance) && - scopedNodes.push(instance); - } - type = node.child; - isFiberSuspenseAndTimedOut(node) && (type = node.child.sibling.child); - null !== type && collectScopedNodesFromChildren(type, fn, scopedNodes); - startingChild = startingChild.sibling; - } -} -function collectFirstScopedNodeFromChildren(startingChild, fn$jscomp$0) { - for (; null !== startingChild; ) { - a: { - var JSCompiler_inline_result = startingChild; - var fn = fn$jscomp$0; - if (5 === JSCompiler_inline_result.tag) { - var type = JSCompiler_inline_result.type, - memoizedProps = JSCompiler_inline_result.memoizedProps, - instance = JSCompiler_inline_result.stateNode; - if (null !== instance && !0 === fn(type, memoizedProps, instance)) { - JSCompiler_inline_result = instance; - break a; - } - } - type = JSCompiler_inline_result.child; - isFiberSuspenseAndTimedOut(JSCompiler_inline_result) && - (type = JSCompiler_inline_result.child.sibling.child); - JSCompiler_inline_result = - null !== type ? collectFirstScopedNodeFromChildren(type, fn) : null; - } - if (null !== JSCompiler_inline_result) return JSCompiler_inline_result; - startingChild = startingChild.sibling; - } - return null; -} -function collectNearestChildContextValues( - startingChild, - context$jscomp$0, - childContextValues$jscomp$0 -) { - for (; null !== startingChild; ) { - var node = startingChild, - context = context$jscomp$0, - childContextValues = childContextValues$jscomp$0; - if ( - 10 === node.tag && - (enableRenderableContext ? node.type : node.type._context) === context - ) - childContextValues.push(node.memoizedProps.value); - else { - var child = node.child; - isFiberSuspenseAndTimedOut(node) && (child = node.child.sibling.child); - null !== child && - collectNearestChildContextValues(child, context, childContextValues); - } - startingChild = startingChild.sibling; - } -} -function DO_NOT_USE_queryAllNodes(fn) { - var currentFiber = getInstanceFromScope(this); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - var scopedNodes = []; - null !== currentFiber && - collectScopedNodesFromChildren(currentFiber, fn, scopedNodes); - return 0 === scopedNodes.length ? null : scopedNodes; -} -function DO_NOT_USE_queryFirstNode(fn) { - var currentFiber = getInstanceFromScope(this); - if (null === currentFiber) return null; - currentFiber = currentFiber.child; - return null !== currentFiber - ? collectFirstScopedNodeFromChildren(currentFiber, fn) - : null; -} -function containsNode$1(node) { - for (node = getClosestInstanceFromNode(node) || null; null !== node; ) { - if (21 === node.tag && node.stateNode === this) return !0; - node = node.return; - } - return !1; -} -function getChildContextValues(context) { - var currentFiber = getInstanceFromScope(this); - if (null === currentFiber) return []; - currentFiber = currentFiber.child; - var childContextValues = []; - null !== currentFiber && - collectNearestChildContextValues(currentFiber, context, childContextValues); - return childContextValues; -} -function markUpdate(workInProgress) { - workInProgress.flags |= 4; -} -function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { - if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4)) - workInProgress.flags &= -16777217; - else if ( - ((workInProgress.flags |= 16777216), - 0 === (workInProgressRootRenderLanes & 42) && - ((resource = - "stylesheet" === resource.type && 0 === (resource.state.loading & 3) - ? !1 - : !0), - !resource)) - ) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else - throw ( - ((suspendedThenable = noopSuspenseyCommitThenable), - SuspenseyCommitException) - ); -} -function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); -} -function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { - if (!isHydrating) - switch (renderState.tailMode) { - case "hidden": - hasRenderedATailFallback = renderState.tail; - for (var lastTailNode = null; null !== hasRenderedATailFallback; ) - null !== hasRenderedATailFallback.alternate && - (lastTailNode = hasRenderedATailFallback), - (hasRenderedATailFallback = hasRenderedATailFallback.sibling); - null === lastTailNode - ? (renderState.tail = null) - : (lastTailNode.sibling = null); - break; - case "collapsed": - lastTailNode = renderState.tail; - for (var lastTailNode$112 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$112 = lastTailNode), - (lastTailNode = lastTailNode.sibling); - null === lastTailNode$112 - ? hasRenderedATailFallback || null === renderState.tail - ? (renderState.tail = null) - : (renderState.tail.sibling = null) - : (lastTailNode$112.sibling = null); - } -} -function bubbleProperties(completedWork) { - var didBailout = - null !== completedWork.alternate && - completedWork.alternate.child === completedWork.child, - newChildLanes = 0, - subtreeFlags = 0; - if (didBailout) - for (var child$113 = completedWork.child; null !== child$113; ) - (newChildLanes |= child$113.lanes | child$113.childLanes), - (subtreeFlags |= child$113.subtreeFlags & 31457280), - (subtreeFlags |= child$113.flags & 31457280), - (child$113.return = completedWork), - (child$113 = child$113.sibling); - else - for (child$113 = completedWork.child; null !== child$113; ) - (newChildLanes |= child$113.lanes | child$113.childLanes), - (subtreeFlags |= child$113.subtreeFlags), - (subtreeFlags |= child$113.flags), - (child$113.return = completedWork), - (child$113 = child$113.sibling); - completedWork.subtreeFlags |= subtreeFlags; - completedWork.childLanes = newChildLanes; - return didBailout; -} -function completeWork(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - popTreeContext(workInProgress); - switch (workInProgress.tag) { - case 2: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return bubbleProperties(workInProgress), null; - case 1: - return ( - isContextProvider(workInProgress.type) && popContext(), - bubbleProperties(workInProgress), - null - ); - case 3: - renderLanes = workInProgress.stateNode; - enableTransitionTracing && - null !== workInProgressTransitions && - (workInProgress.flags |= 2048); - newProps = null; - null !== current && (newProps = current.memoizedState.cache); - workInProgress.memoizedState.cache !== newProps && - (workInProgress.flags |= 2048); - popProvider(CacheContext); - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack); - enableTransitionTracing && pop(transitionStack); - popHostContainer(); - pop(didPerformWorkStackCursor); - pop(contextStackCursor); - renderLanes.pendingContext && - ((renderLanes.context = renderLanes.pendingContext), - (renderLanes.pendingContext = null)); - if (null === current || null === current.child) - popHydrationState(workInProgress) - ? markUpdate(workInProgress) - : null === current || - (current.memoizedState.isDehydrated && - 0 === (workInProgress.flags & 256)) || - ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); - bubbleProperties(workInProgress); - enableTransitionTracing && - 0 !== (workInProgress.subtreeFlags & 8192) && - (workInProgress.flags |= 2048); - return null; - case 26: - renderLanes = workInProgress.memoizedState; - if (null === current) - markUpdate(workInProgress), - null !== renderLanes - ? (bubbleProperties(workInProgress), - preloadResourceAndSuspendIfNeeded(workInProgress, renderLanes)) - : (bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)); - else { - var currentResource = current.memoizedState; - renderLanes !== currentResource && markUpdate(workInProgress); - null !== renderLanes - ? (bubbleProperties(workInProgress), - renderLanes === currentResource - ? (workInProgress.flags &= -16777217) - : preloadResourceAndSuspendIfNeeded(workInProgress, renderLanes)) - : (current.memoizedProps !== newProps && markUpdate(workInProgress), - bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)); - } - return null; - case 27: - popHostContext(workInProgress); - renderLanes = rootInstanceStackCursor.current; - currentResource = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && markUpdate(workInProgress); - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - bubbleProperties(workInProgress); - return null; - } - current = contextStackCursor$1.current; - popHydrationState(workInProgress) - ? hydrateInstance( - workInProgress.stateNode, - workInProgress.type, - workInProgress.memoizedProps, - current, - workInProgress - ) - : ((current = resolveSingletonInstance( - currentResource, - newProps, - renderLanes - )), - (workInProgress.stateNode = current), - markUpdate(workInProgress)); - } - bubbleProperties(workInProgress); - return null; - case 5: - popHostContext(workInProgress); - renderLanes = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && markUpdate(workInProgress); - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error(formatProdErrorMessage(166)); - bubbleProperties(workInProgress); - return null; - } - current = contextStackCursor$1.current; - if (popHydrationState(workInProgress)) - hydrateInstance( - workInProgress.stateNode, - workInProgress.type, - workInProgress.memoizedProps, - current, - workInProgress - ); - else { - currentResource = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ); - switch (current) { - case 1: - current = currentResource.createElementNS( - "http://www.w3.org/2000/svg", - renderLanes - ); - break; - case 2: - current = currentResource.createElementNS( - "http://www.w3.org/1998/Math/MathML", - renderLanes - ); - break; - default: - switch (renderLanes) { - case "svg": - current = currentResource.createElementNS( - "http://www.w3.org/2000/svg", - renderLanes - ); - break; - case "math": - current = currentResource.createElementNS( - "http://www.w3.org/1998/Math/MathML", - renderLanes - ); - break; - case "script": - current = currentResource.createElement("div"); - current.innerHTML = "