diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 27a192921e0b4..23db95f1a6b8d 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.1.0-native-fb-d4287258-20241217 \ No newline at end of file +19.1.0-native-fb-a9bbe346-20241219 \ No newline at end of file diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js index 91227f5deb637..d493adec871c6 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -420,5 +420,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-a9bbe346-20241219"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js index 4ecbf5e142df3..064383ec4b4d3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<63d0f4603e2e378904c89b6df16c7df3>> + * @generated SignedSource<> */ "use strict"; @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js index 4ecbf5e142df3..064383ec4b4d3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<63d0f4603e2e378904c89b6df16c7df3>> + * @generated SignedSource<> */ "use strict"; @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js index c8cff3acddeb9..6bdd2bd2e720f 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ /* @@ -2458,6 +2458,8 @@ __DEV__ && "hr" === tag || "option" === tag || "optgroup" === tag || + "script" === tag || + "template" === tag || "#text" === tag ); case "optgroup": @@ -4271,472 +4273,245 @@ __DEV__ && for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && + error$jscomp$0( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer = rendererSigil; } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); } - function warnIfNotHydrating() { - isHydrating || + 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; + } + parent !== propagationRoot && error$jscomp$0( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + 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( - "Saw multiple hydration diff roots in a pass. This is a bug in React." + "We just came from a parent so we must have had a parent. This is a bug in React." ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); + 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 + ) { + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - return hydrationDiffRootDEV; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; + workInProgress.flags |= 262144; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + return !0; + currentDependencies = currentDependencies.next; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$1), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); + return !1; } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); - } - throwOnHydrationMismatch(fiber); - } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) + function readContext(context) { + isDisallowedContextReadInDEV && + error$jscomp$0( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); + } + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); + } + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); + function entangleAsyncAction(transition, thenable) { + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + currentEntangledActionThenable = { + status: "pending", + value: void 0, + then: function (resolve) { + entangledListeners.push(resolve); + } + }; + } + currentEntangledPendingCount++; + thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); + return thenable; } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - error$jscomp$0( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; - } - function noop$3() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - error$jscomp$0( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$3, noop$3), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; - } - } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; - } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; - } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); - } - function entangleAsyncAction(transition, thenable) { - if (null === currentEntangledListeners) { - var entangledListeners = (currentEntangledListeners = []); - currentEntangledPendingCount = 0; - currentEntangledLane = requestTransitionLane(); - currentEntangledActionThenable = { - status: "pending", - value: void 0, - then: function (resolve) { - entangledListeners.push(resolve); - } - }; - } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; - } - function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners - ) { - null !== currentEntangledActionThenable && - (currentEntangledActionThenable.status = "fulfilled"); - var listeners = currentEntangledListeners; - currentEntangledListeners = null; - currentEntangledLane = 0; - currentEntangledActionThenable = null; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); - } + function pingEngtangledActionScope() { + if ( + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners + ) { + null !== currentEntangledActionThenable && + (currentEntangledActionThenable.status = "fulfilled"); + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = 0; + currentEntangledActionThenable = null; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); + } } function chainThenableValue(thenable, result) { var listeners = [], @@ -4763,6645 +4538,6851 @@ __DEV__ && ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + error$jscomp$0( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - error$jscomp$0( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - error$jscomp$0( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - error$jscomp$0( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - error$jscomp$0( - "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", - currentHookNameInDev - ), - !1 - ); - nextDeps.length !== prevDeps.length && - error$jscomp$0( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - error$jscomp$0( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } - } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - (current.mode & ConcurrentMode) !== NoMode && - error$jscomp$0( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) - throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." - ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - error$jscomp$0( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); - } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; - } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; - } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; - } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; - } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; - } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error("An unsupported type was passed to use(): " + String(usable)); - } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && - error$jscomp$0( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; - } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && - error$jscomp$0( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." - ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + currentlyProcessingQueue = null; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + callback.call(context); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (error$jscomp$0( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (error$jscomp$0( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (error$jscomp$0( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function retainCache(cache) { + cache.controller.signal.aborted && + warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error$3) { - return !0; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + error$jscomp$0( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } + } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + error$jscomp$0( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - initialStateInitializer(); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } + void 0 === oldProps && + error$jscomp$0( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); - } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + addendum = new ctor(props, context); } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); - } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$5) { - onActionError(actionQueue, node, error$5); + setIsStrictModeForDevtools(!1); } - } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), error$jscomp$0( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); - } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); - } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } } - actionQueue.action = null; - } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; } - function actionStateReducer(oldState, newState) { - return newState; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + error$jscomp$0( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; - } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; - } - } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; - } - isMatching && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; - } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); - } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; - } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; - } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; - } - function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); - } - function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps - ) { - identityTag = { - resourceKind: ResourceEffectIdentityKind, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: ResourceEffectUpdateKind, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); - } - function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; - } - return effect; - } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; - } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); - } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); - } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); - } - function mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - if ( - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 142608384; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); - } - function updateResourceEffectImpl( - fiberFlags, - hookFlags, - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if ( - null != destroy.resourceKind && - destroy.resourceKind === ResourceEffectUpdateKind - ) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else - throw Error( - "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." - ); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if ( - null != destroy.resourceKind && - destroy.resourceKind === ResourceEffectUpdateKind - ) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else - throw Error( - "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." - ); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } - } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? hookFlags : HasEffect | hookFlags, - isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, - inst, - create, - createDeps, - update, - updateDeps - ); - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - error$jscomp$0( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name ); - } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + instance.contextType && error$jscomp$0( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + instance.contextTypes && error$jscomp$0( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; - } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; - } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + ctor.childContextTypes && + !didWarnAboutChildContextTypes.has(ctor) && + (didWarnAboutChildContextTypes.add(ctor), + error$jscomp$0( + "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + name + )); + ctor.contextTypes && + !didWarnAboutContextTypes$1.has(ctor) && + (didWarnAboutContextTypes$1.add(ctor), + error$jscomp$0( + "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; - } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error$6) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error$6 }, - requestUpdateLane(fiber) + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); - } - } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$1(formFiber) { - null === ReactSharedInternals.T && + "function" === typeof instance.componentDidReceiveProps && error$jscomp$0( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); - } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); - } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); - } - function refreshCache(fiber, seedKey) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - error$jscomp$0( - "The seed argument is not enabled outside experimental channels." - ); - fiber.payload = { cache: provider }; - return; - } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + "function" === typeof instance.componentWillRecieveProps && error$jscomp$0( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); - } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + "function" === typeof instance.UNSAFE_componentWillRecieveProps && error$jscomp$0( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); - } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error$7) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); - } - return !1; - } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && error$jscomp$0( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - error$jscomp$0("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markStateUpdateScheduled(fiber, 2); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + instance + ); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + instance ); + instance.state = workInProgress.memoizedState; + name = ctor.getDerivedStateFromProps; + "function" === typeof name && + (applyDerivedStateFromProps(workInProgress, ctor, name, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - error$jscomp$0( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key - ); - break; - } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } + return newProps; } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' - ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? error$jscomp$0( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : error$jscomp$0( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? error$jscomp$0( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : error$jscomp$0( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); + function warnIfNotHydrating() { + isHydrating || + error$jscomp$0( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); + } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings + ); + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; + } + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); + } + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) + ); + throw HydrationMismatchException; + } + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$1), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); + } + throwOnHydrationMismatch(fiber); } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - enableOwnerStacks && (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; + } + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; + } + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; + } + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); + } + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + error$jscomp$0( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); + } + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop$3() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + error$jscomp$0( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current + thenable.then(noop$3, noop$3), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + default: + if ("string" === typeof thenable.status) + thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - function updatePortal(returnFiber, current, portal, lanes) { + } + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; + } + function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + } + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + } + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); + } + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); + } + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; + } + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + } + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + error$jscomp$0( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - enableOwnerStacks && (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current + } + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || + error$jscomp$0( + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps + ); + } + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), + error$jscomp$0( + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); + } + function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + } + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + error$jscomp$0( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + currentHookNameInDev + ), + !1 + ); + nextDeps.length !== prevDeps.length && + error$jscomp$0( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; + } + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + error$jscomp$0( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { + setIsStrictModeForDevtools(!0); + try { + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } finally { + setIsStrictModeForDevtools(!1); + } } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + finishRenderingHooks(current, workInProgress); + return children; + } + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.mode & ConcurrentMode) !== NoMode && + error$jscomp$0( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + error$jscomp$0( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); + } + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." + ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; - } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; + } + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; + } + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; + } + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + didScheduleRenderPhaseUpdate = !1; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; + } + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; + } + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); - throwOnInvalidObjectType(returnFiber, newChild); + throw Error("Rendered more hooks than during the previous render."); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - error$jscomp$0( - "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); - } - return knownKeys; + return workInProgressHook; + } + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; + } + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; + } + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { + throw Error("An unsupported type was passed to use(): " + String(usable)); + } + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + error$jscomp$0( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + memoCache.index++; + return updateQueue; + } + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; + } + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + } + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); + } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + current.baseQueue !== baseQueue && + error$jscomp$0( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - error$jscomp$0( - "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; } else - newChild.entries !== key || - didWarnAboutMaps || - (error$jscomp$0( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - ((returnFiber.mode & ConcurrentMode) === NoMode && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - enableOwnerStacks && - (fiber._debugTask = debugInfo[i].debugTask); - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; - } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler - ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); - } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); - } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); - } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; - } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - error$jscomp$0( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - error$jscomp$0( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + return [newState, dispatch]; } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (error$jscomp$0( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (error$jscomp$0( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; + } + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (error$jscomp$0( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - if (workInProgress.mode & StrictLegacyMode) { + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + } + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error$3) { + return !0; + } + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); + initialStateInitializer(); } finally { setIsStrictModeForDevtools(!1); } } - void 0 === oldProps && - error$jscomp$0( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" - ); - return oldProps; } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; } - function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - if ( - "contextType" in ctor && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(ctor) - ) { - didWarnAboutInvalidateContextType.add(ctor); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(ctor) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - addendum = new ctor(props, context); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - addendum = new ctor(props, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - props = workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null; - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof ctor.getDerivedStateFromProps && - null === props && - ((props = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUninitializedState.has(props) || - (didWarnAboutUninitializedState.add(props), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - props, - null === addendum.state ? "null" : "undefined", - props - ))); - if ( - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (props = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (props = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (props = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== props || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - var _componentName = getComponentNameFromType(ctor) || "Component"; - ctor = - "function" === typeof ctor.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _componentName, - ctor, - null !== props ? "\n " + props : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error$4) { + onActionError(actionQueue, node, error$4); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$5) { + onActionError(actionQueue, node, error$5); } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + error$jscomp$0( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return addendum; + actionQueue.action = null; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext - ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - error$jscomp$0( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } - function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode, - name = getComponentNameFromType(ctor) || "Component"; - instance.render || - (ctor.prototype && "function" === typeof ctor.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - name - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - name - )); - !instance.getInitialState || - instance.getInitialState.isReactClassApproved || - instance.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - name - ); - instance.getDefaultProps && - !instance.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - name - ); - instance.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - name - ); - instance.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - name - ); - ctor.contextType && - ctor.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(ctor) && - (didWarnAboutContextTypeAndContextTypes.add(ctor), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - name - )); - ctor.childContextTypes && - !didWarnAboutChildContextTypes.has(ctor) && - (didWarnAboutChildContextTypes.add(ctor), - error$jscomp$0( - "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - name - )); - ctor.contextTypes && - !didWarnAboutContextTypes$1.has(ctor) && - (didWarnAboutContextTypes$1.add(ctor), - error$jscomp$0( - "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - name - )); - "function" === typeof instance.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - name - ); - ctor.prototype && - ctor.prototype.isPureReactComponent && - "undefined" !== typeof instance.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(ctor) || "A pure component" - ); - "function" === typeof instance.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - name - ); - "function" === typeof instance.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - name - ); - "function" === typeof instance.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - name - ); - "function" === typeof instance.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - name - ); - var hasMutatedProps = instance.props !== newProps; - void 0 !== instance.props && - hasMutatedProps && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - name - ); - instance.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - name, - name - ); - "function" !== typeof instance.getSnapshotBeforeUpdate || - "function" === typeof instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(ctor) - )); - "function" === typeof instance.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof instance.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof ctor.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - name - ); - (hasMutatedProps = instance.state) && - ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && - error$jscomp$0("%s.state: must be set to an object or null", name); - "function" === typeof instance.getChildContext && - "object" !== typeof ctor.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - name - ); - instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - name = ctor.contextType; - "object" === typeof name && null !== name - ? (instance.context = readContext(name)) - : ((name = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, name))); - instance.state === newProps && - ((name = getComponentNameFromType(ctor) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(name) || - (didWarnAboutDirectlyAssigningPropsToState.add(name), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - name - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - instance - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - instance - ); - instance.state = workInProgress.memoizedState; - name = ctor.getDerivedStateFromProps; - "function" === typeof name && - (applyDerivedStateFromProps(workInProgress, ctor, name, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; + function actionStateReducer(oldState, newState) { + return newState; } - function defaultOnUncaughtError(error, errorInfo) { - reportGlobalError(error); - error = componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - if (!enableOwnerStacks) { - var componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - } - try { - warn( - "%s\n\n%s\n", - error, - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); - } - } - function defaultOnCaughtError(error$1, errorInfo) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - if (!enableOwnerStacks) { - var componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - } - try { - "object" === typeof error$1 && - null !== error$1 && - "string" === typeof error$1.environmentName - ? bindToConsole( - "error", - [ - "%o\n\n%s\n\n%s\n", - error$1, - componentNameMessage, - recreateMessage - ], - error$1.environmentName - )() - : error$jscomp$0( - "%o\n\n%s\n\n%s\n", - error$1, - componentNameMessage, - recreateMessage - ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; + } + isMatching && (initialStateProp = ssrFormState[0]); + } } + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; } - function defaultOnRecoverableError(error) { - reportGlobalError(error); + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - } catch (e$12) { - setTimeout(function () { - throw e$12; - }); - } - } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$13) { - setTimeout(function () { - throw e$13; - }); - } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error$1 = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error$1); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - error$jscomp$0( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); + function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes + function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps ) { - if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) - return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary - ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + identityTag = { + resourceKind: ResourceEffectIdentityKind, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: ResourceEffectUpdateKind, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes + function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; + } + return effect; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - currentSourceFiber = sourceFiber.tag; - (sourceFiber.mode & ConcurrentMode) !== NoMode || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - isHydrating && - sourceFiber.mode & ConcurrentMode && - (didSuspendOrErrorDEV = !0); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: - return ( - sourceFiber.mode & ConcurrentMode && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & ConcurrentMode && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & ConcurrentMode) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); - } - if (1 === root.tag) - return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 - ); - value = Error( - "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + var hookFlags = Passive, + hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 142608384; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); + } else + (hookFlags = Passive), + (hook = mountWorkInProgressHook()), + (currentlyRenderingFiber.flags |= 8390656), + (inst = createEffectInstance()), + (inst.destroy = destroy), + (hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + inst, + create, + createDeps, + update, + updateDeps + )); + } + function updateResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if ( + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind + ) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else + throw Error( + "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." + ); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if ( + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind + ) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else + throw Error( + "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." + ); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } - if (isHydrating && sourceFiber.mode & ConcurrentMode) - return ( - (didSuspendOrErrorDEV = !0), - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 - ); - currentSourceFiber = createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= fiberFlags); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? hookFlags : HasEffect | hookFlags, + isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === - typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; + } + if (null !== ref && void 0 !== ref) return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ref.hasOwnProperty("current") || + error$jscomp$0( + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" + ), + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + error$jscomp$0( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + error$jscomp$0( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps ); } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if ((workInProgress.mode & ConcurrentMode) === NoMode) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes - ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." - ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } + hook.memoizedState = [nextValue, deps]; + return nextValue; } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (error$jscomp$0( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ), - (didWarnAboutBadClass[componentName] = !0)); + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - error$jscomp$0( - "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - componentName = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - componentName = getMaskedContext(workInProgress, componentName); - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - componentName, - renderLanes + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - nextProps = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } - function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - enqueueCapturedUpdate(workInProgress, lane); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error$6) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$6 }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - isContextProvider(Component) - ? ((_instance = !0), pushContextProvider(workInProgress)) - : (_instance = !1); - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (state = !0); - else if (null === current) { - state = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - state.props = lane; - var oldContext = state.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - state.state = oldState; - processUpdateQueue(workInProgress, nextProps, state, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (state.props = nextProps), - (state.state = oldContext), - (state.context = contextType), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (state = !1)); - } else { - state = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - lane = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, lane); - state.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = state.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof state.getSnapshotBeforeUpdate) || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - state.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, state, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof state.UNSAFE_componentWillUpdate && - "function" !== typeof state.componentWillUpdate) || - ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof state.UNSAFE_componentWillUpdate && - state.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof state.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof state.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof state.componentDidUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (state.props = nextProps), - (state.state = newState), - (state.context = oldContext), - (state = contextType)) - : ("function" !== typeof state.componentDidUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (state = !1)); - } - current = finishClassComponent( - current, - workInProgress, - Component, - state, - _instance, - renderLanes - ); - Component = workInProgress.stateNode; - state && - Component.props !== nextProps && - (didWarnAboutReassigningProps || - error$jscomp$0( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" - ), - (didWarnAboutReassigningProps = !0)); - return current; } - function finishClassComponent( - current$jscomp$0, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes - ) { - markRef(current$jscomp$0, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && - invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - ) + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." ); - shouldUpdate = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if ( - didCaptureError && - "function" !== typeof Component.getDerivedStateFromError - ) { - var nextChildren = null; - profilerStartTime = -1; - } else { - markComponentRenderStarted(workInProgress); - nextChildren = callRenderInDEV(shouldUpdate); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(shouldUpdate); - } finally { - setIsStrictModeForDevtools(!1); - } - } - markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && didCaptureError - ? ((didCaptureError = nextChildren), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - didCaptureError, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - nextChildren, - renderLanes - ); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; - } - function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); } - function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && + function requestFormReset$1(formFiber) { + null === ReactSharedInternals.T && error$jscomp$0( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (error$jscomp$0( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (error$jscomp$0( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes - ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2360; - var JSCompiler_object_inline_stack_2361 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2362 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2360 = didSuspend) || - (JSCompiler_object_inline_digest_2360 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2360 && - ((JSCompiler_object_inline_componentStack_2362 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2360 = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_componentStack_2362 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_message_2359 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2359)) { - c: { - var instance = JSCompiler_object_inline_message_2359; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_message_2359 - ), - throwOnHydrationMismatch(workInProgress)); + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + error$jscomp$0( + "The seed argument is not enabled outside experimental channels." + ); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; + } + } + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + error$jscomp$0( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + error$jscomp$0( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error$7) { + } finally { + ReactSharedInternals.H = prevDispatcher; } - JSCompiler_object_inline_message_2359 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_message_2359 && - ((JSCompiler_object_inline_message_2359 = - JSCompiler_object_inline_message_2359.dehydrated), - null !== JSCompiler_object_inline_message_2359) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2359) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2359 = - JSCompiler_object_inline_stack_2361.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2361.fallback; - if (JSCompiler_object_inline_componentStack_2362) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2361 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_message_2359, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_componentStack_2362 = - workInProgress.child), - (JSCompiler_object_inline_componentStack_2362.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2362.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2360, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2361 + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - if ( - "number" === - typeof JSCompiler_object_inline_stack_2361.unstable_expectedLoadTime - ) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2361 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_message_2359, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_componentStack_2362 = - workInProgress.child), - (JSCompiler_object_inline_componentStack_2362.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2362.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2360, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2361 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_message_2359 - ); - } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_message_2359 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2359) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2362 = - JSCompiler_object_inline_stack_2361.fallback), - (JSCompiler_object_inline_message_2359 = workInProgress.mode), - (JSCompiler_object_inline_stack_2361 = createFiberFromOffscreen( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2361.children - }, - JSCompiler_object_inline_message_2359, - 0, - null - )), - (JSCompiler_object_inline_componentStack_2362 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2362, - JSCompiler_object_inline_message_2359, - renderLanes, - null - )), - (JSCompiler_object_inline_componentStack_2362.flags |= 2), - (JSCompiler_object_inline_stack_2361.return = workInProgress), - (JSCompiler_object_inline_componentStack_2362.return = - workInProgress), - (JSCompiler_object_inline_stack_2361.sibling = - JSCompiler_object_inline_componentStack_2362), - (workInProgress.child = JSCompiler_object_inline_stack_2361), - (workInProgress.mode & ConcurrentMode) !== NoMode && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2361 = workInProgress.child), - (JSCompiler_object_inline_stack_2361.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2361.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2360, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = - JSCompiler_object_inline_componentStack_2362)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - error$jscomp$0( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2359)) - ) { - JSCompiler_object_inline_digest_2360 = - JSCompiler_object_inline_message_2359.nextSibling && - JSCompiler_object_inline_message_2359.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2360) { - JSCompiler_temp = JSCompiler_object_inline_digest_2360.dgst; - var message = JSCompiler_object_inline_digest_2360.msg; - instance = JSCompiler_object_inline_digest_2360.stck; - var componentStack = JSCompiler_object_inline_digest_2360.cstck; - } - JSCompiler_object_inline_message_2359 = message; - JSCompiler_object_inline_digest_2360 = JSCompiler_temp; - JSCompiler_object_inline_stack_2361 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2362 = - componentStack; - JSCompiler_object_inline_componentStack_2362 = - JSCompiler_object_inline_message_2359 - ? Error(JSCompiler_object_inline_message_2359) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - ); - JSCompiler_object_inline_componentStack_2362.stack = - JSCompiler_object_inline_stack_2361 || ""; - JSCompiler_object_inline_componentStack_2362.digest = - JSCompiler_object_inline_digest_2360; - JSCompiler_object_inline_digest_2360 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2361 = { - value: JSCompiler_object_inline_componentStack_2362, - source: null, - stack: JSCompiler_object_inline_digest_2360 - }; - "string" === typeof JSCompiler_object_inline_digest_2360 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2362, - JSCompiler_object_inline_stack_2361 - ); - queueHydrationError(JSCompiler_object_inline_stack_2361); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_digest_2360 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2360) - ) { - JSCompiler_object_inline_digest_2360 = workInProgressRoot; - if ( - null !== JSCompiler_object_inline_digest_2360 && - ((JSCompiler_object_inline_stack_2361 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2361 = - 0 !== (JSCompiler_object_inline_stack_2361 & 42) - ? 1 - : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2361 - )), - (JSCompiler_object_inline_stack_2361 = - 0 !== - (JSCompiler_object_inline_stack_2361 & - (JSCompiler_object_inline_digest_2360.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2361), - 0 !== JSCompiler_object_inline_stack_2361 && - JSCompiler_object_inline_stack_2361 !== prevState.retryLane) - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2361), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2361 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2360, - current, - JSCompiler_object_inline_stack_2361 - ), - SelectiveHydrationException) - ); - JSCompiler_object_inline_message_2359.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - JSCompiler_object_inline_message_2359.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2359.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2361.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; } - if (JSCompiler_object_inline_componentStack_2362) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2362 = - JSCompiler_object_inline_stack_2361.fallback), - (JSCompiler_object_inline_message_2359 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (componentStack = { - mode: "hidden", - children: JSCompiler_object_inline_stack_2361.children - }), - (JSCompiler_object_inline_message_2359 & ConcurrentMode) === NoMode && - workInProgress.child !== JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2361 = workInProgress.child), - (JSCompiler_object_inline_stack_2361.childLanes = 0), - (JSCompiler_object_inline_stack_2361.pendingProps = - componentStack), - workInProgress.mode & ProfileMode && - ((JSCompiler_object_inline_stack_2361.actualDuration = -0), - (JSCompiler_object_inline_stack_2361.actualStartTime = -1.1), - (JSCompiler_object_inline_stack_2361.selfBaseDuration = - JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2361.treeBaseDuration = - JSCompiler_temp.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((JSCompiler_object_inline_stack_2361 = createWorkInProgress( - JSCompiler_temp, - componentStack - )), - (JSCompiler_object_inline_stack_2361.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280)), - null !== instance - ? (JSCompiler_object_inline_componentStack_2362 = - createWorkInProgress( - instance, - JSCompiler_object_inline_componentStack_2362 - )) - : ((JSCompiler_object_inline_componentStack_2362 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2362, - JSCompiler_object_inline_message_2359, - renderLanes, - null - )), - (JSCompiler_object_inline_componentStack_2362.flags |= 2)), - (JSCompiler_object_inline_componentStack_2362.return = - workInProgress), - (JSCompiler_object_inline_stack_2361.return = workInProgress), - (JSCompiler_object_inline_stack_2361.sibling = - JSCompiler_object_inline_componentStack_2362), - (workInProgress.child = JSCompiler_object_inline_stack_2361), - (JSCompiler_object_inline_stack_2361 = - JSCompiler_object_inline_componentStack_2362), - (JSCompiler_object_inline_componentStack_2362 = workInProgress.child), - (JSCompiler_object_inline_message_2359 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2359 - ? (JSCompiler_object_inline_message_2359 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_message_2359.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2359 = { - baseLanes: - JSCompiler_object_inline_message_2359.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_componentStack_2362.memoizedState = - JSCompiler_object_inline_message_2359), - (JSCompiler_object_inline_componentStack_2362.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2360, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2361 + return !1; + } + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action + ) { + null === ReactSharedInternals.T && + 0 === currentEntangledLane && + error$jscomp$0( + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2360 = current.child; - current = JSCompiler_object_inline_digest_2360.sibling; - JSCompiler_object_inline_digest_2360 = createWorkInProgress( - JSCompiler_object_inline_digest_2360, - { - mode: "visible", - children: JSCompiler_object_inline_stack_2361.children - } - ); - (workInProgress.mode & ConcurrentMode) === NoMode && - (JSCompiler_object_inline_digest_2360.lanes = renderLanes); - JSCompiler_object_inline_digest_2360.return = workInProgress; - JSCompiler_object_inline_digest_2360.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2360; - workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2360; + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + error$jscomp$0("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markStateUpdateScheduled(fiber, 2); } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); } - function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes - ) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - (mode & ConcurrentMode) === NoMode && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & ProfileMode && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; - } - function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; - } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot - ); + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - error$jscomp$0( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) - if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - error$jscomp$0( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - error$jscomp$0( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); + runWithFiberInDEV( + fiber, + function (erroredKey) { error$jscomp$0( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey ); - } - else - error$jscomp$0( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - error$jscomp$0( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), - error$jscomp$0( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - error$jscomp$0( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder + }, + key ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; + break; + } } - push(suspenseStackCursor, nextProps, workInProgress); - if ((workInProgress.mode & ConcurrentMode) === NoMode) - workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; } - function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - (workInProgress.mode & ConcurrentMode) === NoMode && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + ); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? error$jscomp$0( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : error$jscomp$0( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); + } + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? error$jscomp$0( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : error$jscomp$0( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress - ); - if (stateNode) break; - else return null; - case 22: - case 23: + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes - ); - enableOwnerStacks && - ((renderLanes._debugStack = workInProgress._debugStack), - (renderLanes._debugTask = workInProgress._debugTask)); - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; - } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - if (null !== current) + function createChild(returnFiber, newChild, lanes) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current || - workInProgress.type !== current.type + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((prevSibling = workInProgress.elementType), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(prevSibling)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - renderLanes = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - renderLanes + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( + if (isArrayImpl(newChild) || getIteratorFn(newChild)) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; + } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( returnFiber, - prevSibling, - renderLanes - ) + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; } - workInProgress = workInProgress.child; + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + error$jscomp$0( + "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(renderLanes)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = current), - setInitialProperties(returnFiber, renderLanes, current), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - case 27: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( returnFiber, - renderLanes + oldFiber, + newChildren[newIdx], + knownKeys )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys ); - case 6: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) return ( - null === current && - isHydrating && - ((renderLanes = workInProgress.pendingProps), - (current = getHostContext().ancestorInfo.current), - (renderLanes = - null != current - ? validateTextNesting(renderLanes, current.tag) - : !0), - (current = nextHydratableInstance), - (returnFiber = !current) || - ((returnFiber = canHydrateTextInstance( - current, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (renderLanes && - warnNonHydratedInstance(workInProgress, current), - throwOnHydrationMismatch(workInProgress))), - null + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - error$jscomp$0( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(returnFiber) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, returnFiber, prevSibling), - mountClassInstance( - workInProgress, - returnFiber, - prevSibling, - renderLanes - ), - finishClassComponent( - null, - workInProgress, - returnFiber, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - error$jscomp$0( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); - } - 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; + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - 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 + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); + } + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes ); - forcePropagateEntireTree || (nextFiber = null); - break a; + lanes.return = returnFiber; + returnFiber = lanes; } - list = dependency.next; + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); - 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 - ) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + error$jscomp$0( + "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (error$jscomp$0( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - return !0; - currentDependencies = currentDependencies.next; + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) + ); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - error$jscomp$0( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null + thenableState = null; + return firstChildFiber; + } catch (x) { + if ( + x === SuspenseException || + x === SuspenseActionException || + ((returnFiber.mode & ConcurrentMode) === NoMode && + "object" === typeof x && + null !== x && + "function" === typeof x.then) + ) + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } }; } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler + ); + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - error$jscomp$0( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + } + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); + } + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return null; } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + function defaultOnUncaughtError(error, errorInfo) { + reportGlobalError(error); + error = componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components."; + var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } + try { + warn( + "%s\n\n%s\n", + error, + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks + function defaultOnCaughtError(error$1, errorInfo) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."), + prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; }; - workInProgress.updateQueue = queue; - return; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + try { + "object" === typeof error$1 && + null !== error$1 && + "string" === typeof error$1.environmentName + ? bindToConsole( + "error", + [ + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ], + error$1.environmentName + )() + : error$jscomp$0( + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ); + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + } } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$12) { + setTimeout(function () { + throw e$12; + }); } } - function processUpdateQueue( - workInProgress, - props, - instance$jscomp$0, - renderLanes - ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$13) { + setTimeout(function () { + throw e$13; + }); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error$1 = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error$1); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + error$jscomp$0( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); + } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes + ) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + currentSourceFiber = sourceFiber.tag; + (sourceFiber.mode & ConcurrentMode) !== NoMode || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + isHydrating && + sourceFiber.mode & ConcurrentMode && + (didSuspendOrErrorDEV = !0); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: + return ( + sourceFiber.mode & ConcurrentMode && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & ConcurrentMode && + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + if (currentSourceFiber.mode & ConcurrentMode) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + currentSourceFiber.tag + + "). This is a bug in React." + ); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); + } + if (isHydrating && sourceFiber.mode & ConcurrentMode) + return ( + (didSuspendOrErrorDEV = !0), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 + ); + currentSourceFiber = createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; + } + function reconcileChildren( + current, + workInProgress, + nextChildren, + renderLanes + ) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); + } + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) + return ( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes + ); + } + if ((workInProgress.mode & ConcurrentMode) === NoMode) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes + ) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } + } + function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (error$jscomp$0( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + error$jscomp$0( + "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + componentName = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + componentName = getMaskedContext(workInProgress, componentName); + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + componentName, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes + ) { + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) + ); + enqueueCapturedUpdate(workInProgress, lane); + } + isContextProvider(Component) + ? ((_instance = !0), pushContextProvider(workInProgress)) + : (_instance = !1); + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { + state = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + state.state = oldState; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, lane); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof state.UNSAFE_componentWillUpdate && + "function" !== typeof state.componentWillUpdate) || + ("function" === typeof state.componentWillUpdate && + state.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof state.UNSAFE_componentWillUpdate && + state.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof state.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof state.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof state.componentDidUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof state.getSnapshotBeforeUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (state.props = nextProps), + (state.state = newState), + (state.context = oldContext), + (state = contextType)) + : ("function" !== typeof state.componentDidUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof state.getSnapshotBeforeUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (state = !1)); + } + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); + Component = workInProgress.stateNode; + state && + Component.props !== nextProps && + (didWarnAboutReassigningProps || + error$jscomp$0( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; + } + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( + workInProgress, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + error$jscomp$0( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (error$jscomp$0( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (error$jscomp$0( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_digest_2366; + var JSCompiler_object_inline_stack_2367 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_componentStack_2368 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_digest_2366 = didSuspend) || + (JSCompiler_object_inline_digest_2366 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_digest_2366 && + ((JSCompiler_object_inline_componentStack_2368 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_digest_2366 = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_componentStack_2368 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_message_2365 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2365)) { + c: { + var instance = JSCompiler_object_inline_message_2365; + for ( + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; + + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; + } + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_message_2365 + ), + throwOnHydrationMismatch(workInProgress)); + } + JSCompiler_object_inline_message_2365 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_message_2365 && + ((JSCompiler_object_inline_message_2365 = + JSCompiler_object_inline_message_2365.dehydrated), + null !== JSCompiler_object_inline_message_2365) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2365) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_message_2365 = + JSCompiler_object_inline_stack_2367.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2367.fallback; + if (JSCompiler_object_inline_componentStack_2368) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2367 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_message_2365, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_componentStack_2368 = + workInProgress.child), + (JSCompiler_object_inline_componentStack_2368.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_componentStack_2368.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2366, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2367 + ); + if ( + "number" === + typeof JSCompiler_object_inline_stack_2367.unstable_expectedLoadTime + ) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2367 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_message_2365, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_componentStack_2368 = + workInProgress.child), + (JSCompiler_object_inline_componentStack_2368.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_componentStack_2368.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2366, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2367 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_message_2365 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_message_2365 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2365) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2368 = + JSCompiler_object_inline_stack_2367.fallback), + (JSCompiler_object_inline_message_2365 = workInProgress.mode), + (JSCompiler_object_inline_stack_2367 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2367.children + }, + JSCompiler_object_inline_message_2365, + 0, + null + )), + (JSCompiler_object_inline_componentStack_2368 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2368, + JSCompiler_object_inline_message_2365, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2368.flags |= 2), + (JSCompiler_object_inline_stack_2367.return = workInProgress), + (JSCompiler_object_inline_componentStack_2368.return = + workInProgress), + (JSCompiler_object_inline_stack_2367.sibling = + JSCompiler_object_inline_componentStack_2368), + (workInProgress.child = JSCompiler_object_inline_stack_2367), + (workInProgress.mode & ConcurrentMode) !== NoMode && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2367 = workInProgress.child), + (JSCompiler_object_inline_stack_2367.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2367.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2366, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = + JSCompiler_object_inline_componentStack_2368)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + error$jscomp$0( + "We should not be hydrating here. This is a bug in React. Please file a bug." + ), + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2365)) + ) { + JSCompiler_object_inline_digest_2366 = + JSCompiler_object_inline_message_2365.nextSibling && + JSCompiler_object_inline_message_2365.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2366) { + JSCompiler_temp = JSCompiler_object_inline_digest_2366.dgst; + var message = JSCompiler_object_inline_digest_2366.msg; + instance = JSCompiler_object_inline_digest_2366.stck; + var componentStack = JSCompiler_object_inline_digest_2366.cstck; + } + JSCompiler_object_inline_message_2365 = message; + JSCompiler_object_inline_digest_2366 = JSCompiler_temp; + JSCompiler_object_inline_stack_2367 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2368 = + componentStack; + JSCompiler_object_inline_componentStack_2368 = + JSCompiler_object_inline_message_2365 + ? Error(JSCompiler_object_inline_message_2365) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + ); + JSCompiler_object_inline_componentStack_2368.stack = + JSCompiler_object_inline_stack_2367 || ""; + JSCompiler_object_inline_componentStack_2368.digest = + JSCompiler_object_inline_digest_2366; + JSCompiler_object_inline_digest_2366 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp; + JSCompiler_object_inline_stack_2367 = { + value: JSCompiler_object_inline_componentStack_2368, + source: null, + stack: JSCompiler_object_inline_digest_2366 + }; + "string" === typeof JSCompiler_object_inline_digest_2366 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2368, + JSCompiler_object_inline_stack_2367 + ); + queueHydrationError(JSCompiler_object_inline_stack_2367); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_digest_2366 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_digest_2366) + ) { + JSCompiler_object_inline_digest_2366 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_digest_2366 && + ((JSCompiler_object_inline_stack_2367 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2367 = + 0 !== (JSCompiler_object_inline_stack_2367 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2367 + )), + (JSCompiler_object_inline_stack_2367 = + 0 !== + (JSCompiler_object_inline_stack_2367 & + (JSCompiler_object_inline_digest_2366.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2367), + 0 !== JSCompiler_object_inline_stack_2367 && + JSCompiler_object_inline_stack_2367 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2367), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2367 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_digest_2366, + current, + JSCompiler_object_inline_stack_2367 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_message_2365.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + JSCompiler_object_inline_message_2365.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_message_2365.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2367.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_componentStack_2368) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2368 = + JSCompiler_object_inline_stack_2367.fallback), + (JSCompiler_object_inline_message_2365 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (componentStack = { + mode: "hidden", + children: JSCompiler_object_inline_stack_2367.children + }), + (JSCompiler_object_inline_message_2365 & ConcurrentMode) === NoMode && + workInProgress.child !== JSCompiler_temp + ? ((JSCompiler_object_inline_stack_2367 = workInProgress.child), + (JSCompiler_object_inline_stack_2367.childLanes = 0), + (JSCompiler_object_inline_stack_2367.pendingProps = + componentStack), + workInProgress.mode & ProfileMode && + ((JSCompiler_object_inline_stack_2367.actualDuration = -0), + (JSCompiler_object_inline_stack_2367.actualStartTime = -1.1), + (JSCompiler_object_inline_stack_2367.selfBaseDuration = + JSCompiler_temp.selfBaseDuration), + (JSCompiler_object_inline_stack_2367.treeBaseDuration = + JSCompiler_temp.treeBaseDuration)), + (workInProgress.deletions = null)) + : ((JSCompiler_object_inline_stack_2367 = createWorkInProgress( + JSCompiler_temp, + componentStack + )), + (JSCompiler_object_inline_stack_2367.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280)), + null !== instance + ? (JSCompiler_object_inline_componentStack_2368 = + createWorkInProgress( + instance, + JSCompiler_object_inline_componentStack_2368 + )) + : ((JSCompiler_object_inline_componentStack_2368 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2368, + JSCompiler_object_inline_message_2365, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2368.flags |= 2)), + (JSCompiler_object_inline_componentStack_2368.return = + workInProgress), + (JSCompiler_object_inline_stack_2367.return = workInProgress), + (JSCompiler_object_inline_stack_2367.sibling = + JSCompiler_object_inline_componentStack_2368), + (workInProgress.child = JSCompiler_object_inline_stack_2367), + (JSCompiler_object_inline_stack_2367 = + JSCompiler_object_inline_componentStack_2368), + (JSCompiler_object_inline_componentStack_2368 = workInProgress.child), + (JSCompiler_object_inline_message_2365 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2365 + ? (JSCompiler_object_inline_message_2365 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_message_2365.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_message_2365 = { + baseLanes: + JSCompiler_object_inline_message_2365.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_componentStack_2368.memoizedState = + JSCompiler_object_inline_message_2365), + (JSCompiler_object_inline_componentStack_2368.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2366, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2367 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_object_inline_digest_2366 = current.child; + current = JSCompiler_object_inline_digest_2366.sibling; + JSCompiler_object_inline_digest_2366 = createWorkInProgress( + JSCompiler_object_inline_digest_2366, + { + mode: "visible", + children: JSCompiler_object_inline_stack_2367.children + } + ); + (workInProgress.mode & ConcurrentMode) === NoMode && + (JSCompiler_object_inline_digest_2366.lanes = renderLanes); + JSCompiler_object_inline_digest_2366.return = workInProgress; + JSCompiler_object_inline_digest_2366.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_object_inline_digest_2366; + workInProgress.memoizedState = null; + return JSCompiler_object_inline_digest_2366; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); + } + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + (mode & ConcurrentMode) === NoMode && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & ProfileMode && + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; + } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + error$jscomp$0( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode + ) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + error$jscomp$0( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + error$jscomp$0( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + error$jscomp$0( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + error$jscomp$0( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + error$jscomp$0( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + error$jscomp$0( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + error$jscomp$0( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, + renderLanes, + workInProgress + ); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + if ((workInProgress.mode & ConcurrentMode) === NoMode) + workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + (workInProgress.mode & ConcurrentMode) === NoMode && + null !== current && + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } + function bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; + } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; + } + function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) { + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current || + workInProgress.type !== current.type + ) + 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; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + renderLanes + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); + } + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(renderLanes)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = current), + setInitialProperties(returnFiber, renderLanes, current), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((renderLanes = workInProgress.pendingProps), + (current = getHostContext().ancestorInfo.current), + (renderLanes = + null != current + ? validateTextNesting(renderLanes, current.tag) + : !0), + (current = nextHydratableInstance), + (returnFiber = !current) || + ((returnFiber = canHydrateTextInstance( + current, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (renderLanes && + warnNonHydratedInstance(workInProgress, current), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + error$jscomp$0( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + markComponentRenderStarted(workInProgress), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, returnFiber, prevSibling), + mountClassInstance( + workInProgress, + returnFiber, + prevSibling, + renderLanes + ), + finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -13619,6 +13600,14 @@ __DEV__ && committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -14598,17 +14587,17 @@ __DEV__ && null ); case 3: - newProps = workInProgress.stateNode; - renderLanes = null; - null !== current && (renderLanes = current.memoizedState.cache); - workInProgress.memoizedState.cache !== renderLanes && + renderLanes = workInProgress.stateNode; + newProps = null; + null !== current && (newProps = current.memoizedState.cache); + workInProgress.memoizedState.cache !== newProps && (workInProgress.flags |= 2048); popProvider(CacheContext, workInProgress); popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); - newProps.pendingContext && - ((newProps.context = newProps.pendingContext), - (newProps.pendingContext = null)); + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)); if (null === current || null === current.child) popHydrationState(workInProgress) ? (emitPendingHydrationWarnings(), markUpdate(workInProgress)) @@ -14616,9 +14605,7 @@ __DEV__ && (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -14827,9 +14814,9 @@ __DEV__ && renderLanes = getHostContext(); if (popHydrationState(workInProgress)) { current = workInProgress.stateNode; - newProps = workInProgress.memoizedProps; + renderLanes = workInProgress.memoizedProps; _type = !didSuspendOrErrorDEV; - renderLanes = null; + newProps = null; var returnFiber = hydrationParentFiber; if (null !== returnFiber) switch (returnFiber.tag) { @@ -14837,8 +14824,8 @@ __DEV__ && _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode(workInProgress, 0).serverProps = @@ -14846,12 +14833,12 @@ __DEV__ && break; case 27: case 5: - (renderLanes = returnFiber.memoizedProps), + (newProps = returnFiber.memoizedProps), _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode( @@ -14861,10 +14848,10 @@ __DEV__ && } current[internalInstanceKey] = workInProgress; current = - current.nodeValue === newProps || - (null !== renderLanes && - !0 === renderLanes.suppressHydrationWarning) || - checkForUnmatchedText(current.nodeValue, newProps) + current.nodeValue === renderLanes || + (null !== newProps && + !0 === newProps.suppressHydrationWarning) || + checkForUnmatchedText(current.nodeValue, renderLanes) ? !0 : !1; current || throwOnHydrationMismatch(workInProgress); @@ -14924,9 +14911,10 @@ __DEV__ && _type.treeBaseDuration)); _type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (_type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = _type), (_type = !0); if (!_type) { if (workInProgress.flags & 256) @@ -14943,22 +14931,22 @@ __DEV__ && transferActualDuration(workInProgress), workInProgress ); - newProps = null !== newProps; + renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - newProps && - ((renderLanes = workInProgress.child), + renderLanes && + ((newProps = workInProgress.child), (_type = null), - null !== renderLanes.alternate && - null !== renderLanes.alternate.memoizedState && - null !== renderLanes.alternate.memoizedState.cachePool && - (_type = renderLanes.alternate.memoizedState.cachePool.pool), + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (_type = newProps.alternate.memoizedState.cachePool.pool), (returnFiber = null), - null !== renderLanes.memoizedState && - null !== renderLanes.memoizedState.cachePool && - (returnFiber = renderLanes.memoizedState.cachePool.pool), - returnFiber !== _type && (renderLanes.flags |= 2048)); - newProps !== current && - newProps && + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (returnFiber = newProps.memoizedState.cachePool.pool), + returnFiber !== _type && (newProps.flags |= 2048)); + renderLanes !== current && + renderLanes && (workInProgress.child.flags |= 8192); scheduleRetryEffect(workInProgress, workInProgress.updateQueue); null !== workInProgress.updateQueue && @@ -14966,7 +14954,7 @@ __DEV__ && (workInProgress.flags |= 4); bubbleProperties(workInProgress); (workInProgress.mode & ProfileMode) !== NoMode && - newProps && + renderLanes && ((current = workInProgress.child), null !== current && (workInProgress.treeBaseDuration -= current.treeBaseDuration)); @@ -15017,9 +15005,13 @@ __DEV__ && scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; current = renderLanes; - for (newProps = workInProgress.child; null !== newProps; ) - resetWorkInProgress(newProps, current), - (newProps = newProps.sibling); + for ( + renderLanes = workInProgress.child; + null !== renderLanes; + + ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); push( suspenseStackCursor, (suspenseStackCursor.current & @@ -15107,27 +15099,27 @@ __DEV__ && workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) : bubbleProperties(workInProgress), - (newProps = workInProgress.updateQueue), - null !== newProps && - scheduleRetryEffect(workInProgress, newProps.retryQueue), - (newProps = null), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && - (newProps = current.memoizedState.cachePool.pool), - (renderLanes = null), + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), null !== workInProgress.memoizedState && null !== workInProgress.memoizedState.cachePool && - (renderLanes = workInProgress.memoizedState.cachePool.pool), - renderLanes !== newProps && (workInProgress.flags |= 2048), + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), null !== current && pop(resumedCache, workInProgress), null ); case 24: return ( - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && (workInProgress.flags |= 2048), popProvider(CacheContext, workInProgress), bubbleProperties(workInProgress), @@ -15448,7 +15440,13 @@ __DEV__ && } exitStatus = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = errorRetryLanes; - null !== exitStatus && queueRecoverableErrors(exitStatus); + null !== exitStatus && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = exitStatus) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + exitStatus + )); } exitStatus = errorRetryLanes$jscomp$0; } @@ -15564,14 +15562,6 @@ __DEV__ && } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -15760,7 +15750,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -16397,9 +16387,6 @@ __DEV__ && throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -16413,24 +16400,30 @@ __DEV__ && root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= CommitContext), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects( @@ -16454,12 +16447,12 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - (transitions = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), + (transitions = spawnedLane) + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : (releaseRootPooledCache(root, remainingLanes), @@ -16471,7 +16464,6 @@ __DEV__ && onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -16479,16 +16471,17 @@ __DEV__ && finishedWork++ ) (remainingLanes = recoverableErrors[finishedWork]), - (transitions = makeErrorInfo(remainingLanes.stack)), + (spawnedLane = makeErrorInfo(remainingLanes.stack)), runWithFiberInDEV( remainingLanes.source, renderPriorityLevel, remainingLanes.value, - transitions + spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) @@ -16799,7 +16792,7 @@ __DEV__ && shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -23430,6 +23423,59 @@ __DEV__ && profilerEffectDuration = -0, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + 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$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23624,7 +23670,83 @@ __DEV__ && pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypeAndContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + error$jscomp$0( + "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23662,45 +23784,6 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - 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$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null - }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23721,7 +23804,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -25099,82 +25182,6 @@ __DEV__ && SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypeAndContextTypes = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - error$jscomp$0( - "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -25220,23 +25227,10 @@ __DEV__ && var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -25331,7 +25325,6 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -25822,52 +25815,43 @@ __DEV__ && ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? error$jscomp$0( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? error$jscomp$0( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && error$jscomp$0( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && error$jscomp$0( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork(); container[internalContainerInstanceKey] = null; } @@ -25891,11 +25875,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-a9bbe346-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-native-fb-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-native-fb-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25932,10 +25916,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -26081,5 +26065,5 @@ __DEV__ && listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-a9bbe346-20241219"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js index 304ec91255017..5c5d8e1dc6339 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<825a0a9412af7f43b65c1651cd25d37d>> */ /* @@ -2109,19 +2109,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$292; + var JSCompiler_inline_result$jscomp$293; if (canUseDOM) { - var isSupported$jscomp$inline_419 = "oninput" in document; - if (!isSupported$jscomp$inline_419) { - var element$jscomp$inline_420 = document.createElement("div"); - element$jscomp$inline_420.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_419 = - "function" === typeof element$jscomp$inline_420.oninput; + var isSupported$jscomp$inline_420 = "oninput" in document; + if (!isSupported$jscomp$inline_420) { + var element$jscomp$inline_421 = document.createElement("div"); + element$jscomp$inline_421.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_420 = + "function" === typeof element$jscomp$inline_421.oninput; } - JSCompiler_inline_result$jscomp$292 = isSupported$jscomp$inline_419; - } else JSCompiler_inline_result$jscomp$292 = !1; + JSCompiler_inline_result$jscomp$293 = isSupported$jscomp$inline_420; + } else JSCompiler_inline_result$jscomp$293 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$292 && + JSCompiler_inline_result$jscomp$293 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2620,357 +2620,172 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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; } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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 pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + 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 = parent.type; + 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; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$1), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; -} -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; -} -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); -} -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$3() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -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$2 = 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 readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -3032,4963 +2847,5166 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); -} -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); -} -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes -) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -} -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; +function processUpdateQueue( + workInProgress$jscomp$0, + props, + instance$jscomp$0, + renderLanes +) { + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$26 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$26 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; -} -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - return getServerSnapshot; -} -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); -} -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); -} -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState +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$2 = 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 }; - return hook; } -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps ) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$32) { - onActionError(actionQueue, node, error$32); - } +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); +function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - actionQueue.action = null; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$28 in Component) + void 0 === newProps[propName$28] && + (newProps[propName$28] = Component[propName$28]); + } + return newProps; } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function actionStateReducer(oldState, newState) { - return newState; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; - } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; - } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; -} -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$1), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps -) { - identityTag = { - resourceKind: 0, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: 1, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } } -function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - return effect; -} -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; -} -function updateRef() { - return updateWorkInProgressHook().memoizedState; -} -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; + } + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } +function noop$3() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); -} -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); -} -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); - } +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function noop$2() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function requestFormReset$1(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function refreshCache(fiber) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root$35 = enqueueUpdate(provider, fiber, lane); - null !== root$35 && - (scheduleUpdateOnFiber(root$35, provider, lane), - entangleTransitions(root$35, provider, lane)); - provider = { cache: createCache() }; - fiber.payload = provider; - return; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; +} +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; +} +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - provider = provider.return; + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, next: null }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + return workInProgressHook; } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } + throw Error(formatProdErrorMessage(438, String(usable))); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError, - useHostTransitionStatus: throwInvalidHookError, - useFormState: throwInvalidHookError, - useActionState: throwInvalidHookError, - useOptimistic: throwInvalidHookError, - useMemoCache: throwInvalidHookError, - useCacheRefresh: throwInvalidHookError -}; -enableUseResourceEffectHook && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; +} +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; +} +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); +} +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -}; -enableUseResourceEffectHook && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: rerenderActionState, - useActionState: rerenderActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$33 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$33 && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null + ); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } } } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); +} +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; + } + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + } } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); +} +function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps +) { + identityTag = { + resourceKind: 0, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: 1, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); +} +function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + return effect; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); +} +function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); +} +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - coerceRef(current, element); - current.return = returnFiber; - return current; +} +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +} +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; +} +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function updatePortal(returnFiber, current, portal, lanes) { + hook.memoizedState = [prevState, deps]; + return prevState; +} +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; +} +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; - } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); +} +function noop$2() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$1(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root$42 = enqueueUpdate(provider, fiber, lane); + null !== root$42 && + (scheduleUpdateOnFiber(root$42, provider, lane), + entangleTransitions(root$42, provider, lane)); + provider = { cache: createCache() }; + fiber.payload = provider; + return; } - return null; + provider = provider.return; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 ); + } catch (error) { + } finally { } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + return !1; +} +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); +} +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); +} +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; +} +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } +} +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +enableUseResourceEffectHook && + (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); -} -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); -} -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); -} -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); -} -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; -} -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); } }; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; -} -function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return ctor; -} -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - "object" === typeof contextType && null !== contextType - ? (instance.context = readContext(contextType)) - : ((contextType = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, contextType))); - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$67 in Component) - void 0 === newProps[propName$67] && - (newProps[propName$67] = Component[propName$67]); - } - return newProps; -} -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); +enableUseResourceEffectHook && + (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); +var HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); } -function defaultOnCaughtError(error) { - console.error(error); +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) + ); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { - setTimeout(function () { - throw e$68; - }); - } +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -function logCaughtError(root, boundary, errorInfo) { - try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$69) { - setTimeout(function () { - throw e$69; - }); +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } -} -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; -} -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; -} -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); -} -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - if (0 === (suspenseBoundary.mode & 1)) - return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary - ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; -} -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: - return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); - } - if (1 === root.tag) + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - value = Error(formatProdErrorMessage(426)); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; } - if (isHydrating && sourceFiber.mode & 1) - return ( - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes ); - currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); - currentSourceFiber = createCapturedValueAtFiber( - currentSourceFiber, - sourceFiber - ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; -} -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); -} -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation ) return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); -} -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; + function createChild(returnFiber, newChild, lanes) { if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); -} -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } -} -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - context = getMaskedContext(workInProgress, context); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - context, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; -} -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (isContextProvider(Component)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - oldProps = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, oldProps); - instance.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = instance.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - instance.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - oldProps !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldContext), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - hasContext, - renderLanes - ); -} -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { - markRef(current, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - shouldUpdate = workInProgress.stateNode; - var nextChildren = - didCaptureError && "function" !== typeof Component.getDerivedStateFromError - ? null - : shouldUpdate.render(); - workInProgress.flags |= 1; - null !== current && didCaptureError - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - nextChildren, - renderLanes - ))) - : reconcileChildren(current, workInProgress, nextChildren, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; -} -function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); + } + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; } - nextInstance = JSCompiler_temp$jscomp$0; + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes ); - popSuspenseHandler(workInProgress); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - nextInstance, - 0, - null - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - nextProps = Error(formatProdErrorMessage(419)); - nextProps.stack = ""; - nextProps.digest = JSCompiler_temp; - queueHydrationError({ value: nextProps, source: null, stack: null }); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) + thenableState = null; + return firstChildFiber; + } catch (x) { + if ( + x === SuspenseException || + x === SuspenseActionException || + (0 === (returnFiber.mode & 1) && + "object" === typeof x && + null !== x && + "function" === typeof x.then) + ) + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; +} +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) ) { - JSCompiler_temp = workInProgressRoot; + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; if ( - null !== JSCompiler_temp && - ((nextProps = renderLanes & -renderLanes), - (nextProps = - 0 !== (nextProps & 42) - ? 1 - : getBumpedLaneForHydrationByLane(nextProps)), - (nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps), - 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) ) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (didSuspend = { mode: "hidden", children: nextProps.children }), - 0 === (nextInstance & 1) && - workInProgress.child !== JSCompiler_temp$jscomp$0 - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = didSuspend), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - JSCompiler_temp$jscomp$0, - didSuspend - )), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; -} -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + return null; } -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes -) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - 0 === (mode & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren)) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); } -function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; +function defaultOnCaughtError(error) { + console.error(error); } -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +function defaultOnRecoverableError(error) { + reportGlobalError(error); } -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode -) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$74) { + setTimeout(function () { + throw e$74; + }); + } } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= 1; +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$75) { + setTimeout(function () { + throw e$75; + }); } - push(suspenseStackCursor, nextProps); - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; } -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; +} +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; } - return workInProgress.child; + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + if (0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + sourceFiber.flags |= 32768; + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 ); - break; - case 13: - var state = workInProgress.memoizedState; - if (null !== state) { - if (null !== state.dehydrated) + currentSourceFiber = sourceFiber.tag; + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - state = 0 !== (renderLanes & workInProgress.childLanes); - state || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (state = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (state) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (state) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -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; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - var elementType = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 + sourceFiber.mode & 1 && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), + !1 ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== elementType) { - elementType = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(elementType); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === elementType) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes + case 22: + if (currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; } - return workInProgress; - case 26: + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (elementType = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (elementType[internalInstanceKey] = workInProgress), - (elementType[internalPropsKey] = current), - setInitialProperties(elementType, renderLanes, current), - markNodeAsHoistable(elementType), - (workInProgress.stateNode = elementType)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((elementType = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(elementType.firstChild))), - (elementType = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren(current, workInProgress, elementType, renderLanes) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes + value = Error(formatProdErrorMessage(426)); + } + if (isHydrating && sourceFiber.mode & 1) + return ( + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = elementType = nextHydratableInstance)) - (elementType = canHydrateInstance( - elementType, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - null !== elementType - ? ((workInProgress.stateNode = elementType), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - elementType.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - elementType = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (elementType = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (elementType = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; +} +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( workInProgress, - workInProgress.pendingProps, + current.child, + nextChildren, renderLanes - ), - workInProgress.child - ); - case 8: + ); +} +function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - reconcileChildren( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - workInProgress.pendingProps.children, + type, + nextProps, renderLanes - ), - workInProgress.child + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); +} +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 12: + } + if (0 === (workInProgress.mode & 1)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - reconcileChildren( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.pendingProps.children, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, renderLanes - ), - workInProgress.child + ) ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + context, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (nextProps = !0); + else if (null === current) { + var instance = workInProgress.stateNode, + unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + instance, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (elementType = elementType(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + instance, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + shouldUpdate = workInProgress.stateNode; + var nextChildren = + didCaptureError && "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + current.child, + null, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + )), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + null, + nextChildren, renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); + ))) + : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } -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 pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( + workInProgress, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); } -function propagateContextChanges( +function mountHostRootWithoutHydrating( + current, workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree + nextChildren, + renderLanes ) { - 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; - } + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; } -function propagateParentContextChanges( +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( current, - workInProgress, - renderLanes, - forcePropagateEntireTree + primaryTreeDidDefer, + renderLanes ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; - ) { - 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 = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } - } 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])); + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + if ("number" === typeof nextProps.unstable_expectedLoadTime) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); + } + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + nextInstance, + 0, + null + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + 0 !== (workInProgress.mode & 1) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + nextProps = Error(formatProdErrorMessage(419)); + nextProps.stack = ""; + nextProps.digest = JSCompiler_temp; + queueHydrationError({ value: nextProps, source: null, stack: null }); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) ) - ) - return !0; - currentDependencies = currentDependencies.next; + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (didSuspend = { mode: "hidden", children: nextProps.children }), + 0 === (nextInstance & 1) && + workInProgress.child !== JSCompiler_temp$jscomp$0 + ? ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + (workInProgress.deletions = null)) + : ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; + workInProgress.memoizedState = null; + return JSCompiler_temp; } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes +) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + 0 === (mode & 1) && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; - } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); +} +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); +} +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 13: + var state = workInProgress.memoizedState; + if (null !== state) { + if (null !== state.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + state = 0 !== (renderLanes & workInProgress.childLanes); + state || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (state = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (state) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (state) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + var elementType = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var init = elementType._init; + elementType = init(elementType._payload); + workInProgress.type = elementType; + if ("function" === typeof elementType) + shouldConstruct(elementType) + ? ((current = resolveClassComponentProps(elementType, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))); + else { + if (void 0 !== elementType && null !== elementType) + if ( + ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + elementType = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== elementType) { + elementType = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(elementType); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === elementType) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (elementType = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((elementType = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren(current, workInProgress, elementType, renderLanes) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== elementType + ? ((workInProgress.stateNode = elementType), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + elementType.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + elementType = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (elementType = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, elementType, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (elementType = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (elementType = elementType(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function commitHookEffectListMount(flags, finishedWork) { try { @@ -9633,6 +9651,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -10394,9 +10420,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -10610,8 +10634,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -10632,11 +10658,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$157 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$157 = newProps.memoizedState.cachePool.pool); + cache$157 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10670,8 +10696,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$157 = type.rendering; + if (null === cache$157) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10679,11 +10705,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$157 = findFirstSuspended(current); + if (null !== cache$157) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$157.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10708,7 +10734,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$157)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10718,7 +10744,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$157.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10731,13 +10757,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$157.sibling = workInProgress.child), + (workInProgress.child = cache$157)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$157) + : (workInProgress.child = cache$157), + (type.last = cache$157)); } if (null !== type.tail) return ( @@ -10938,7 +10964,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11066,7 +11091,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -11164,14 +11194,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -11297,7 +11319,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11354,7 +11376,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -11475,12 +11497,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$176) { - handleThrow(root, thrownValue$176); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11591,11 +11613,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$178) { - handleThrow(root, thrownValue$178); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11662,7 +11684,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11828,9 +11850,6 @@ function commitRootImpl( 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( @@ -11844,23 +11863,29 @@ function commitRootImpl( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffectsOnFiber(finishedWork, root), @@ -11870,19 +11895,18 @@ function commitRootImpl( (root.current = finishedWork), commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : 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; @@ -11896,6 +11920,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates @@ -11913,7 +11938,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$182 = rootWithPendingPassiveEffects, + var root$183 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11952,7 +11977,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$182, remainingLanes); + releaseRootPooledCache(root$183, remainingLanes); } } return !1; @@ -12096,14 +12121,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$184 = firstScheduledRoot; null !== root$184; ) { - if (!onlyLegacy || 0 === root$184.tag) + for (var root$185 = firstScheduledRoot; null !== root$185; ) { + if (!onlyLegacy || 0 === root$185.tag) if (0 !== syncTransitionLanes) { - var pendingLanes = root$184.pendingLanes; + var pendingLanes = root$185.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$184.suspendedLanes, - pingedLanes = root$184.pingedLanes; + var suspendedLanes = root$185.suspendedLanes, + pingedLanes = root$185.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12117,18 +12142,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$184, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$184, - root$184 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$185, + root$185 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$184, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$185, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$184, JSCompiler_inline_result)); - root$184 = root$184.next; + performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); + root$185 = root$185.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12359,20 +12384,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1479 = 0; - i$jscomp$inline_1479 < simpleEventPluginEvents.length; - i$jscomp$inline_1479++ + var i$jscomp$inline_1484 = 0; + i$jscomp$inline_1484 < simpleEventPluginEvents.length; + i$jscomp$inline_1484++ ) { - var eventName$jscomp$inline_1480 = - simpleEventPluginEvents[i$jscomp$inline_1479], - domEventName$jscomp$inline_1481 = - eventName$jscomp$inline_1480.toLowerCase(), - capitalizedEvent$jscomp$inline_1482 = - eventName$jscomp$inline_1480[0].toUpperCase() + - eventName$jscomp$inline_1480.slice(1); + var eventName$jscomp$inline_1485 = + simpleEventPluginEvents[i$jscomp$inline_1484], + domEventName$jscomp$inline_1486 = + eventName$jscomp$inline_1485.toLowerCase(), + capitalizedEvent$jscomp$inline_1487 = + eventName$jscomp$inline_1485[0].toUpperCase() + + eventName$jscomp$inline_1485.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1481, - "on" + capitalizedEvent$jscomp$inline_1482 + domEventName$jscomp$inline_1486, + "on" + capitalizedEvent$jscomp$inline_1487 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13555,34 +13580,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$198 = props[hasSrc]; - if (null != propValue$198) + var propValue$199 = props[hasSrc]; + if (null != propValue$199) switch (hasSrc) { case "name": - hasSrcSet = propValue$198; + hasSrcSet = propValue$199; break; case "type": - propValue = propValue$198; + propValue = propValue$199; break; case "checked": - checked = propValue$198; + checked = propValue$199; break; case "defaultChecked": - defaultChecked = propValue$198; + defaultChecked = propValue$199; break; case "value": - propKey = propValue$198; + propKey = propValue$199; break; case "defaultValue": - defaultValue = propValue$198; + defaultValue = propValue$199; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$198) + if (null != propValue$199) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$198, props, null); + setProp(domElement, tag, hasSrc, propValue$199, props, null); } } initInput( @@ -13719,14 +13744,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$198 in props) - props.hasOwnProperty(propValue$198) && - ((hasSrc = props[propValue$198]), + for (propValue$199 in props) + props.hasOwnProperty(propValue$199) && + ((hasSrc = props[propValue$199]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$198, + propValue$199, hasSrc, props, void 0 @@ -13774,14 +13799,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$215 in nextProps) { - var propKey = nextProps[propKey$215]; - lastProp = lastProps[propKey$215]; + for (var propKey$216 in nextProps) { + var propKey = nextProps[propKey$216]; + lastProp = lastProps[propKey$216]; if ( - nextProps.hasOwnProperty(propKey$215) && + nextProps.hasOwnProperty(propKey$216) && (null != propKey || null != lastProp) ) - switch (propKey$215) { + switch (propKey$216) { case "type": type = propKey; break; @@ -13810,7 +13835,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$215, + propKey$216, propKey, nextProps, lastProp @@ -13829,7 +13854,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$215 = null; + propKey = value = defaultValue = propKey$216 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13860,7 +13885,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$215 = type; + propKey$216 = type; break; case "defaultValue": defaultValue = type; @@ -13881,15 +13906,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$215 - ? updateOptions(domElement, !!lastProps, propKey$215, !1) + null != propKey$216 + ? updateOptions(domElement, !!lastProps, propKey$216, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$215 = null; + propKey = propKey$216 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13913,7 +13938,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$215 = name; + propKey$216 = name; break; case "defaultValue": propKey = name; @@ -13927,17 +13952,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$215, propKey); + updateTextarea(domElement, propKey$216, propKey); return; case "option": - for (var propKey$231 in lastProps) + for (var propKey$232 in lastProps) if ( - ((propKey$215 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$231)) + ((propKey$216 = lastProps[propKey$232]), + lastProps.hasOwnProperty(propKey$232) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$232)) ) - switch (propKey$231) { + switch (propKey$232) { case "selected": domElement.selected = !1; break; @@ -13945,33 +13970,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$231, + propKey$232, null, nextProps, - propKey$215 + propKey$216 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$215 = nextProps[lastDefaultValue]), + ((propKey$216 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$215 && - "function" !== typeof propKey$215 && - "symbol" !== typeof propKey$215; + propKey$216 && + "function" !== typeof propKey$216 && + "symbol" !== typeof propKey$216; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$215, + propKey$216, nextProps, propKey ); @@ -13992,24 +14017,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$236 in lastProps) - (propKey$215 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$236) && - setProp(domElement, tag, propKey$236, null, nextProps, propKey$215); + for (var propKey$237 in lastProps) + (propKey$216 = lastProps[propKey$237]), + lastProps.hasOwnProperty(propKey$237) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$237) && + setProp(domElement, tag, propKey$237, null, nextProps, propKey$216); for (checked in nextProps) if ( - ((propKey$215 = nextProps[checked]), + ((propKey$216 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$215) + if (null != propKey$216) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14017,7 +14042,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$215, + propKey$216, nextProps, propKey ); @@ -14025,49 +14050,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$241 in lastProps) - (propKey$215 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - void 0 !== propKey$215 && - !nextProps.hasOwnProperty(propKey$241) && + for (var propKey$242 in lastProps) + (propKey$216 = lastProps[propKey$242]), + lastProps.hasOwnProperty(propKey$242) && + void 0 !== propKey$216 && + !nextProps.hasOwnProperty(propKey$242) && setPropOnCustomElement( domElement, tag, - propKey$241, + propKey$242, void 0, nextProps, - propKey$215 + propKey$216 ); for (defaultChecked in nextProps) - (propKey$215 = nextProps[defaultChecked]), + (propKey$216 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$215 === propKey || - (void 0 === propKey$215 && void 0 === propKey) || + propKey$216 === propKey || + (void 0 === propKey$216 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$215, + propKey$216, nextProps, propKey ); return; } } - for (var propKey$246 in lastProps) - (propKey$215 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$246) && - setProp(domElement, tag, propKey$246, null, nextProps, propKey$215); + for (var propKey$247 in lastProps) + (propKey$216 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$247) && + setProp(domElement, tag, propKey$247, null, nextProps, propKey$216); for (lastProp in nextProps) - (propKey$215 = nextProps[lastProp]), + (propKey$216 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$215 === propKey || - (null == propKey$215 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$215, nextProps, propKey); + propKey$216 === propKey || + (null == propKey$216 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$216, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14629,26 +14654,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$254 = getResourcesFromRoot( + var styles$255 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$255 = styles$254.get(type); - resource$255 || + resource$256 = styles$255.get(type); + resource$256 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$255 = { + (resource$256 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$254.set(type, resource$255), - (styles$254 = JSCompiler_inline_result.querySelector( + styles$255.set(type, resource$256), + (styles$255 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$254._p && - ((resource$255.instance = styles$254), - (resource$255.state.loading = 5)), + !styles$255._p && + ((resource$256.instance = styles$255), + (resource$256.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14661,16 +14686,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$254 || + styles$255 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$255.state + resource$256.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$255; + return resource$256; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14767,37 +14792,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$260 = hoistableRoot.querySelector( + var instance$261 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$260) + if (instance$261) return ( (resource.state.loading |= 4), - (resource.instance = instance$260), - markNodeAsHoistable(instance$260), - instance$260 + (resource.instance = instance$261), + markNodeAsHoistable(instance$261), + instance$261 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$260 = ( + instance$261 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$260); - var linkInstance = instance$260; + markNodeAsHoistable(instance$261); + var linkInstance = instance$261; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$260, "link", instance); + setInitialProperties(instance$261, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$260, props.precedence, hoistableRoot); - return (resource.instance = instance$260); + insertStylesheet(instance$261, props.precedence, hoistableRoot); + return (resource.instance = instance$261); case "script": - instance$260 = getScriptKey(props.src); + instance$261 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$260) + getScriptSelectorFromKey(instance$261) )) ) return ( @@ -14806,7 +14831,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$260))) + if ((styleProps = preloadPropsMap.get(instance$261))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15865,16 +15890,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1722 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1727 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== - isomorphicReactPackageVersion$jscomp$inline_1722 + "19.1.0-native-fb-a9bbe346-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1727 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1722, - "19.1.0-native-fb-d4287258-20241217" + isomorphicReactPackageVersion$jscomp$inline_1727, + "19.1.0-native-fb-a9bbe346-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15894,24 +15919,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2177 = { +var internals$jscomp$inline_2185 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2178 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2186 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2178.isDisabled && - hook$jscomp$inline_2178.supportsFiber + !hook$jscomp$inline_2186.isDisabled && + hook$jscomp$inline_2186.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2178.inject( - internals$jscomp$inline_2177 + (rendererID = hook$jscomp$inline_2186.inject( + internals$jscomp$inline_2185 )), - (injectedHook = hook$jscomp$inline_2178); + (injectedHook = hook$jscomp$inline_2186); } catch (err) {} } exports.createRoot = function (container, options) { @@ -16005,4 +16030,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js index 62fd4e680560d..6f676bbec3abd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<921ba538ee001d2e2ff89934b5513f72>> + * @generated SignedSource<<1e4743f91768a024f444b4349f371812>> */ /* @@ -2204,19 +2204,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$308; + var JSCompiler_inline_result$jscomp$309; if (canUseDOM) { - var isSupported$jscomp$inline_435 = "oninput" in document; - if (!isSupported$jscomp$inline_435) { - var element$jscomp$inline_436 = document.createElement("div"); - element$jscomp$inline_436.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_435 = - "function" === typeof element$jscomp$inline_436.oninput; + var isSupported$jscomp$inline_436 = "oninput" in document; + if (!isSupported$jscomp$inline_436) { + var element$jscomp$inline_437 = document.createElement("div"); + element$jscomp$inline_437.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_436 = + "function" === typeof element$jscomp$inline_437.oninput; } - JSCompiler_inline_result$jscomp$308 = isSupported$jscomp$inline_435; - } else JSCompiler_inline_result$jscomp$308 = !1; + JSCompiler_inline_result$jscomp$309 = isSupported$jscomp$inline_436; + } else JSCompiler_inline_result$jscomp$309 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$308 && + JSCompiler_inline_result$jscomp$309 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2769,357 +2769,172 @@ function transferActualDuration(fiber) { for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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; } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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 pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + 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 = parent.type; + 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; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$1), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; -} -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; -} -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); -} -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$3() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -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$2 = 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 readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -3181,5013 +2996,5216 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); -} -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); -} -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes -) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -} -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; +function processUpdateQueue( + workInProgress$jscomp$0, + props, + instance$jscomp$0, + renderLanes +) { + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$28 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$28 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$28 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$28 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; -} -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - return getServerSnapshot; -} -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); -} -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); -} -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState +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$2 = 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 }; - return hook; } -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps ) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$34) { - onActionError(actionQueue, node, error$34); - } +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); +function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - actionQueue.action = null; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$30 in Component) + void 0 === newProps[propName$30] && + (newProps[propName$30] = Component[propName$30]); + } + return newProps; } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function actionStateReducer(oldState, newState) { - return newState; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; - } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; - } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; -} -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$1), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps -) { - identityTag = { - resourceKind: 0, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: 1, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } } -function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - return effect; -} -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; -} -function updateRef() { - return updateWorkInProgressHook().memoizedState; -} -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; + } + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } +function noop$3() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); - } +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function noop$2() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function requestFormReset$1(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function refreshCache(fiber) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root$37 = enqueueUpdate(provider, fiber, lane); - null !== root$37 && - (scheduleUpdateOnFiber(root$37, provider, lane), - entangleTransitions(root$37, provider, lane)); - provider = { cache: createCache() }; - fiber.payload = provider; - return; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; +} +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - provider = provider.return; + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, next: null }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); - markStateUpdateScheduled(fiber, lane); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); - markStateUpdateScheduled(fiber, lane); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markStateUpdateScheduled(fiber, 2); + return workInProgressHook; } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } + throw Error(formatProdErrorMessage(438, String(usable))); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError, - useHostTransitionStatus: throwInvalidHookError, - useFormState: throwInvalidHookError, - useActionState: throwInvalidHookError, - useOptimistic: throwInvalidHookError, - useMemoCache: throwInvalidHookError, - useCacheRefresh: throwInvalidHookError -}; -enableUseResourceEffectHook && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; +} +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; +} +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); +} +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -}; -enableUseResourceEffectHook && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: rerenderActionState, - useActionState: rerenderActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); -} -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; -} -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$35 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$35 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$35 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$35 && + ((reducer = currentEntangledActionThenable), null !== reducer)) ) - ); -} -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); -} -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; +} +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; - } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + return [newState, dispatch]; +} +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); } - return null; } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); +} +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$41) { + onActionError(actionQueue, node, error$41); } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; } - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { - } + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; } -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); } -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - } else reuseSuspenseHandlerOnStack(fiber); + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; } -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; } -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; +function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps +function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps ) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + identityTag = { + resourceKind: 0, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: 1, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + return effect; } -function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return ctor; +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +function updateRef() { + return updateWorkInProgressHook().memoizedState; } -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - "object" === typeof contextType && null !== contextType - ? (instance.context = readContext(contextType)) - : ((contextType = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, contextType))); - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$69 in Component) - void 0 === newProps[propName$69] && - (newProps[propName$69] = Component[propName$69]); - } - return newProps; +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); } -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); } -function defaultOnCaughtError(error) { - console.error(error); +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { - setTimeout(function () { - throw e$70; - }); +function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } -function logCaughtError(root, boundary, errorInfo) { - try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$71) { - setTimeout(function () { - throw e$71; - }); +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); } -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); } -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); + hook.memoizedState = [prevState, deps]; + return prevState; } -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - if (0 === (suspenseBoundary.mode & 1)) +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); + } +} +function noop$2() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$1(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root$44 = enqueueUpdate(provider, fiber, lane); + null !== root$44 && + (scheduleUpdateOnFiber(root$44, provider, lane), + entangleTransitions(root$44, provider, lane)); + provider = { cache: createCache() }; + fiber.payload = provider; + return; + } + provider = provider.return; + } +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); + markStateUpdateScheduled(fiber, lane); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, lane); + markStateUpdateScheduled(fiber, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), !1 ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + } catch (error) { + } finally { } - throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); - } - if (1 === root.tag) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - value = Error(formatProdErrorMessage(426)); } - if (isHydrating && sourceFiber.mode & 1) - return ( - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 - ); - currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); - currentSourceFiber = createCapturedValueAtFiber( - currentSourceFiber, - sourceFiber - ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); return !1; } -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markStateUpdateScheduled(fiber, 2); } -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - key = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); } -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; - } -} -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - context = getMaskedContext(workInProgress, context); - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - context, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +enableUseResourceEffectHook && + (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; -} -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (isContextProvider(Component)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - oldProps = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, oldProps); - instance.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = instance.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - instance.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - oldProps !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldContext), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } +}; +enableUseResourceEffectHook && + (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); +var HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); +} +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) + ); +} +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); +} +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - hasContext, - renderLanes - ); -} -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { - markRef(current, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - shouldUpdate = workInProgress.stateNode; - if ( - didCaptureError && - "function" !== typeof Component.getDerivedStateFromError + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ) { - var nextChildren = null; - profilerStartTime = -1; - } else - markComponentRenderStarted(workInProgress), - (nextChildren = shouldUpdate.render()), - markComponentRenderStopped(); - workInProgress.flags |= 1; - null !== current && didCaptureError - ? ((didCaptureError = nextChildren), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - didCaptureError, - renderLanes - ))) - : reconcileChildren(current, workInProgress, nextChildren, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; -} -function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; } - nextInstance = JSCompiler_temp$jscomp$0; + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); + } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes ); - popSuspenseHandler(workInProgress); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - nextInstance, - 0, - null - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - nextProps = Error(formatProdErrorMessage(419)); - nextProps.stack = ""; - nextProps.digest = JSCompiler_temp; - queueHydrationError({ value: nextProps, source: null, stack: null }); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) - ) { - JSCompiler_temp = workInProgressRoot; + thenableState = null; + return firstChildFiber; + } catch (x) { if ( - null !== JSCompiler_temp && - ((nextProps = renderLanes & -renderLanes), - (nextProps = - 0 !== (nextProps & 42) - ? 1 - : getBumpedLaneForHydrationByLane(nextProps)), - (nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps), - 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + x === SuspenseException || + x === SuspenseActionException || + (0 === (returnFiber.mode & 1) && + "object" === typeof x && + null !== x && + "function" === typeof x.then) ) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; +} +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (didSuspend = { mode: "hidden", children: nextProps.children }), - 0 === (nextInstance & 1) && - workInProgress.child !== JSCompiler_temp$jscomp$0 - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = didSuspend), - workInProgress.mode & 2 && - ((nextProps.actualDuration = -0), - (nextProps.actualStartTime = -1.1), - (nextProps.selfBaseDuration = - JSCompiler_temp$jscomp$0.selfBaseDuration), - (nextProps.treeBaseDuration = - JSCompiler_temp$jscomp$0.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - JSCompiler_temp$jscomp$0, - didSuspend - )), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; + return null; } -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); } -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes -) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - 0 === (mode & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; +function defaultOnCaughtError(error) { + console.error(error); } -function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; +function defaultOnRecoverableError(error) { + reportGlobalError(error); +} +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$76) { + setTimeout(function () { + throw e$76; + }); + } +} +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$77) { + setTimeout(function () { + throw e$77; + }); + } +} +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; +} +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; } -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + if (0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes +) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + currentSourceFiber = sourceFiber.tag; + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: + return ( + sourceFiber.mode & 1 && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + if (currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - nextProps &= 1; + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - push(suspenseStackCursor, nextProps); - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + if (isHydrating && sourceFiber.mode & 1) + return ( + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); } - return workInProgress.child; -} -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; -} -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + current.child, + nextChildren, + renderLanes + ); } -function attemptEarlyBailoutIfNoScheduledUpdate( +function updateForwardRef( current, workInProgress, + Component, + nextProps, renderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) +function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null === current) { + var type = Component.type; if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare ) - 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; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - var elementType = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - elementType, - init, + type, + nextProps, renderLanes ) ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== elementType) { - elementType = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(elementType); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === elementType) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (elementType = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (elementType[internalInstanceKey] = workInProgress), - (elementType[internalPropsKey] = current), - setInitialProperties(elementType, renderLanes, current), - markNodeAsHoistable(elementType), - (workInProgress.stateNode = elementType)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); +} +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 27: + } + if (0 === (workInProgress.mode & 1)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((elementType = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(elementType.firstChild))), - (elementType = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren(current, workInProgress, elementType, renderLanes) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = elementType = nextHydratableInstance)) - (elementType = canHydrateInstance( - elementType, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== elementType - ? ((workInProgress.stateNode = elementType), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - elementType.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - elementType = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (elementType = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, + renderLanes + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + context, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (nextProps = !0); + else if (null === current) { + var instance = workInProgress.stateNode, + unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + instance, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( workInProgress, - workInProgress.stateNode.containerInfo - ), - (elementType = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, + instance, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + shouldUpdate = workInProgress.stateNode; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else + markComponentRenderStarted(workInProgress), + (nextChildren = shouldUpdate.render()), + markComponentRenderStopped(); + workInProgress.flags |= 1; + null !== current && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + current.child, + null, renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = -0), - (elementType.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + )), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + null, + didCaptureError, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + ))) + : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; +} +function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); +} +function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes +) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; + + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + } + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - elementType, - !0, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, + JSCompiler_temp, renderLanes - ) + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps ); - case 28: + if ("number" === typeof nextProps.unstable_expectedLoadTime) return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - elementType, - init, + nextInstance, + JSCompiler_temp$jscomp$0, renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_temp, renderLanes - ), - workInProgress.child + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps ); - case 29: - throw workInProgress.pendingProps; + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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; + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + nextInstance, + 0, + null + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + 0 !== (workInProgress.mode & 1) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + nextProps = Error(formatProdErrorMessage(419)); + nextProps.stack = ""; + nextProps.digest = JSCompiler_temp; + queueHydrationError({ value: nextProps, source: null, stack: null }); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (didSuspend = { mode: "hidden", children: nextProps.children }), + 0 === (nextInstance & 1) && + workInProgress.child !== JSCompiler_temp$jscomp$0 + ? ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + workInProgress.mode & 2 && + ((nextProps.actualDuration = -0), + (nextProps.actualStartTime = -1.1), + (nextProps.selfBaseDuration = + JSCompiler_temp$jscomp$0.selfBaseDuration), + (nextProps.treeBaseDuration = + JSCompiler_temp$jscomp$0.treeBaseDuration)), + (workInProgress.deletions = null)) + : ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; + workInProgress.memoizedState = null; + return JSCompiler_temp; } -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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 mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function propagateParentContextChanges( - current, +function mountSuspenseFallbackChildren( workInProgress, - renderLanes, - forcePropagateEntireTree + primaryChildren, + fallbackChildren, + renderLanes ) { - 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 = parent.type; - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + 0 === (mode & 1) && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; - } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } + return workInProgress.child; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; +} +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + var elementType = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var init = elementType._init; + elementType = init(elementType._payload); + workInProgress.type = elementType; + if ("function" === typeof elementType) + shouldConstruct(elementType) + ? ((current = resolveClassComponentProps(elementType, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))); + else { + if (void 0 !== elementType && null !== elementType) + if ( + ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + elementType = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== elementType) { + elementType = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(elementType); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === elementType) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (elementType = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((elementType = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren(current, workInProgress, elementType, renderLanes) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== elementType + ? ((workInProgress.stateNode = elementType), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + elementType.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + elementType = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (elementType = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, elementType, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (elementType = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = -0), + (elementType.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + markComponentRenderStarted(workInProgress), + (elementType = elementType(init)), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -10080,6 +10098,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -10899,9 +10925,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -11126,8 +11150,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= type.treeBaseDuration)); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -11153,11 +11179,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$171 = null; + var cache$172 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$171 = newProps.memoizedState.cachePool.pool); - cache$171 !== type && (newProps.flags |= 2048); + (cache$172 = newProps.memoizedState.cachePool.pool); + cache$172 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -11196,8 +11222,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$171 = type.rendering; - if (null === cache$171) + cache$172 = type.rendering; + if (null === cache$172) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -11205,11 +11231,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$171 = findFirstSuspended(current); - if (null !== cache$171) { + cache$172 = findFirstSuspended(current); + if (null !== cache$172) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$171.updateQueue; + current = cache$172.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11234,7 +11260,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$171)), null !== current)) { + if (((current = findFirstSuspended(cache$172)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11244,7 +11270,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$171.alternate && + !cache$172.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11257,13 +11283,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$171.sibling = workInProgress.child), - (workInProgress.child = cache$171)) + ? ((cache$172.sibling = workInProgress.child), + (workInProgress.child = cache$172)) : ((current = type.last), null !== current - ? (current.sibling = cache$171) - : (workInProgress.child = cache$171), - (type.last = cache$171)); + ? (current.sibling = cache$172) + : (workInProgress.child = cache$172), + (type.last = cache$172)); } if (null !== type.tail) return ( @@ -11473,7 +11499,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11602,7 +11627,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -11700,14 +11730,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -11833,7 +11855,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11890,7 +11912,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -12051,12 +12073,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$191) { - handleThrow(root, thrownValue$191); + } catch (thrownValue$192) { + handleThrow(root, thrownValue$192); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12175,11 +12197,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$193) { - handleThrow(root, thrownValue$193); + } catch (thrownValue$194) { + handleThrow(root, thrownValue$194); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12264,7 +12286,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -12440,9 +12462,6 @@ function commitRootImpl( 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( @@ -12456,24 +12475,30 @@ function commitRootImpl( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), @@ -12491,12 +12516,12 @@ function commitRootImpl( "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); @@ -12504,7 +12529,6 @@ function commitRootImpl( 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -12518,6 +12542,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), @@ -12537,7 +12562,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, + var root$198 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12587,7 +12612,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); + releaseRootPooledCache(root$198, remainingLanes); } } return !1; @@ -12738,14 +12763,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$199 = firstScheduledRoot; null !== root$199; ) { - if (!onlyLegacy || 0 === root$199.tag) + for (var root$200 = firstScheduledRoot; null !== root$200; ) { + if (!onlyLegacy || 0 === root$200.tag) if (0 !== syncTransitionLanes) { - var pendingLanes = root$199.pendingLanes; + var pendingLanes = root$200.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$199.suspendedLanes, - pingedLanes = root$199.pingedLanes; + var suspendedLanes = root$200.suspendedLanes, + pingedLanes = root$200.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12759,18 +12784,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$199, - root$199 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$200, + root$200 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$199, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$200, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); - root$199 = root$199.next; + performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); + root$200 = root$200.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -13004,20 +13029,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1567 = 0; - i$jscomp$inline_1567 < simpleEventPluginEvents.length; - i$jscomp$inline_1567++ + var i$jscomp$inline_1572 = 0; + i$jscomp$inline_1572 < simpleEventPluginEvents.length; + i$jscomp$inline_1572++ ) { - var eventName$jscomp$inline_1568 = - simpleEventPluginEvents[i$jscomp$inline_1567], - domEventName$jscomp$inline_1569 = - eventName$jscomp$inline_1568.toLowerCase(), - capitalizedEvent$jscomp$inline_1570 = - eventName$jscomp$inline_1568[0].toUpperCase() + - eventName$jscomp$inline_1568.slice(1); + var eventName$jscomp$inline_1573 = + simpleEventPluginEvents[i$jscomp$inline_1572], + domEventName$jscomp$inline_1574 = + eventName$jscomp$inline_1573.toLowerCase(), + capitalizedEvent$jscomp$inline_1575 = + eventName$jscomp$inline_1573[0].toUpperCase() + + eventName$jscomp$inline_1573.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1569, - "on" + capitalizedEvent$jscomp$inline_1570 + domEventName$jscomp$inline_1574, + "on" + capitalizedEvent$jscomp$inline_1575 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14200,34 +14225,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$213 = props[hasSrc]; - if (null != propValue$213) + var propValue$214 = props[hasSrc]; + if (null != propValue$214) switch (hasSrc) { case "name": - hasSrcSet = propValue$213; + hasSrcSet = propValue$214; break; case "type": - propValue = propValue$213; + propValue = propValue$214; break; case "checked": - checked = propValue$213; + checked = propValue$214; break; case "defaultChecked": - defaultChecked = propValue$213; + defaultChecked = propValue$214; break; case "value": - propKey = propValue$213; + propKey = propValue$214; break; case "defaultValue": - defaultValue = propValue$213; + defaultValue = propValue$214; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$213) + if (null != propValue$214) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$213, props, null); + setProp(domElement, tag, hasSrc, propValue$214, props, null); } } initInput( @@ -14364,14 +14389,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$213 in props) - props.hasOwnProperty(propValue$213) && - ((hasSrc = props[propValue$213]), + for (propValue$214 in props) + props.hasOwnProperty(propValue$214) && + ((hasSrc = props[propValue$214]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$213, + propValue$214, hasSrc, props, void 0 @@ -14419,14 +14444,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$230 in nextProps) { - var propKey = nextProps[propKey$230]; - lastProp = lastProps[propKey$230]; + for (var propKey$231 in nextProps) { + var propKey = nextProps[propKey$231]; + lastProp = lastProps[propKey$231]; if ( - nextProps.hasOwnProperty(propKey$230) && + nextProps.hasOwnProperty(propKey$231) && (null != propKey || null != lastProp) ) - switch (propKey$230) { + switch (propKey$231) { case "type": type = propKey; break; @@ -14455,7 +14480,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$230, + propKey$231, propKey, nextProps, lastProp @@ -14474,7 +14499,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$230 = null; + propKey = value = defaultValue = propKey$231 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14505,7 +14530,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$230 = type; + propKey$231 = type; break; case "defaultValue": defaultValue = type; @@ -14526,15 +14551,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$230 - ? updateOptions(domElement, !!lastProps, propKey$230, !1) + null != propKey$231 + ? updateOptions(domElement, !!lastProps, propKey$231, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$230 = null; + propKey = propKey$231 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14558,7 +14583,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$230 = name; + propKey$231 = name; break; case "defaultValue": propKey = name; @@ -14572,17 +14597,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$230, propKey); + updateTextarea(domElement, propKey$231, propKey); return; case "option": - for (var propKey$246 in lastProps) + for (var propKey$247 in lastProps) if ( - ((propKey$230 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$246)) + ((propKey$231 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$247)) ) - switch (propKey$246) { + switch (propKey$247) { case "selected": domElement.selected = !1; break; @@ -14590,33 +14615,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$246, + propKey$247, null, nextProps, - propKey$230 + propKey$231 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$230 = nextProps[lastDefaultValue]), + ((propKey$231 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$231 !== propKey && + (null != propKey$231 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$230 && - "function" !== typeof propKey$230 && - "symbol" !== typeof propKey$230; + propKey$231 && + "function" !== typeof propKey$231 && + "symbol" !== typeof propKey$231; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$230, + propKey$231, nextProps, propKey ); @@ -14637,24 +14662,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$251 in lastProps) - (propKey$230 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$251) && - setProp(domElement, tag, propKey$251, null, nextProps, propKey$230); + for (var propKey$252 in lastProps) + (propKey$231 = lastProps[propKey$252]), + lastProps.hasOwnProperty(propKey$252) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$252) && + setProp(domElement, tag, propKey$252, null, nextProps, propKey$231); for (checked in nextProps) if ( - ((propKey$230 = nextProps[checked]), + ((propKey$231 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$231 !== propKey && + (null != propKey$231 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$230) + if (null != propKey$231) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14662,7 +14687,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$230, + propKey$231, nextProps, propKey ); @@ -14670,49 +14695,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$256 in lastProps) - (propKey$230 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - void 0 !== propKey$230 && - !nextProps.hasOwnProperty(propKey$256) && + for (var propKey$257 in lastProps) + (propKey$231 = lastProps[propKey$257]), + lastProps.hasOwnProperty(propKey$257) && + void 0 !== propKey$231 && + !nextProps.hasOwnProperty(propKey$257) && setPropOnCustomElement( domElement, tag, - propKey$256, + propKey$257, void 0, nextProps, - propKey$230 + propKey$231 ); for (defaultChecked in nextProps) - (propKey$230 = nextProps[defaultChecked]), + (propKey$231 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$230 === propKey || - (void 0 === propKey$230 && void 0 === propKey) || + propKey$231 === propKey || + (void 0 === propKey$231 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$230, + propKey$231, nextProps, propKey ); return; } } - for (var propKey$261 in lastProps) - (propKey$230 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$261) && - setProp(domElement, tag, propKey$261, null, nextProps, propKey$230); + for (var propKey$262 in lastProps) + (propKey$231 = lastProps[propKey$262]), + lastProps.hasOwnProperty(propKey$262) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$262) && + setProp(domElement, tag, propKey$262, null, nextProps, propKey$231); for (lastProp in nextProps) - (propKey$230 = nextProps[lastProp]), + (propKey$231 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$230 === propKey || - (null == propKey$230 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$230, nextProps, propKey); + propKey$231 === propKey || + (null == propKey$231 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$231, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15274,26 +15299,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$269 = getResourcesFromRoot( + var styles$270 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$270 = styles$269.get(type); - resource$270 || + resource$271 = styles$270.get(type); + resource$271 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$270 = { + (resource$271 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$269.set(type, resource$270), - (styles$269 = JSCompiler_inline_result.querySelector( + styles$270.set(type, resource$271), + (styles$270 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$269._p && - ((resource$270.instance = styles$269), - (resource$270.state.loading = 5)), + !styles$270._p && + ((resource$271.instance = styles$270), + (resource$271.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15306,16 +15331,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$269 || + styles$270 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$270.state + resource$271.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$270; + return resource$271; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15412,37 +15437,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$275 = hoistableRoot.querySelector( + var instance$276 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$275) + if (instance$276) return ( (resource.state.loading |= 4), - (resource.instance = instance$275), - markNodeAsHoistable(instance$275), - instance$275 + (resource.instance = instance$276), + markNodeAsHoistable(instance$276), + instance$276 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$275 = ( + instance$276 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$275); - var linkInstance = instance$275; + markNodeAsHoistable(instance$276); + var linkInstance = instance$276; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$275, "link", instance); + setInitialProperties(instance$276, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$275, props.precedence, hoistableRoot); - return (resource.instance = instance$275); + insertStylesheet(instance$276, props.precedence, hoistableRoot); + return (resource.instance = instance$276); case "script": - instance$275 = getScriptKey(props.src); + instance$276 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$275) + getScriptSelectorFromKey(instance$276) )) ) return ( @@ -15451,7 +15476,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$275))) + if ((styleProps = preloadPropsMap.get(instance$276))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16518,16 +16543,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1817 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== - isomorphicReactPackageVersion$jscomp$inline_1812 + "19.1.0-native-fb-a9bbe346-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1817 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1812, - "19.1.0-native-fb-d4287258-20241217" + isomorphicReactPackageVersion$jscomp$inline_1817, + "19.1.0-native-fb-a9bbe346-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16547,17 +16572,17 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1819 = { +var internals$jscomp$inline_1824 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$292 = 0; - 31 > index$292; - index$292++ + var map = new Map(), lane = 1, index$293 = 0; + 31 > index$293; + index$293++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -16570,16 +16595,16 @@ var internals$jscomp$inline_1819 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2229 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2237 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2229.isDisabled && - hook$jscomp$inline_2229.supportsFiber + !hook$jscomp$inline_2237.isDisabled && + hook$jscomp$inline_2237.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2229.inject( - internals$jscomp$inline_1819 + (rendererID = hook$jscomp$inline_2237.inject( + internals$jscomp$inline_1824 )), - (injectedHook = hook$jscomp$inline_2229); + (injectedHook = hook$jscomp$inline_2237); } catch (err) {} } exports.createRoot = function (container, options) { @@ -16673,4 +16698,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js index 3875c06f9a8d6..634775eb9717d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<17633deb05f7682ba139a825caf4520c>> + * @generated SignedSource<<00ecb576e82a6dfa19b248b1ce8275b9>> */ /* @@ -2466,6 +2466,8 @@ __DEV__ && "hr" === tag || "option" === tag || "optgroup" === tag || + "script" === tag || + "template" === tag || "#text" === tag ); case "optgroup": @@ -4279,472 +4281,245 @@ __DEV__ && for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && + error$jscomp$0( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer = rendererSigil; } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); } - function warnIfNotHydrating() { - isHydrating || + 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; + } + parent !== propagationRoot && error$jscomp$0( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + 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( - "Saw multiple hydration diff roots in a pass. This is a bug in React." + "We just came from a parent so we must have had a parent. This is a bug in React." ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); + 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 + ) { + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - return hydrationDiffRootDEV; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; + workInProgress.flags |= 262144; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + return !0; + currentDependencies = currentDependencies.next; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$2), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); + return !1; } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); - } - throwOnHydrationMismatch(fiber); - } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) + function readContext(context) { + isDisallowedContextReadInDEV && + error$jscomp$0( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); + } + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); + } + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); + function entangleAsyncAction(transition, thenable) { + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + currentEntangledActionThenable = { + status: "pending", + value: void 0, + then: function (resolve) { + entangledListeners.push(resolve); + } + }; + } + currentEntangledPendingCount++; + thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); + return thenable; } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - error$jscomp$0( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; - } - function noop$4() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - error$jscomp$0( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$4, noop$4), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; - } - } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; - } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; - } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); - } - function entangleAsyncAction(transition, thenable) { - if (null === currentEntangledListeners) { - var entangledListeners = (currentEntangledListeners = []); - currentEntangledPendingCount = 0; - currentEntangledLane = requestTransitionLane(); - currentEntangledActionThenable = { - status: "pending", - value: void 0, - then: function (resolve) { - entangledListeners.push(resolve); - } - }; - } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; - } - function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners - ) { - null !== currentEntangledActionThenable && - (currentEntangledActionThenable.status = "fulfilled"); - var listeners = currentEntangledListeners; - currentEntangledListeners = null; - currentEntangledLane = 0; - currentEntangledActionThenable = null; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); - } + function pingEngtangledActionScope() { + if ( + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners + ) { + null !== currentEntangledActionThenable && + (currentEntangledActionThenable.status = "fulfilled"); + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = 0; + currentEntangledActionThenable = null; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); + } } function chainThenableValue(thenable, result) { var listeners = [], @@ -4771,6645 +4546,6851 @@ __DEV__ && ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + error$jscomp$0( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - error$jscomp$0( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - error$jscomp$0( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - error$jscomp$0( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - error$jscomp$0( - "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", - currentHookNameInDev - ), - !1 - ); - nextDeps.length !== prevDeps.length && - error$jscomp$0( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - error$jscomp$0( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } - } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - (current.mode & ConcurrentMode) !== NoMode && - error$jscomp$0( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) - throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." - ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - error$jscomp$0( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); - } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; - } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; - } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; - } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; - } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; - } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error("An unsupported type was passed to use(): " + String(usable)); - } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && - error$jscomp$0( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; - } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && - error$jscomp$0( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." - ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + currentlyProcessingQueue = null; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + callback.call(context); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (error$jscomp$0( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (error$jscomp$0( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (error$jscomp$0( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function retainCache(cache) { + cache.controller.signal.aborted && + warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error$3) { - return !0; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + error$jscomp$0( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } + } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + error$jscomp$0( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - initialStateInitializer(); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } + void 0 === oldProps && + error$jscomp$0( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); - } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + addendum = new ctor(props, context); } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); - } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$5) { - onActionError(actionQueue, node, error$5); + setIsStrictModeForDevtools(!1); } - } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), error$jscomp$0( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); - } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); - } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } } - actionQueue.action = null; - } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; } - function actionStateReducer(oldState, newState) { - return newState; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + error$jscomp$0( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; - } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; - } - } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; - } - isMatching && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; - } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); - } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; - } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; - } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; - } - function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); - } - function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps - ) { - identityTag = { - resourceKind: ResourceEffectIdentityKind, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: ResourceEffectUpdateKind, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); - } - function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; - } - return effect; - } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; - } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); - } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); - } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); - } - function mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - if ( - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 142608384; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); - } - function updateResourceEffectImpl( - fiberFlags, - hookFlags, - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if ( - null != destroy.resourceKind && - destroy.resourceKind === ResourceEffectUpdateKind - ) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else - throw Error( - "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." - ); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if ( - null != destroy.resourceKind && - destroy.resourceKind === ResourceEffectUpdateKind - ) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else - throw Error( - "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." - ); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } - } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? hookFlags : HasEffect | hookFlags, - isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, - inst, - create, - createDeps, - update, - updateDeps - ); - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - error$jscomp$0( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name ); - } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + instance.contextType && error$jscomp$0( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + instance.contextTypes && error$jscomp$0( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; - } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; - } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + ctor.childContextTypes && + !didWarnAboutChildContextTypes.has(ctor) && + (didWarnAboutChildContextTypes.add(ctor), + error$jscomp$0( + "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + name + )); + ctor.contextTypes && + !didWarnAboutContextTypes$1.has(ctor) && + (didWarnAboutContextTypes$1.add(ctor), + error$jscomp$0( + "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; - } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error$6) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error$6 }, - requestUpdateLane(fiber) + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); - } - } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$2(formFiber) { - null === ReactSharedInternals.T && + "function" === typeof instance.componentDidReceiveProps && error$jscomp$0( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); - } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); - } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); - } - function refreshCache(fiber, seedKey) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - error$jscomp$0( - "The seed argument is not enabled outside experimental channels." - ); - fiber.payload = { cache: provider }; - return; - } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + "function" === typeof instance.componentWillRecieveProps && error$jscomp$0( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); - } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + "function" === typeof instance.UNSAFE_componentWillRecieveProps && error$jscomp$0( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); - } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error$7) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); - } - return !1; - } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && error$jscomp$0( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - error$jscomp$0("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markStateUpdateScheduled(fiber, 2); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + instance + ); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + instance ); + instance.state = workInProgress.memoizedState; + name = ctor.getDerivedStateFromProps; + "function" === typeof name && + (applyDerivedStateFromProps(workInProgress, ctor, name, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - error$jscomp$0( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key - ); - break; - } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } + return newProps; } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' - ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? error$jscomp$0( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : error$jscomp$0( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? error$jscomp$0( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : error$jscomp$0( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); + function warnIfNotHydrating() { + isHydrating || + error$jscomp$0( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); + } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings + ); + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; + } + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); + } + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) + ); + throw HydrationMismatchException; + } + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$2), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); + } + throwOnHydrationMismatch(fiber); } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - enableOwnerStacks && (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; + } + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; + } + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; + } + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); + } + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + error$jscomp$0( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); + } + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop$4() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + error$jscomp$0( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current + thenable.then(noop$4, noop$4), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + default: + if ("string" === typeof thenable.status) + thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - function updatePortal(returnFiber, current, portal, lanes) { + } + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; + } + function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + } + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + } + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); + } + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); + } + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; + } + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + } + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + error$jscomp$0( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - enableOwnerStacks && (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current + } + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || + error$jscomp$0( + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps + ); + } + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), + error$jscomp$0( + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); + } + function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + } + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + error$jscomp$0( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + currentHookNameInDev + ), + !1 + ); + nextDeps.length !== prevDeps.length && + error$jscomp$0( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; + } + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + error$jscomp$0( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { + setIsStrictModeForDevtools(!0); + try { + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } finally { + setIsStrictModeForDevtools(!1); + } } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + finishRenderingHooks(current, workInProgress); + return children; + } + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.mode & ConcurrentMode) !== NoMode && + error$jscomp$0( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + error$jscomp$0( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); + } + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." + ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; - } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; + } + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; + } + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; + } + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + didScheduleRenderPhaseUpdate = !1; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; + } + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; + } + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); - throwOnInvalidObjectType(returnFiber, newChild); + throw Error("Rendered more hooks than during the previous render."); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - error$jscomp$0( - "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); - } - return knownKeys; + return workInProgressHook; + } + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; + } + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; + } + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { + throw Error("An unsupported type was passed to use(): " + String(usable)); + } + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + error$jscomp$0( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + memoCache.index++; + return updateQueue; + } + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; + } + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + } + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); + } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + current.baseQueue !== baseQueue && + error$jscomp$0( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - error$jscomp$0( - "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; } else - newChild.entries !== key || - didWarnAboutMaps || - (error$jscomp$0( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - enableOwnerStacks && - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - ((returnFiber.mode & ConcurrentMode) === NoMode && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - enableOwnerStacks && - (fiber._debugTask = debugInfo[i].debugTask); - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; - } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler - ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); - } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); - } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); - } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; - } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - error$jscomp$0( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - error$jscomp$0( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + return [newState, dispatch]; } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (error$jscomp$0( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (error$jscomp$0( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; + } + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (error$jscomp$0( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - if (workInProgress.mode & StrictLegacyMode) { + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + } + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error$3) { + return !0; + } + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); + initialStateInitializer(); } finally { setIsStrictModeForDevtools(!1); } } - void 0 === oldProps && - error$jscomp$0( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" - ); - return oldProps; } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; } - function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - if ( - "contextType" in ctor && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(ctor) - ) { - didWarnAboutInvalidateContextType.add(ctor); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(ctor) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - addendum = new ctor(props, context); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - addendum = new ctor(props, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - props = workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null; - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof ctor.getDerivedStateFromProps && - null === props && - ((props = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUninitializedState.has(props) || - (didWarnAboutUninitializedState.add(props), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - props, - null === addendum.state ? "null" : "undefined", - props - ))); - if ( - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (props = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (props = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (props = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== props || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - var _componentName = getComponentNameFromType(ctor) || "Component"; - ctor = - "function" === typeof ctor.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _componentName, - ctor, - null !== props ? "\n " + props : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error$4) { + onActionError(actionQueue, node, error$4); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$5) { + onActionError(actionQueue, node, error$5); } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + error$jscomp$0( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return addendum; + actionQueue.action = null; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext - ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - error$jscomp$0( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } - function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode, - name = getComponentNameFromType(ctor) || "Component"; - instance.render || - (ctor.prototype && "function" === typeof ctor.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - name - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - name - )); - !instance.getInitialState || - instance.getInitialState.isReactClassApproved || - instance.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - name - ); - instance.getDefaultProps && - !instance.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - name - ); - instance.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - name - ); - instance.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - name - ); - ctor.contextType && - ctor.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(ctor) && - (didWarnAboutContextTypeAndContextTypes.add(ctor), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - name - )); - ctor.childContextTypes && - !didWarnAboutChildContextTypes.has(ctor) && - (didWarnAboutChildContextTypes.add(ctor), - error$jscomp$0( - "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - name - )); - ctor.contextTypes && - !didWarnAboutContextTypes$1.has(ctor) && - (didWarnAboutContextTypes$1.add(ctor), - error$jscomp$0( - "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - name - )); - "function" === typeof instance.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - name - ); - ctor.prototype && - ctor.prototype.isPureReactComponent && - "undefined" !== typeof instance.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(ctor) || "A pure component" - ); - "function" === typeof instance.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - name - ); - "function" === typeof instance.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - name - ); - "function" === typeof instance.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - name - ); - "function" === typeof instance.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - name - ); - var hasMutatedProps = instance.props !== newProps; - void 0 !== instance.props && - hasMutatedProps && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - name - ); - instance.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - name, - name - ); - "function" !== typeof instance.getSnapshotBeforeUpdate || - "function" === typeof instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(ctor) - )); - "function" === typeof instance.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof instance.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof ctor.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - name - ); - (hasMutatedProps = instance.state) && - ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && - error$jscomp$0("%s.state: must be set to an object or null", name); - "function" === typeof instance.getChildContext && - "object" !== typeof ctor.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - name - ); - instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - name = ctor.contextType; - "object" === typeof name && null !== name - ? (instance.context = readContext(name)) - : ((name = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, name))); - instance.state === newProps && - ((name = getComponentNameFromType(ctor) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(name) || - (didWarnAboutDirectlyAssigningPropsToState.add(name), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - name - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - instance - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - instance - ); - instance.state = workInProgress.memoizedState; - name = ctor.getDerivedStateFromProps; - "function" === typeof name && - (applyDerivedStateFromProps(workInProgress, ctor, name, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; + function actionStateReducer(oldState, newState) { + return newState; } - function defaultOnUncaughtError(error, errorInfo) { - reportGlobalError(error); - error = componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - if (!enableOwnerStacks) { - var componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - } - try { - warn( - "%s\n\n%s\n", - error, - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); - } - } - function defaultOnCaughtError(error$1, errorInfo) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - if (!enableOwnerStacks) { - var componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - } - try { - "object" === typeof error$1 && - null !== error$1 && - "string" === typeof error$1.environmentName - ? bindToConsole( - "error", - [ - "%o\n\n%s\n\n%s\n", - error$1, - componentNameMessage, - recreateMessage - ], - error$1.environmentName - )() - : error$jscomp$0( - "%o\n\n%s\n\n%s\n", - error$1, - componentNameMessage, - recreateMessage - ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; + } + isMatching && (initialStateProp = ssrFormState[0]); + } } + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; } - function defaultOnRecoverableError(error) { - reportGlobalError(error); + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - } catch (e$12) { - setTimeout(function () { - throw e$12; - }); - } - } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$13) { - setTimeout(function () { - throw e$13; - }); - } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error$1 = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error$1); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - error$jscomp$0( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); + function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes + function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps ) { - if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) - return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary - ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + identityTag = { + resourceKind: ResourceEffectIdentityKind, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: ResourceEffectUpdateKind, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes + function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; + } + return effect; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - currentSourceFiber = sourceFiber.tag; - (sourceFiber.mode & ConcurrentMode) !== NoMode || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - isHydrating && - sourceFiber.mode & ConcurrentMode && - (didSuspendOrErrorDEV = !0); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: - return ( - sourceFiber.mode & ConcurrentMode && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & ConcurrentMode && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & ConcurrentMode) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); - } - if (1 === root.tag) - return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 - ); - value = Error( - "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + var hookFlags = Passive, + hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 142608384; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); + } else + (hookFlags = Passive), + (hook = mountWorkInProgressHook()), + (currentlyRenderingFiber.flags |= 8390656), + (inst = createEffectInstance()), + (inst.destroy = destroy), + (hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + inst, + create, + createDeps, + update, + updateDeps + )); + } + function updateResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if ( + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind + ) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else + throw Error( + "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." + ); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if ( + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind + ) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else + throw Error( + "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React." + ); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } - if (isHydrating && sourceFiber.mode & ConcurrentMode) - return ( - (didSuspendOrErrorDEV = !0), - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 - ); - currentSourceFiber = createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= fiberFlags); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? hookFlags : HasEffect | hookFlags, + isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === - typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; + } + if (null !== ref && void 0 !== ref) return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ref.hasOwnProperty("current") || + error$jscomp$0( + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" + ), + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + error$jscomp$0( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + error$jscomp$0( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps ); } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if ((workInProgress.mode & ConcurrentMode) === NoMode) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes - ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." - ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } + hook.memoizedState = [nextValue, deps]; + return nextValue; } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (error$jscomp$0( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ), - (didWarnAboutBadClass[componentName] = !0)); + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - error$jscomp$0( - "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - componentName = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - componentName = getMaskedContext(workInProgress, componentName); - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - componentName, - renderLanes + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - nextProps = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } - function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - enqueueCapturedUpdate(workInProgress, lane); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error$6) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$6 }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - isContextProvider(Component) - ? ((_instance = !0), pushContextProvider(workInProgress)) - : (_instance = !1); - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (state = !0); - else if (null === current) { - state = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - state.props = lane; - var oldContext = state.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - state.state = oldState; - processUpdateQueue(workInProgress, nextProps, state, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (state.props = nextProps), - (state.state = oldContext), - (state.context = contextType), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (state = !1)); - } else { - state = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - lane = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, lane); - state.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = state.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof state.getSnapshotBeforeUpdate) || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - state.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, state, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof state.UNSAFE_componentWillUpdate && - "function" !== typeof state.componentWillUpdate) || - ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof state.UNSAFE_componentWillUpdate && - state.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof state.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof state.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof state.componentDidUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (state.props = nextProps), - (state.state = newState), - (state.context = oldContext), - (state = contextType)) - : ("function" !== typeof state.componentDidUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (state = !1)); - } - current = finishClassComponent( - current, - workInProgress, - Component, - state, - _instance, - renderLanes - ); - Component = workInProgress.stateNode; - state && - Component.props !== nextProps && - (didWarnAboutReassigningProps || - error$jscomp$0( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" - ), - (didWarnAboutReassigningProps = !0)); - return current; } - function finishClassComponent( - current$jscomp$0, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes - ) { - markRef(current$jscomp$0, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && - invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - ) + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." ); - shouldUpdate = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if ( - didCaptureError && - "function" !== typeof Component.getDerivedStateFromError - ) { - var nextChildren = null; - profilerStartTime = -1; - } else { - markComponentRenderStarted(workInProgress); - nextChildren = callRenderInDEV(shouldUpdate); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(shouldUpdate); - } finally { - setIsStrictModeForDevtools(!1); - } - } - markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && didCaptureError - ? ((didCaptureError = nextChildren), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - didCaptureError, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - nextChildren, - renderLanes - ); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; - } - function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } + ); } - function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && + function requestFormReset$2(formFiber) { + null === ReactSharedInternals.T && error$jscomp$0( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (error$jscomp$0( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (error$jscomp$0( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes - ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2365; - var JSCompiler_object_inline_stack_2366 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2367 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2365 = didSuspend) || - (JSCompiler_object_inline_digest_2365 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2365 && - ((JSCompiler_object_inline_componentStack_2367 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2365 = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_componentStack_2367 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_message_2364 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2364)) { - c: { - var instance = JSCompiler_object_inline_message_2364; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_message_2364 - ), - throwOnHydrationMismatch(workInProgress)); + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + error$jscomp$0( + "The seed argument is not enabled outside experimental channels." + ); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; + } + } + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + error$jscomp$0( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + error$jscomp$0( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error$7) { + } finally { + ReactSharedInternals.H = prevDispatcher; } - JSCompiler_object_inline_message_2364 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_message_2364 && - ((JSCompiler_object_inline_message_2364 = - JSCompiler_object_inline_message_2364.dehydrated), - null !== JSCompiler_object_inline_message_2364) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2364) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2364 = - JSCompiler_object_inline_stack_2366.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2366.fallback; - if (JSCompiler_object_inline_componentStack_2367) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2366 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_message_2364, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_componentStack_2367 = - workInProgress.child), - (JSCompiler_object_inline_componentStack_2367.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2367.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2365, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2366 + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - if ( - "number" === - typeof JSCompiler_object_inline_stack_2366.unstable_expectedLoadTime - ) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2366 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_message_2364, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_componentStack_2367 = - workInProgress.child), - (JSCompiler_object_inline_componentStack_2367.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2367.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2365, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2366 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_message_2364 - ); - } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_message_2364 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2364) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2367 = - JSCompiler_object_inline_stack_2366.fallback), - (JSCompiler_object_inline_message_2364 = workInProgress.mode), - (JSCompiler_object_inline_stack_2366 = createFiberFromOffscreen( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2366.children - }, - JSCompiler_object_inline_message_2364, - 0, - null - )), - (JSCompiler_object_inline_componentStack_2367 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2367, - JSCompiler_object_inline_message_2364, - renderLanes, - null - )), - (JSCompiler_object_inline_componentStack_2367.flags |= 2), - (JSCompiler_object_inline_stack_2366.return = workInProgress), - (JSCompiler_object_inline_componentStack_2367.return = - workInProgress), - (JSCompiler_object_inline_stack_2366.sibling = - JSCompiler_object_inline_componentStack_2367), - (workInProgress.child = JSCompiler_object_inline_stack_2366), - (workInProgress.mode & ConcurrentMode) !== NoMode && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2366 = workInProgress.child), - (JSCompiler_object_inline_stack_2366.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2366.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2365, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = - JSCompiler_object_inline_componentStack_2367)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - error$jscomp$0( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2364)) - ) { - JSCompiler_object_inline_digest_2365 = - JSCompiler_object_inline_message_2364.nextSibling && - JSCompiler_object_inline_message_2364.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2365) { - JSCompiler_temp = JSCompiler_object_inline_digest_2365.dgst; - var message = JSCompiler_object_inline_digest_2365.msg; - instance = JSCompiler_object_inline_digest_2365.stck; - var componentStack = JSCompiler_object_inline_digest_2365.cstck; - } - JSCompiler_object_inline_message_2364 = message; - JSCompiler_object_inline_digest_2365 = JSCompiler_temp; - JSCompiler_object_inline_stack_2366 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2367 = - componentStack; - JSCompiler_object_inline_componentStack_2367 = - JSCompiler_object_inline_message_2364 - ? Error(JSCompiler_object_inline_message_2364) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - ); - JSCompiler_object_inline_componentStack_2367.stack = - JSCompiler_object_inline_stack_2366 || ""; - JSCompiler_object_inline_componentStack_2367.digest = - JSCompiler_object_inline_digest_2365; - JSCompiler_object_inline_digest_2365 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2366 = { - value: JSCompiler_object_inline_componentStack_2367, - source: null, - stack: JSCompiler_object_inline_digest_2365 - }; - "string" === typeof JSCompiler_object_inline_digest_2365 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2367, - JSCompiler_object_inline_stack_2366 - ); - queueHydrationError(JSCompiler_object_inline_stack_2366); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_digest_2365 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2365) - ) { - JSCompiler_object_inline_digest_2365 = workInProgressRoot; - if ( - null !== JSCompiler_object_inline_digest_2365 && - ((JSCompiler_object_inline_stack_2366 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2366 = - 0 !== (JSCompiler_object_inline_stack_2366 & 42) - ? 1 - : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2366 - )), - (JSCompiler_object_inline_stack_2366 = - 0 !== - (JSCompiler_object_inline_stack_2366 & - (JSCompiler_object_inline_digest_2365.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2366), - 0 !== JSCompiler_object_inline_stack_2366 && - JSCompiler_object_inline_stack_2366 !== prevState.retryLane) - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2366), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2366 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2365, - current, - JSCompiler_object_inline_stack_2366 - ), - SelectiveHydrationException) - ); - JSCompiler_object_inline_message_2364.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - JSCompiler_object_inline_message_2364.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2364.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2366.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; } - if (JSCompiler_object_inline_componentStack_2367) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2367 = - JSCompiler_object_inline_stack_2366.fallback), - (JSCompiler_object_inline_message_2364 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (componentStack = { - mode: "hidden", - children: JSCompiler_object_inline_stack_2366.children - }), - (JSCompiler_object_inline_message_2364 & ConcurrentMode) === NoMode && - workInProgress.child !== JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2366 = workInProgress.child), - (JSCompiler_object_inline_stack_2366.childLanes = 0), - (JSCompiler_object_inline_stack_2366.pendingProps = - componentStack), - workInProgress.mode & ProfileMode && - ((JSCompiler_object_inline_stack_2366.actualDuration = -0), - (JSCompiler_object_inline_stack_2366.actualStartTime = -1.1), - (JSCompiler_object_inline_stack_2366.selfBaseDuration = - JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2366.treeBaseDuration = - JSCompiler_temp.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((JSCompiler_object_inline_stack_2366 = createWorkInProgress( - JSCompiler_temp, - componentStack - )), - (JSCompiler_object_inline_stack_2366.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280)), - null !== instance - ? (JSCompiler_object_inline_componentStack_2367 = - createWorkInProgress( - instance, - JSCompiler_object_inline_componentStack_2367 - )) - : ((JSCompiler_object_inline_componentStack_2367 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2367, - JSCompiler_object_inline_message_2364, - renderLanes, - null - )), - (JSCompiler_object_inline_componentStack_2367.flags |= 2)), - (JSCompiler_object_inline_componentStack_2367.return = - workInProgress), - (JSCompiler_object_inline_stack_2366.return = workInProgress), - (JSCompiler_object_inline_stack_2366.sibling = - JSCompiler_object_inline_componentStack_2367), - (workInProgress.child = JSCompiler_object_inline_stack_2366), - (JSCompiler_object_inline_stack_2366 = - JSCompiler_object_inline_componentStack_2367), - (JSCompiler_object_inline_componentStack_2367 = workInProgress.child), - (JSCompiler_object_inline_message_2364 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2364 - ? (JSCompiler_object_inline_message_2364 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_message_2364.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2364 = { - baseLanes: - JSCompiler_object_inline_message_2364.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_componentStack_2367.memoizedState = - JSCompiler_object_inline_message_2364), - (JSCompiler_object_inline_componentStack_2367.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2365, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2366 + return !1; + } + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action + ) { + null === ReactSharedInternals.T && + 0 === currentEntangledLane && + error$jscomp$0( + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2365 = current.child; - current = JSCompiler_object_inline_digest_2365.sibling; - JSCompiler_object_inline_digest_2365 = createWorkInProgress( - JSCompiler_object_inline_digest_2365, - { - mode: "visible", - children: JSCompiler_object_inline_stack_2366.children - } - ); - (workInProgress.mode & ConcurrentMode) === NoMode && - (JSCompiler_object_inline_digest_2365.lanes = renderLanes); - JSCompiler_object_inline_digest_2365.return = workInProgress; - JSCompiler_object_inline_digest_2365.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2365; - workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2365; + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + error$jscomp$0("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markStateUpdateScheduled(fiber, 2); } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); } - function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes - ) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - (mode & ConcurrentMode) === NoMode && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & ProfileMode && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; - } - function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; - } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot - ); + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - error$jscomp$0( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) - if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - error$jscomp$0( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - error$jscomp$0( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); + runWithFiberInDEV( + fiber, + function (erroredKey) { error$jscomp$0( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey ); - } - else - error$jscomp$0( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - error$jscomp$0( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), - error$jscomp$0( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - error$jscomp$0( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder + }, + key ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; + break; + } } - push(suspenseStackCursor, nextProps, workInProgress); - if ((workInProgress.mode & ConcurrentMode) === NoMode) - workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; } - function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - (workInProgress.mode & ConcurrentMode) === NoMode && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + ); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? error$jscomp$0( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : error$jscomp$0( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); + } + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? error$jscomp$0( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : error$jscomp$0( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress - ); - if (stateNode) break; - else return null; - case 22: - case 23: + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes - ); - enableOwnerStacks && - ((renderLanes._debugStack = workInProgress._debugStack), - (renderLanes._debugTask = workInProgress._debugTask)); - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; - } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - if (null !== current) + function createChild(returnFiber, newChild, lanes) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current || - workInProgress.type !== current.type + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((prevSibling = workInProgress.elementType), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(prevSibling)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - renderLanes = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - renderLanes + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( + if (isArrayImpl(newChild) || getIteratorFn(newChild)) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; + } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( returnFiber, - prevSibling, - renderLanes - ) + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; } - workInProgress = workInProgress.child; + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + error$jscomp$0( + "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(renderLanes)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = current), - setInitialProperties(returnFiber, renderLanes, current), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - case 27: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( returnFiber, - renderLanes + oldFiber, + newChildren[newIdx], + knownKeys )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys ); - case 6: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) return ( - null === current && - isHydrating && - ((renderLanes = workInProgress.pendingProps), - (current = getHostContext().ancestorInfo.current), - (renderLanes = - null != current - ? validateTextNesting(renderLanes, current.tag) - : !0), - (current = nextHydratableInstance), - (returnFiber = !current) || - ((returnFiber = canHydrateTextInstance( - current, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (renderLanes && - warnNonHydratedInstance(workInProgress, current), - throwOnHydrationMismatch(workInProgress))), - null + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - error$jscomp$0( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(returnFiber) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, returnFiber, prevSibling), - mountClassInstance( - workInProgress, - returnFiber, - prevSibling, - renderLanes - ), - finishClassComponent( - null, - workInProgress, - returnFiber, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - error$jscomp$0( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); - } - 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; + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - 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 + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); + } + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes ); - forcePropagateEntireTree || (nextFiber = null); - break a; + lanes.return = returnFiber; + returnFiber = lanes; } - list = dependency.next; + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); - 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 - ) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + error$jscomp$0( + "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (error$jscomp$0( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - return !0; - currentDependencies = currentDependencies.next; + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) + ); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - error$jscomp$0( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null + thenableState = null; + return firstChildFiber; + } catch (x) { + if ( + x === SuspenseException || + x === SuspenseActionException || + ((returnFiber.mode & ConcurrentMode) === NoMode && + "object" === typeof x && + null !== x && + "function" === typeof x.then) + ) + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } }; } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler + ); + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - error$jscomp$0( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + } + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); + } + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return null; } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + function defaultOnUncaughtError(error, errorInfo) { + reportGlobalError(error); + error = componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components."; + var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } + try { + warn( + "%s\n\n%s\n", + error, + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks + function defaultOnCaughtError(error$1, errorInfo) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."), + prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; }; - workInProgress.updateQueue = queue; - return; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + try { + "object" === typeof error$1 && + null !== error$1 && + "string" === typeof error$1.environmentName + ? bindToConsole( + "error", + [ + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ], + error$1.environmentName + )() + : error$jscomp$0( + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ); + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + } } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$12) { + setTimeout(function () { + throw e$12; + }); } } - function processUpdateQueue( - workInProgress, - props, - instance$jscomp$0, - renderLanes - ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$13) { + setTimeout(function () { + throw e$13; + }); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error$1 = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error$1); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + error$jscomp$0( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); + } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes + ) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + currentSourceFiber = sourceFiber.tag; + (sourceFiber.mode & ConcurrentMode) !== NoMode || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + isHydrating && + sourceFiber.mode & ConcurrentMode && + (didSuspendOrErrorDEV = !0); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: + return ( + sourceFiber.mode & ConcurrentMode && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & ConcurrentMode && + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + if (currentSourceFiber.mode & ConcurrentMode) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + currentSourceFiber.tag + + "). This is a bug in React." + ); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); + } + if (isHydrating && sourceFiber.mode & ConcurrentMode) + return ( + (didSuspendOrErrorDEV = !0), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 + ); + currentSourceFiber = createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; + } + function reconcileChildren( + current, + workInProgress, + nextChildren, + renderLanes + ) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); + } + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) + return ( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes + ); + } + if ((workInProgress.mode & ConcurrentMode) === NoMode) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes + ) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } + } + function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (error$jscomp$0( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + error$jscomp$0( + "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + componentName = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + componentName = getMaskedContext(workInProgress, componentName); + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + componentName, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes + ) { + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) + ); + enqueueCapturedUpdate(workInProgress, lane); + } + isContextProvider(Component) + ? ((_instance = !0), pushContextProvider(workInProgress)) + : (_instance = !1); + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { + state = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + state.state = oldState; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, lane); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof state.UNSAFE_componentWillUpdate && + "function" !== typeof state.componentWillUpdate) || + ("function" === typeof state.componentWillUpdate && + state.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof state.UNSAFE_componentWillUpdate && + state.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof state.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof state.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof state.componentDidUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof state.getSnapshotBeforeUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (state.props = nextProps), + (state.state = newState), + (state.context = oldContext), + (state = contextType)) + : ("function" !== typeof state.componentDidUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof state.getSnapshotBeforeUpdate || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (state = !1)); + } + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); + Component = workInProgress.stateNode; + state && + Component.props !== nextProps && + (didWarnAboutReassigningProps || + error$jscomp$0( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; + } + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( + workInProgress, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + error$jscomp$0( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (error$jscomp$0( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (error$jscomp$0( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_digest_2371; + var JSCompiler_object_inline_stack_2372 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_componentStack_2373 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_digest_2371 = didSuspend) || + (JSCompiler_object_inline_digest_2371 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_digest_2371 && + ((JSCompiler_object_inline_componentStack_2373 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_digest_2371 = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_componentStack_2373 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_message_2370 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2370)) { + c: { + var instance = JSCompiler_object_inline_message_2370; + for ( + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; + + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; + } + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_message_2370 + ), + throwOnHydrationMismatch(workInProgress)); + } + JSCompiler_object_inline_message_2370 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_message_2370 && + ((JSCompiler_object_inline_message_2370 = + JSCompiler_object_inline_message_2370.dehydrated), + null !== JSCompiler_object_inline_message_2370) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2370) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_message_2370 = + JSCompiler_object_inline_stack_2372.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2372.fallback; + if (JSCompiler_object_inline_componentStack_2373) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2372 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_message_2370, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_componentStack_2373 = + workInProgress.child), + (JSCompiler_object_inline_componentStack_2373.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_componentStack_2373.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2371, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2372 + ); + if ( + "number" === + typeof JSCompiler_object_inline_stack_2372.unstable_expectedLoadTime + ) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2372 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_message_2370, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_componentStack_2373 = + workInProgress.child), + (JSCompiler_object_inline_componentStack_2373.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_componentStack_2373.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2371, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2372 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_message_2370 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_message_2370 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2370) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2373 = + JSCompiler_object_inline_stack_2372.fallback), + (JSCompiler_object_inline_message_2370 = workInProgress.mode), + (JSCompiler_object_inline_stack_2372 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2372.children + }, + JSCompiler_object_inline_message_2370, + 0, + null + )), + (JSCompiler_object_inline_componentStack_2373 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2373, + JSCompiler_object_inline_message_2370, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2373.flags |= 2), + (JSCompiler_object_inline_stack_2372.return = workInProgress), + (JSCompiler_object_inline_componentStack_2373.return = + workInProgress), + (JSCompiler_object_inline_stack_2372.sibling = + JSCompiler_object_inline_componentStack_2373), + (workInProgress.child = JSCompiler_object_inline_stack_2372), + (workInProgress.mode & ConcurrentMode) !== NoMode && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2372 = workInProgress.child), + (JSCompiler_object_inline_stack_2372.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2372.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2371, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = + JSCompiler_object_inline_componentStack_2373)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + error$jscomp$0( + "We should not be hydrating here. This is a bug in React. Please file a bug." + ), + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2370)) + ) { + JSCompiler_object_inline_digest_2371 = + JSCompiler_object_inline_message_2370.nextSibling && + JSCompiler_object_inline_message_2370.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2371) { + JSCompiler_temp = JSCompiler_object_inline_digest_2371.dgst; + var message = JSCompiler_object_inline_digest_2371.msg; + instance = JSCompiler_object_inline_digest_2371.stck; + var componentStack = JSCompiler_object_inline_digest_2371.cstck; + } + JSCompiler_object_inline_message_2370 = message; + JSCompiler_object_inline_digest_2371 = JSCompiler_temp; + JSCompiler_object_inline_stack_2372 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2373 = + componentStack; + JSCompiler_object_inline_componentStack_2373 = + JSCompiler_object_inline_message_2370 + ? Error(JSCompiler_object_inline_message_2370) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + ); + JSCompiler_object_inline_componentStack_2373.stack = + JSCompiler_object_inline_stack_2372 || ""; + JSCompiler_object_inline_componentStack_2373.digest = + JSCompiler_object_inline_digest_2371; + JSCompiler_object_inline_digest_2371 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp; + JSCompiler_object_inline_stack_2372 = { + value: JSCompiler_object_inline_componentStack_2373, + source: null, + stack: JSCompiler_object_inline_digest_2371 + }; + "string" === typeof JSCompiler_object_inline_digest_2371 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2373, + JSCompiler_object_inline_stack_2372 + ); + queueHydrationError(JSCompiler_object_inline_stack_2372); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_digest_2371 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_digest_2371) + ) { + JSCompiler_object_inline_digest_2371 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_digest_2371 && + ((JSCompiler_object_inline_stack_2372 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2372 = + 0 !== (JSCompiler_object_inline_stack_2372 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2372 + )), + (JSCompiler_object_inline_stack_2372 = + 0 !== + (JSCompiler_object_inline_stack_2372 & + (JSCompiler_object_inline_digest_2371.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2372), + 0 !== JSCompiler_object_inline_stack_2372 && + JSCompiler_object_inline_stack_2372 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2372), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2372 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_digest_2371, + current, + JSCompiler_object_inline_stack_2372 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_message_2370.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + JSCompiler_object_inline_message_2370.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_message_2370.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2372.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_componentStack_2373) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2373 = + JSCompiler_object_inline_stack_2372.fallback), + (JSCompiler_object_inline_message_2370 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (componentStack = { + mode: "hidden", + children: JSCompiler_object_inline_stack_2372.children + }), + (JSCompiler_object_inline_message_2370 & ConcurrentMode) === NoMode && + workInProgress.child !== JSCompiler_temp + ? ((JSCompiler_object_inline_stack_2372 = workInProgress.child), + (JSCompiler_object_inline_stack_2372.childLanes = 0), + (JSCompiler_object_inline_stack_2372.pendingProps = + componentStack), + workInProgress.mode & ProfileMode && + ((JSCompiler_object_inline_stack_2372.actualDuration = -0), + (JSCompiler_object_inline_stack_2372.actualStartTime = -1.1), + (JSCompiler_object_inline_stack_2372.selfBaseDuration = + JSCompiler_temp.selfBaseDuration), + (JSCompiler_object_inline_stack_2372.treeBaseDuration = + JSCompiler_temp.treeBaseDuration)), + (workInProgress.deletions = null)) + : ((JSCompiler_object_inline_stack_2372 = createWorkInProgress( + JSCompiler_temp, + componentStack + )), + (JSCompiler_object_inline_stack_2372.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280)), + null !== instance + ? (JSCompiler_object_inline_componentStack_2373 = + createWorkInProgress( + instance, + JSCompiler_object_inline_componentStack_2373 + )) + : ((JSCompiler_object_inline_componentStack_2373 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2373, + JSCompiler_object_inline_message_2370, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2373.flags |= 2)), + (JSCompiler_object_inline_componentStack_2373.return = + workInProgress), + (JSCompiler_object_inline_stack_2372.return = workInProgress), + (JSCompiler_object_inline_stack_2372.sibling = + JSCompiler_object_inline_componentStack_2373), + (workInProgress.child = JSCompiler_object_inline_stack_2372), + (JSCompiler_object_inline_stack_2372 = + JSCompiler_object_inline_componentStack_2373), + (JSCompiler_object_inline_componentStack_2373 = workInProgress.child), + (JSCompiler_object_inline_message_2370 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2370 + ? (JSCompiler_object_inline_message_2370 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_message_2370.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_message_2370 = { + baseLanes: + JSCompiler_object_inline_message_2370.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_componentStack_2373.memoizedState = + JSCompiler_object_inline_message_2370), + (JSCompiler_object_inline_componentStack_2373.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2371, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2372 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_object_inline_digest_2371 = current.child; + current = JSCompiler_object_inline_digest_2371.sibling; + JSCompiler_object_inline_digest_2371 = createWorkInProgress( + JSCompiler_object_inline_digest_2371, + { + mode: "visible", + children: JSCompiler_object_inline_stack_2372.children + } + ); + (workInProgress.mode & ConcurrentMode) === NoMode && + (JSCompiler_object_inline_digest_2371.lanes = renderLanes); + JSCompiler_object_inline_digest_2371.return = workInProgress; + JSCompiler_object_inline_digest_2371.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_object_inline_digest_2371; + workInProgress.memoizedState = null; + return JSCompiler_object_inline_digest_2371; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); + } + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + (mode & ConcurrentMode) === NoMode && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & ProfileMode && + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; + } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + error$jscomp$0( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode + ) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + error$jscomp$0( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + error$jscomp$0( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + error$jscomp$0( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + error$jscomp$0( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + error$jscomp$0( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + error$jscomp$0( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + error$jscomp$0( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, + renderLanes, + workInProgress + ); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + if ((workInProgress.mode & ConcurrentMode) === NoMode) + workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + (workInProgress.mode & ConcurrentMode) === NoMode && + null !== current && + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } + function bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; + } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; + } + function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) { + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current || + workInProgress.type !== current.type + ) + 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; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + renderLanes + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); + } + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(renderLanes)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = current), + setInitialProperties(returnFiber, renderLanes, current), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((renderLanes = workInProgress.pendingProps), + (current = getHostContext().ancestorInfo.current), + (renderLanes = + null != current + ? validateTextNesting(renderLanes, current.tag) + : !0), + (current = nextHydratableInstance), + (returnFiber = !current) || + ((returnFiber = canHydrateTextInstance( + current, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (renderLanes && + warnNonHydratedInstance(workInProgress, current), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + error$jscomp$0( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + markComponentRenderStarted(workInProgress), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, returnFiber, prevSibling), + mountClassInstance( + workInProgress, + returnFiber, + prevSibling, + renderLanes + ), + finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -13627,6 +13608,14 @@ __DEV__ && committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -14606,17 +14595,17 @@ __DEV__ && null ); case 3: - newProps = workInProgress.stateNode; - renderLanes = null; - null !== current && (renderLanes = current.memoizedState.cache); - workInProgress.memoizedState.cache !== renderLanes && + renderLanes = workInProgress.stateNode; + newProps = null; + null !== current && (newProps = current.memoizedState.cache); + workInProgress.memoizedState.cache !== newProps && (workInProgress.flags |= 2048); popProvider(CacheContext, workInProgress); popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); - newProps.pendingContext && - ((newProps.context = newProps.pendingContext), - (newProps.pendingContext = null)); + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)); if (null === current || null === current.child) popHydrationState(workInProgress) ? (emitPendingHydrationWarnings(), markUpdate(workInProgress)) @@ -14624,9 +14613,7 @@ __DEV__ && (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -14835,9 +14822,9 @@ __DEV__ && renderLanes = getHostContext(); if (popHydrationState(workInProgress)) { current = workInProgress.stateNode; - newProps = workInProgress.memoizedProps; + renderLanes = workInProgress.memoizedProps; _type = !didSuspendOrErrorDEV; - renderLanes = null; + newProps = null; var returnFiber = hydrationParentFiber; if (null !== returnFiber) switch (returnFiber.tag) { @@ -14845,8 +14832,8 @@ __DEV__ && _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode(workInProgress, 0).serverProps = @@ -14854,12 +14841,12 @@ __DEV__ && break; case 27: case 5: - (renderLanes = returnFiber.memoizedProps), + (newProps = returnFiber.memoizedProps), _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode( @@ -14869,10 +14856,10 @@ __DEV__ && } current[internalInstanceKey] = workInProgress; current = - current.nodeValue === newProps || - (null !== renderLanes && - !0 === renderLanes.suppressHydrationWarning) || - checkForUnmatchedText(current.nodeValue, newProps) + current.nodeValue === renderLanes || + (null !== newProps && + !0 === newProps.suppressHydrationWarning) || + checkForUnmatchedText(current.nodeValue, renderLanes) ? !0 : !1; current || throwOnHydrationMismatch(workInProgress); @@ -14932,9 +14919,10 @@ __DEV__ && _type.treeBaseDuration)); _type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (_type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = _type), (_type = !0); if (!_type) { if (workInProgress.flags & 256) @@ -14951,22 +14939,22 @@ __DEV__ && transferActualDuration(workInProgress), workInProgress ); - newProps = null !== newProps; + renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - newProps && - ((renderLanes = workInProgress.child), + renderLanes && + ((newProps = workInProgress.child), (_type = null), - null !== renderLanes.alternate && - null !== renderLanes.alternate.memoizedState && - null !== renderLanes.alternate.memoizedState.cachePool && - (_type = renderLanes.alternate.memoizedState.cachePool.pool), + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (_type = newProps.alternate.memoizedState.cachePool.pool), (returnFiber = null), - null !== renderLanes.memoizedState && - null !== renderLanes.memoizedState.cachePool && - (returnFiber = renderLanes.memoizedState.cachePool.pool), - returnFiber !== _type && (renderLanes.flags |= 2048)); - newProps !== current && - newProps && + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (returnFiber = newProps.memoizedState.cachePool.pool), + returnFiber !== _type && (newProps.flags |= 2048)); + renderLanes !== current && + renderLanes && (workInProgress.child.flags |= 8192); scheduleRetryEffect(workInProgress, workInProgress.updateQueue); null !== workInProgress.updateQueue && @@ -14974,7 +14962,7 @@ __DEV__ && (workInProgress.flags |= 4); bubbleProperties(workInProgress); (workInProgress.mode & ProfileMode) !== NoMode && - newProps && + renderLanes && ((current = workInProgress.child), null !== current && (workInProgress.treeBaseDuration -= current.treeBaseDuration)); @@ -15025,9 +15013,13 @@ __DEV__ && scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; current = renderLanes; - for (newProps = workInProgress.child; null !== newProps; ) - resetWorkInProgress(newProps, current), - (newProps = newProps.sibling); + for ( + renderLanes = workInProgress.child; + null !== renderLanes; + + ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); push( suspenseStackCursor, (suspenseStackCursor.current & @@ -15115,27 +15107,27 @@ __DEV__ && workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) : bubbleProperties(workInProgress), - (newProps = workInProgress.updateQueue), - null !== newProps && - scheduleRetryEffect(workInProgress, newProps.retryQueue), - (newProps = null), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && - (newProps = current.memoizedState.cachePool.pool), - (renderLanes = null), + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), null !== workInProgress.memoizedState && null !== workInProgress.memoizedState.cachePool && - (renderLanes = workInProgress.memoizedState.cachePool.pool), - renderLanes !== newProps && (workInProgress.flags |= 2048), + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), null !== current && pop(resumedCache, workInProgress), null ); case 24: return ( - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && (workInProgress.flags |= 2048), popProvider(CacheContext, workInProgress), bubbleProperties(workInProgress), @@ -15456,7 +15448,13 @@ __DEV__ && } exitStatus = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = errorRetryLanes; - null !== exitStatus && queueRecoverableErrors(exitStatus); + null !== exitStatus && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = exitStatus) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + exitStatus + )); } exitStatus = errorRetryLanes$jscomp$0; } @@ -15572,14 +15570,6 @@ __DEV__ && } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -15772,7 +15762,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -16409,9 +16399,6 @@ __DEV__ && throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -16425,24 +16412,30 @@ __DEV__ && root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= CommitContext), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects( @@ -16466,12 +16459,12 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - (transitions = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), + (transitions = spawnedLane) + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : (releaseRootPooledCache(root, remainingLanes), @@ -16483,7 +16476,6 @@ __DEV__ && onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -16491,16 +16483,17 @@ __DEV__ && finishedWork++ ) (remainingLanes = recoverableErrors[finishedWork]), - (transitions = makeErrorInfo(remainingLanes.stack)), + (spawnedLane = makeErrorInfo(remainingLanes.stack)), runWithFiberInDEV( remainingLanes.source, renderPriorityLevel, remainingLanes.value, - transitions + spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) @@ -16811,7 +16804,7 @@ __DEV__ && shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -23491,6 +23484,59 @@ __DEV__ && profilerEffectDuration = -0, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + 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$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23685,7 +23731,83 @@ __DEV__ && pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypeAndContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + error$jscomp$0( + "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23723,45 +23845,6 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - 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$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null - }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23782,7 +23865,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -25160,82 +25243,6 @@ __DEV__ && SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypeAndContextTypes = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - error$jscomp$0( - "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -25281,23 +25288,10 @@ __DEV__ && var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -25392,7 +25386,6 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -25883,52 +25876,43 @@ __DEV__ && ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? error$jscomp$0( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? error$jscomp$0( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && error$jscomp$0( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && error$jscomp$0( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork(); container[internalContainerInstanceKey] = null; } @@ -25952,11 +25936,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-a9bbe346-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-native-fb-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-native-fb-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25993,10 +25977,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -26458,7 +26442,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-a9bbe346-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js index ec1d29a64b60c..0261b37487279 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<93e391cf5ec2ee25c05dff08b1ef557c>> + * @generated SignedSource<<3aafbf11acb647bdaf730f1b4a29268c>> */ /* @@ -2109,19 +2109,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$292; + var JSCompiler_inline_result$jscomp$293; if (canUseDOM) { - var isSupported$jscomp$inline_420 = "oninput" in document; - if (!isSupported$jscomp$inline_420) { - var element$jscomp$inline_421 = document.createElement("div"); - element$jscomp$inline_421.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_420 = - "function" === typeof element$jscomp$inline_421.oninput; + var isSupported$jscomp$inline_421 = "oninput" in document; + if (!isSupported$jscomp$inline_421) { + var element$jscomp$inline_422 = document.createElement("div"); + element$jscomp$inline_422.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_421 = + "function" === typeof element$jscomp$inline_422.oninput; } - JSCompiler_inline_result$jscomp$292 = isSupported$jscomp$inline_420; - } else JSCompiler_inline_result$jscomp$292 = !1; + JSCompiler_inline_result$jscomp$293 = isSupported$jscomp$inline_421; + } else JSCompiler_inline_result$jscomp$293 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$292 && + JSCompiler_inline_result$jscomp$293 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2620,357 +2620,172 @@ function invalidateContextProvider(workInProgress, type, didChange) { : pop(didPerformWorkStackCursor); push(didPerformWorkStackCursor, didChange); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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; } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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 pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + 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 = parent.type; + 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; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; -} -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; -} -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); -} -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$4() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -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$2 = 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 readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -3032,4963 +2847,5166 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); -} -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); -} -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes -) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -} -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; +function processUpdateQueue( + workInProgress$jscomp$0, + props, + instance$jscomp$0, + renderLanes +) { + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$26 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$26 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; -} -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - return getServerSnapshot; -} -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); -} -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); -} -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState +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$2 = 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 }; - return hook; } -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps ) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$32) { - onActionError(actionQueue, node, error$32); - } +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); +function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - actionQueue.action = null; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$28 in Component) + void 0 === newProps[propName$28] && + (newProps[propName$28] = Component[propName$28]); + } + return newProps; } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function actionStateReducer(oldState, newState) { - return newState; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; - } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; - } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; -} -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$2), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps -) { - identityTag = { - resourceKind: 0, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: 1, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } } -function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - return effect; -} -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; -} -function updateRef() { - return updateWorkInProgressHook().memoizedState; -} -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; + } + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } +function noop$4() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); -} -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); -} -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); - } +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function noop$3() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function requestFormReset$2(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function refreshCache(fiber) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root$35 = enqueueUpdate(provider, fiber, lane); - null !== root$35 && - (scheduleUpdateOnFiber(root$35, provider, lane), - entangleTransitions(root$35, provider, lane)); - provider = { cache: createCache() }; - fiber.payload = provider; - return; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; +} +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; +} +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - provider = provider.return; + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, next: null }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + return workInProgressHook; } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } + throw Error(formatProdErrorMessage(438, String(usable))); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError, - useHostTransitionStatus: throwInvalidHookError, - useFormState: throwInvalidHookError, - useActionState: throwInvalidHookError, - useOptimistic: throwInvalidHookError, - useMemoCache: throwInvalidHookError, - useCacheRefresh: throwInvalidHookError -}; -enableUseResourceEffectHook && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; +} +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; +} +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); +} +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -}; -enableUseResourceEffectHook && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: rerenderActionState, - useActionState: rerenderActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$33 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$33 && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null + ); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } } } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); +} +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; + } + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + } } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); +} +function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps +) { + identityTag = { + resourceKind: 0, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: 1, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); +} +function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + return effect; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); +} +function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); +} +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - coerceRef(current, element); - current.return = returnFiber; - return current; +} +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +} +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; +} +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function updatePortal(returnFiber, current, portal, lanes) { + hook.memoizedState = [prevState, deps]; + return prevState; +} +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; +} +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; - } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); +} +function noop$3() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$2(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root$42 = enqueueUpdate(provider, fiber, lane); + null !== root$42 && + (scheduleUpdateOnFiber(root$42, provider, lane), + entangleTransitions(root$42, provider, lane)); + provider = { cache: createCache() }; + fiber.payload = provider; + return; } - return null; + provider = provider.return; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 ); + } catch (error) { + } finally { } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + return !1; +} +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); +} +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); +} +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; +} +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } +} +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +enableUseResourceEffectHook && + (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); -} -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); -} -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); -} -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); -} -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; -} -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); } }; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; -} -function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return ctor; -} -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - "object" === typeof contextType && null !== contextType - ? (instance.context = readContext(contextType)) - : ((contextType = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, contextType))); - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$67 in Component) - void 0 === newProps[propName$67] && - (newProps[propName$67] = Component[propName$67]); - } - return newProps; -} -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); +enableUseResourceEffectHook && + (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); +var HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); } -function defaultOnCaughtError(error) { - console.error(error); +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) + ); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { - setTimeout(function () { - throw e$68; - }); - } +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -function logCaughtError(root, boundary, errorInfo) { - try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$69) { - setTimeout(function () { - throw e$69; - }); +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } -} -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; -} -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; -} -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); -} -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - if (0 === (suspenseBoundary.mode & 1)) - return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary - ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; -} -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: - return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); - } - if (1 === root.tag) + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - value = Error(formatProdErrorMessage(426)); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; } - if (isHydrating && sourceFiber.mode & 1) - return ( - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes ); - currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); - currentSourceFiber = createCapturedValueAtFiber( - currentSourceFiber, - sourceFiber - ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; -} -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); -} -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation ) return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); -} -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; + function createChild(returnFiber, newChild, lanes) { if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); -} -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } -} -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - context = getMaskedContext(workInProgress, context); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - context, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; -} -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (isContextProvider(Component)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - oldProps = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, oldProps); - instance.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = instance.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - instance.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - oldProps !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldContext), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - hasContext, - renderLanes - ); -} -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { - markRef(current, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - shouldUpdate = workInProgress.stateNode; - var nextChildren = - didCaptureError && "function" !== typeof Component.getDerivedStateFromError - ? null - : shouldUpdate.render(); - workInProgress.flags |= 1; - null !== current && didCaptureError - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - nextChildren, - renderLanes - ))) - : reconcileChildren(current, workInProgress, nextChildren, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; -} -function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); + } + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; } - nextInstance = JSCompiler_temp$jscomp$0; + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes ); - popSuspenseHandler(workInProgress); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - nextInstance, - 0, - null - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - nextProps = Error(formatProdErrorMessage(419)); - nextProps.stack = ""; - nextProps.digest = JSCompiler_temp; - queueHydrationError({ value: nextProps, source: null, stack: null }); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) + thenableState = null; + return firstChildFiber; + } catch (x) { + if ( + x === SuspenseException || + x === SuspenseActionException || + (0 === (returnFiber.mode & 1) && + "object" === typeof x && + null !== x && + "function" === typeof x.then) + ) + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; +} +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) ) { - JSCompiler_temp = workInProgressRoot; + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; if ( - null !== JSCompiler_temp && - ((nextProps = renderLanes & -renderLanes), - (nextProps = - 0 !== (nextProps & 42) - ? 1 - : getBumpedLaneForHydrationByLane(nextProps)), - (nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps), - 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) ) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (didSuspend = { mode: "hidden", children: nextProps.children }), - 0 === (nextInstance & 1) && - workInProgress.child !== JSCompiler_temp$jscomp$0 - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = didSuspend), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - JSCompiler_temp$jscomp$0, - didSuspend - )), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; -} -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + return null; } -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes -) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - 0 === (mode & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren)) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); } -function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; +function defaultOnCaughtError(error) { + console.error(error); } -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +function defaultOnRecoverableError(error) { + reportGlobalError(error); } -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode -) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$74) { + setTimeout(function () { + throw e$74; + }); + } } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= 1; +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$75) { + setTimeout(function () { + throw e$75; + }); } - push(suspenseStackCursor, nextProps); - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; } -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; +} +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; } - return workInProgress.child; + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + if (0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + sourceFiber.flags |= 32768; + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 ); - break; - case 13: - var state = workInProgress.memoizedState; - if (null !== state) { - if (null !== state.dehydrated) + currentSourceFiber = sourceFiber.tag; + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - state = 0 !== (renderLanes & workInProgress.childLanes); - state || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (state = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (state) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (state) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -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; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - var elementType = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 + sourceFiber.mode & 1 && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), + !1 ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== elementType) { - elementType = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(elementType); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === elementType) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes + case 22: + if (currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; } - return workInProgress; - case 26: + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (elementType = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (elementType[internalInstanceKey] = workInProgress), - (elementType[internalPropsKey] = current), - setInitialProperties(elementType, renderLanes, current), - markNodeAsHoistable(elementType), - (workInProgress.stateNode = elementType)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((elementType = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(elementType.firstChild))), - (elementType = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren(current, workInProgress, elementType, renderLanes) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes + value = Error(formatProdErrorMessage(426)); + } + if (isHydrating && sourceFiber.mode & 1) + return ( + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = elementType = nextHydratableInstance)) - (elementType = canHydrateInstance( - elementType, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - null !== elementType - ? ((workInProgress.stateNode = elementType), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - elementType.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - elementType = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (elementType = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (elementType = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; +} +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( workInProgress, - workInProgress.pendingProps, + current.child, + nextChildren, renderLanes - ), - workInProgress.child - ); - case 8: + ); +} +function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - reconcileChildren( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - workInProgress.pendingProps.children, + type, + nextProps, renderLanes - ), - workInProgress.child + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); +} +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 12: + } + if (0 === (workInProgress.mode & 1)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - reconcileChildren( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.pendingProps.children, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, renderLanes - ), - workInProgress.child + ) ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + context, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (nextProps = !0); + else if (null === current) { + var instance = workInProgress.stateNode, + unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + instance, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (elementType = elementType(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + instance, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + shouldUpdate = workInProgress.stateNode; + var nextChildren = + didCaptureError && "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + current.child, + null, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + )), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + null, + nextChildren, renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); + ))) + : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } -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 pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( + workInProgress, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); } -function propagateContextChanges( +function mountHostRootWithoutHydrating( + current, workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree + nextChildren, + renderLanes ) { - 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; - } + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; } -function propagateParentContextChanges( +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( current, - workInProgress, - renderLanes, - forcePropagateEntireTree + primaryTreeDidDefer, + renderLanes ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; - ) { - 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 = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } - } 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])); + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + if ("number" === typeof nextProps.unstable_expectedLoadTime) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); + } + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + nextInstance, + 0, + null + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + 0 !== (workInProgress.mode & 1) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + nextProps = Error(formatProdErrorMessage(419)); + nextProps.stack = ""; + nextProps.digest = JSCompiler_temp; + queueHydrationError({ value: nextProps, source: null, stack: null }); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) ) - ) - return !0; - currentDependencies = currentDependencies.next; + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (didSuspend = { mode: "hidden", children: nextProps.children }), + 0 === (nextInstance & 1) && + workInProgress.child !== JSCompiler_temp$jscomp$0 + ? ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + (workInProgress.deletions = null)) + : ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; + workInProgress.memoizedState = null; + return JSCompiler_temp; } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes +) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + 0 === (mode & 1) && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; - } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); +} +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); +} +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 13: + var state = workInProgress.memoizedState; + if (null !== state) { + if (null !== state.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + state = 0 !== (renderLanes & workInProgress.childLanes); + state || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (state = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (state) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (state) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + var elementType = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var init = elementType._init; + elementType = init(elementType._payload); + workInProgress.type = elementType; + if ("function" === typeof elementType) + shouldConstruct(elementType) + ? ((current = resolveClassComponentProps(elementType, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))); + else { + if (void 0 !== elementType && null !== elementType) + if ( + ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + elementType = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== elementType) { + elementType = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(elementType); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === elementType) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (elementType = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((elementType = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren(current, workInProgress, elementType, renderLanes) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== elementType + ? ((workInProgress.stateNode = elementType), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + elementType.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + elementType = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (elementType = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, elementType, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (elementType = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (elementType = elementType(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function commitHookEffectListMount(flags, finishedWork) { try { @@ -9633,6 +9651,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -10394,9 +10420,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -10610,8 +10634,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -10632,11 +10658,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$157 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$157 = newProps.memoizedState.cachePool.pool); + cache$157 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10670,8 +10696,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$157 = type.rendering; + if (null === cache$157) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10679,11 +10705,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$157 = findFirstSuspended(current); + if (null !== cache$157) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$157.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10708,7 +10734,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$157)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10718,7 +10744,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$157.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10731,13 +10757,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$157.sibling = workInProgress.child), + (workInProgress.child = cache$157)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$157) + : (workInProgress.child = cache$157), + (type.last = cache$157)); } if (null !== type.tail) return ( @@ -10938,7 +10964,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11066,7 +11091,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -11164,14 +11194,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -11297,7 +11319,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11354,7 +11376,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -11475,12 +11497,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$176) { - handleThrow(root, thrownValue$176); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11591,11 +11613,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$178) { - handleThrow(root, thrownValue$178); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11662,7 +11684,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11828,9 +11850,6 @@ function commitRootImpl( 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( @@ -11844,23 +11863,29 @@ function commitRootImpl( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffectsOnFiber(finishedWork, root), @@ -11870,19 +11895,18 @@ function commitRootImpl( (root.current = finishedWork), commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : 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; @@ -11896,6 +11920,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates @@ -11913,7 +11938,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$182 = rootWithPendingPassiveEffects, + var root$183 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11952,7 +11977,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$182, remainingLanes); + releaseRootPooledCache(root$183, remainingLanes); } } return !1; @@ -12096,14 +12121,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$184 = firstScheduledRoot; null !== root$184; ) { - if (!onlyLegacy || 0 === root$184.tag) + for (var root$185 = firstScheduledRoot; null !== root$185; ) { + if (!onlyLegacy || 0 === root$185.tag) if (0 !== syncTransitionLanes) { - var pendingLanes = root$184.pendingLanes; + var pendingLanes = root$185.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$184.suspendedLanes, - pingedLanes = root$184.pingedLanes; + var suspendedLanes = root$185.suspendedLanes, + pingedLanes = root$185.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12117,18 +12142,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$184, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$184, - root$184 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$185, + root$185 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$184, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$185, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$184, JSCompiler_inline_result)); - root$184 = root$184.next; + performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); + root$185 = root$185.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12359,20 +12384,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1480 = 0; - i$jscomp$inline_1480 < simpleEventPluginEvents.length; - i$jscomp$inline_1480++ + var i$jscomp$inline_1485 = 0; + i$jscomp$inline_1485 < simpleEventPluginEvents.length; + i$jscomp$inline_1485++ ) { - var eventName$jscomp$inline_1481 = - simpleEventPluginEvents[i$jscomp$inline_1480], - domEventName$jscomp$inline_1482 = - eventName$jscomp$inline_1481.toLowerCase(), - capitalizedEvent$jscomp$inline_1483 = - eventName$jscomp$inline_1481[0].toUpperCase() + - eventName$jscomp$inline_1481.slice(1); + var eventName$jscomp$inline_1486 = + simpleEventPluginEvents[i$jscomp$inline_1485], + domEventName$jscomp$inline_1487 = + eventName$jscomp$inline_1486.toLowerCase(), + capitalizedEvent$jscomp$inline_1488 = + eventName$jscomp$inline_1486[0].toUpperCase() + + eventName$jscomp$inline_1486.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1482, - "on" + capitalizedEvent$jscomp$inline_1483 + domEventName$jscomp$inline_1487, + "on" + capitalizedEvent$jscomp$inline_1488 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13555,34 +13580,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$198 = props[hasSrc]; - if (null != propValue$198) + var propValue$199 = props[hasSrc]; + if (null != propValue$199) switch (hasSrc) { case "name": - hasSrcSet = propValue$198; + hasSrcSet = propValue$199; break; case "type": - propValue = propValue$198; + propValue = propValue$199; break; case "checked": - checked = propValue$198; + checked = propValue$199; break; case "defaultChecked": - defaultChecked = propValue$198; + defaultChecked = propValue$199; break; case "value": - propKey = propValue$198; + propKey = propValue$199; break; case "defaultValue": - defaultValue = propValue$198; + defaultValue = propValue$199; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$198) + if (null != propValue$199) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$198, props, null); + setProp(domElement, tag, hasSrc, propValue$199, props, null); } } initInput( @@ -13719,14 +13744,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$198 in props) - props.hasOwnProperty(propValue$198) && - ((hasSrc = props[propValue$198]), + for (propValue$199 in props) + props.hasOwnProperty(propValue$199) && + ((hasSrc = props[propValue$199]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$198, + propValue$199, hasSrc, props, void 0 @@ -13774,14 +13799,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$215 in nextProps) { - var propKey = nextProps[propKey$215]; - lastProp = lastProps[propKey$215]; + for (var propKey$216 in nextProps) { + var propKey = nextProps[propKey$216]; + lastProp = lastProps[propKey$216]; if ( - nextProps.hasOwnProperty(propKey$215) && + nextProps.hasOwnProperty(propKey$216) && (null != propKey || null != lastProp) ) - switch (propKey$215) { + switch (propKey$216) { case "type": type = propKey; break; @@ -13810,7 +13835,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$215, + propKey$216, propKey, nextProps, lastProp @@ -13829,7 +13854,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$215 = null; + propKey = value = defaultValue = propKey$216 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13860,7 +13885,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$215 = type; + propKey$216 = type; break; case "defaultValue": defaultValue = type; @@ -13881,15 +13906,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$215 - ? updateOptions(domElement, !!lastProps, propKey$215, !1) + null != propKey$216 + ? updateOptions(domElement, !!lastProps, propKey$216, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$215 = null; + propKey = propKey$216 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13913,7 +13938,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$215 = name; + propKey$216 = name; break; case "defaultValue": propKey = name; @@ -13927,17 +13952,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$215, propKey); + updateTextarea(domElement, propKey$216, propKey); return; case "option": - for (var propKey$231 in lastProps) + for (var propKey$232 in lastProps) if ( - ((propKey$215 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$231)) + ((propKey$216 = lastProps[propKey$232]), + lastProps.hasOwnProperty(propKey$232) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$232)) ) - switch (propKey$231) { + switch (propKey$232) { case "selected": domElement.selected = !1; break; @@ -13945,33 +13970,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$231, + propKey$232, null, nextProps, - propKey$215 + propKey$216 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$215 = nextProps[lastDefaultValue]), + ((propKey$216 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$215 && - "function" !== typeof propKey$215 && - "symbol" !== typeof propKey$215; + propKey$216 && + "function" !== typeof propKey$216 && + "symbol" !== typeof propKey$216; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$215, + propKey$216, nextProps, propKey ); @@ -13992,24 +14017,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$236 in lastProps) - (propKey$215 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$236) && - setProp(domElement, tag, propKey$236, null, nextProps, propKey$215); + for (var propKey$237 in lastProps) + (propKey$216 = lastProps[propKey$237]), + lastProps.hasOwnProperty(propKey$237) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$237) && + setProp(domElement, tag, propKey$237, null, nextProps, propKey$216); for (checked in nextProps) if ( - ((propKey$215 = nextProps[checked]), + ((propKey$216 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$215 !== propKey && - (null != propKey$215 || null != propKey)) + propKey$216 !== propKey && + (null != propKey$216 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$215) + if (null != propKey$216) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14017,7 +14042,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$215, + propKey$216, nextProps, propKey ); @@ -14025,49 +14050,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$241 in lastProps) - (propKey$215 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - void 0 !== propKey$215 && - !nextProps.hasOwnProperty(propKey$241) && + for (var propKey$242 in lastProps) + (propKey$216 = lastProps[propKey$242]), + lastProps.hasOwnProperty(propKey$242) && + void 0 !== propKey$216 && + !nextProps.hasOwnProperty(propKey$242) && setPropOnCustomElement( domElement, tag, - propKey$241, + propKey$242, void 0, nextProps, - propKey$215 + propKey$216 ); for (defaultChecked in nextProps) - (propKey$215 = nextProps[defaultChecked]), + (propKey$216 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$215 === propKey || - (void 0 === propKey$215 && void 0 === propKey) || + propKey$216 === propKey || + (void 0 === propKey$216 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$215, + propKey$216, nextProps, propKey ); return; } } - for (var propKey$246 in lastProps) - (propKey$215 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$215 && - !nextProps.hasOwnProperty(propKey$246) && - setProp(domElement, tag, propKey$246, null, nextProps, propKey$215); + for (var propKey$247 in lastProps) + (propKey$216 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$216 && + !nextProps.hasOwnProperty(propKey$247) && + setProp(domElement, tag, propKey$247, null, nextProps, propKey$216); for (lastProp in nextProps) - (propKey$215 = nextProps[lastProp]), + (propKey$216 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$215 === propKey || - (null == propKey$215 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$215, nextProps, propKey); + propKey$216 === propKey || + (null == propKey$216 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$216, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14629,26 +14654,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$254 = getResourcesFromRoot( + var styles$255 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$255 = styles$254.get(type); - resource$255 || + resource$256 = styles$255.get(type); + resource$256 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$255 = { + (resource$256 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$254.set(type, resource$255), - (styles$254 = JSCompiler_inline_result.querySelector( + styles$255.set(type, resource$256), + (styles$255 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$254._p && - ((resource$255.instance = styles$254), - (resource$255.state.loading = 5)), + !styles$255._p && + ((resource$256.instance = styles$255), + (resource$256.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14661,16 +14686,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$254 || + styles$255 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$255.state + resource$256.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$255; + return resource$256; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14767,37 +14792,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$260 = hoistableRoot.querySelector( + var instance$261 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$260) + if (instance$261) return ( (resource.state.loading |= 4), - (resource.instance = instance$260), - markNodeAsHoistable(instance$260), - instance$260 + (resource.instance = instance$261), + markNodeAsHoistable(instance$261), + instance$261 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$260 = ( + instance$261 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$260); - var linkInstance = instance$260; + markNodeAsHoistable(instance$261); + var linkInstance = instance$261; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$260, "link", instance); + setInitialProperties(instance$261, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$260, props.precedence, hoistableRoot); - return (resource.instance = instance$260); + insertStylesheet(instance$261, props.precedence, hoistableRoot); + return (resource.instance = instance$261); case "script": - instance$260 = getScriptKey(props.src); + instance$261 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$260) + getScriptSelectorFromKey(instance$261) )) ) return ( @@ -14806,7 +14831,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$260))) + if ((styleProps = preloadPropsMap.get(instance$261))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15876,16 +15901,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1723 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1728 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== - isomorphicReactPackageVersion$jscomp$inline_1723 + "19.1.0-native-fb-a9bbe346-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1728 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1723, - "19.1.0-native-fb-d4287258-20241217" + isomorphicReactPackageVersion$jscomp$inline_1728, + "19.1.0-native-fb-a9bbe346-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15905,24 +15930,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2180 = { +var internals$jscomp$inline_2188 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2181 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2189 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2181.isDisabled && - hook$jscomp$inline_2181.supportsFiber + !hook$jscomp$inline_2189.isDisabled && + hook$jscomp$inline_2189.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2181.inject( - internals$jscomp$inline_2180 + (rendererID = hook$jscomp$inline_2189.inject( + internals$jscomp$inline_2188 )), - (injectedHook = hook$jscomp$inline_2181); + (injectedHook = hook$jscomp$inline_2189); } catch (err) {} } function noop() {} @@ -16170,4 +16195,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js index 4e524eea744b1..601e935e827d0 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<14420a598866bd8f8a8b6a1516fda3fc>> + * @generated SignedSource<<5fd152c2c28197ed0ebcac8971cd9a36>> */ /* @@ -2208,19 +2208,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$308; + var JSCompiler_inline_result$jscomp$309; if (canUseDOM) { - var isSupported$jscomp$inline_436 = "oninput" in document; - if (!isSupported$jscomp$inline_436) { - var element$jscomp$inline_437 = document.createElement("div"); - element$jscomp$inline_437.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_436 = - "function" === typeof element$jscomp$inline_437.oninput; + var isSupported$jscomp$inline_437 = "oninput" in document; + if (!isSupported$jscomp$inline_437) { + var element$jscomp$inline_438 = document.createElement("div"); + element$jscomp$inline_438.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_437 = + "function" === typeof element$jscomp$inline_438.oninput; } - JSCompiler_inline_result$jscomp$308 = isSupported$jscomp$inline_436; - } else JSCompiler_inline_result$jscomp$308 = !1; + JSCompiler_inline_result$jscomp$309 = isSupported$jscomp$inline_437; + } else JSCompiler_inline_result$jscomp$309 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$308 && + JSCompiler_inline_result$jscomp$309 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2773,357 +2773,172 @@ function transferActualDuration(fiber) { for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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; } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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 pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + 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 = parent.type; + 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; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; -} -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; -} -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); -} -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$4() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -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$2 = 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 readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -3185,5013 +3000,5216 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); -} -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); -} -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes -) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -} -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; +function processUpdateQueue( + workInProgress$jscomp$0, + props, + instance$jscomp$0, + renderLanes +) { + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$28 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$28 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$28 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$28 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; -} -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - return getServerSnapshot; -} -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); -} -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); -} -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState +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$2 = 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 }; - return hook; } -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps ) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$34) { - onActionError(actionQueue, node, error$34); - } +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); +function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - actionQueue.action = null; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$30 in Component) + void 0 === newProps[propName$30] && + (newProps[propName$30] = Component[propName$30]); + } + return newProps; } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; + } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function actionStateReducer(oldState, newState) { - return newState; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; - } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; - } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; -} -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function pushSimpleEffect(tag, inst, create, deps) { - return pushEffectImpl({ - tag: tag, - create: create, - deps: deps, - inst: inst, - next: null - }); +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$2), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function pushResourceEffect( - identityTag, - updateTag, - inst, - create, - createDeps, - update, - updateDeps -) { - identityTag = { - resourceKind: 0, - tag: identityTag, - create: create, - deps: createDeps, - inst: inst, - next: null - }; - pushEffectImpl(identityTag); - return pushEffectImpl({ - resourceKind: 1, - tag: updateTag, - update: update, - deps: updateDeps, - inst: inst, - identity: identityTag, - next: null - }); +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } } -function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - null === componentUpdateQueue && - ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); - var lastEffect = componentUpdateQueue.lastEffect; - if (null === lastEffect) - componentUpdateQueue.lastEffect = effect.next = effect; - else { - var firstEffect = lastEffect.next; - lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } - return effect; -} -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; -} -function updateRef() { - return updateWorkInProgressHook().memoizedState; -} -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; + } + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); - } +function noop$4() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [prevState, deps]; - return prevState; +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); - } +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function noop$3() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function requestFormReset$2(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function refreshCache(fiber) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root$37 = enqueueUpdate(provider, fiber, lane); - null !== root$37 && - (scheduleUpdateOnFiber(root$37, provider, lane), - entangleTransitions(root$37, provider, lane)); - provider = { cache: createCache() }; - fiber.payload = provider; - return; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; +} +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } - provider = provider.return; + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, next: null }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); - markStateUpdateScheduled(fiber, lane); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); - markStateUpdateScheduled(fiber, lane); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markStateUpdateScheduled(fiber, 2); + return workInProgressHook; } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } + throw Error(formatProdErrorMessage(438, String(usable))); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError, - useHostTransitionStatus: throwInvalidHookError, - useFormState: throwInvalidHookError, - useActionState: throwInvalidHookError, - useOptimistic: throwInvalidHookError, - useMemoCache: throwInvalidHookError, - useCacheRefresh: throwInvalidHookError -}; -enableUseResourceEffectHook && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; +} +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; +} +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); +} +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -}; -enableUseResourceEffectHook && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: rerenderActionState, - useActionState: rerenderActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; -enableUseResourceEffectHook && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); -} -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; -} -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$35 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$35 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$35 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$35 && + ((reducer = currentEntangledActionThenable), null !== reducer)) ) - ); -} -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); -} -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; +} +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; - } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + return [newState, dispatch]; +} +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); } - return null; } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); +} +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$41) { + onActionError(actionQueue, node, error$41); } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_LEGACY_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; } - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { - } + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; } -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); } -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - } else reuseSuspenseHandlerOnStack(fiber); + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; } -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; } -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; +function pushSimpleEffect(tag, inst, create, deps) { + return pushEffectImpl({ + tag: tag, + create: create, + deps: deps, + inst: inst, + next: null + }); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps +function pushResourceEffect( + identityTag, + updateTag, + inst, + create, + createDeps, + update, + updateDeps ) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + identityTag = { + resourceKind: 0, + tag: identityTag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; + pushEffectImpl(identityTag); + return pushEffectImpl({ + resourceKind: 1, + tag: updateTag, + update: update, + deps: updateDeps, + inst: inst, + identity: identityTag, + next: null + }); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function pushEffectImpl(effect) { + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + null === componentUpdateQueue && + ((componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); + var lastEffect = componentUpdateQueue.lastEffect; + if (null === lastEffect) + componentUpdateQueue.lastEffect = effect.next = effect; + else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + return effect; } -function constructClassInstance(workInProgress, ctor, props) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = ctor.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = ctor.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return ctor; +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +function updateRef() { + return updateWorkInProgressHook().memoizedState; } -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - "object" === typeof contextType && null !== contextType - ? (instance.context = readContext(contextType)) - : ((contextType = isContextProvider(ctor) - ? previousContext - : contextStackCursor.current), - (instance.context = getMaskedContext(workInProgress, contextType))); - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$69 in Component) - void 0 === newProps[propName$69] && - (newProps[propName$69] = Component[propName$69]); - } - return newProps; +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); } -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); } -function defaultOnCaughtError(error) { - console.error(error); +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { - setTimeout(function () { - throw e$70; - }); +function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } -function logCaughtError(root, boundary, errorInfo) { - try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$71) { - setTimeout(function () { - throw e$71; - }); +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); } -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); } -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); + hook.memoizedState = [prevState, deps]; + return prevState; } -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - if (0 === (suspenseBoundary.mode & 1)) +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) return ( - suspenseBoundary === returnFiber - ? (suspenseBoundary.flags |= 65536) - : ((suspenseBoundary.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)), - suspenseBoundary + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook ); - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 13: + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); + } +} +function noop$3() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$2(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root$44 = enqueueUpdate(provider, fiber, lane); + null !== root$44 && + (scheduleUpdateOnFiber(root$44, provider, lane), + entangleTransitions(root$44, provider, lane)); + provider = { cache: createCache() }; + fiber.payload = provider; + return; + } + provider = provider.return; + } +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); + markStateUpdateScheduled(fiber, lane); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, lane); + markStateUpdateScheduled(fiber, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : sourceFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), !1 ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((sourceFiber = currentSourceFiber.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + } catch (error) { + } finally { } - throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); - } - if (1 === root.tag) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - value = Error(formatProdErrorMessage(426)); } - if (isHydrating && sourceFiber.mode & 1) - return ( - (currentSourceFiber = suspenseHandlerStackCursor.current), - null !== currentSourceFiber - ? (0 === (currentSourceFiber.flags & 65536) && - (currentSourceFiber.flags |= 256), - markSuspenseBoundaryShouldCapture( - currentSourceFiber, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 - ); - currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); - currentSourceFiber = createCapturedValueAtFiber( - currentSourceFiber, - sourceFiber - ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (currentSourceFiber = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); return !1; } -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markStateUpdateScheduled(fiber, 2); } -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - key = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); } -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; - } -} -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - context = getMaskedContext(workInProgress, context); - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - context, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +enableUseResourceEffectHook && + (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; -} -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - markComponentRenderStarted(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - markComponentRenderStopped(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (isContextProvider(Component)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType; - "object" === typeof contextType && null !== contextType - ? (contextType = readContext(contextType)) - : ((contextType = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (contextType = getMaskedContext(workInProgress, contextType))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps, - hasNewLifecycles = - "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || - oldState !== oldContext || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (hasNewLifecycles || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - oldProps = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, oldProps); - instance.props = contextType; - hasNewLifecycles = workInProgress.pendingProps; - unresolvedOldProps = instance.context; - oldContext = Component.contextType; - "object" === typeof oldContext && null !== oldContext - ? (oldContext = readContext(oldContext)) - : ((oldContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (oldContext = getMaskedContext(workInProgress, oldContext))); - oldState = Component.getDerivedStateFromProps; - (getDerivedStateFromProps = - "function" === typeof oldState || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - oldContext - )); - hasForceUpdate = !1; - unresolvedOldProps = workInProgress.memoizedState; - instance.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - oldProps !== hasNewLifecycles || - unresolvedOldProps !== newState || - didPerformWorkStackCursor.current || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof oldState && - (applyDerivedStateFromProps( - workInProgress, - Component, - oldState, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - unresolvedOldProps, - newState, - oldContext - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (getDerivedStateFromProps || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldContext), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldContext - )), - "function" === typeof instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldContext), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (oldProps === current.memoizedProps && - unresolvedOldProps === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } +}; +enableUseResourceEffectHook && + (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); +var HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +enableUseResourceEffectHook && + (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); +} +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) + ); +} +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); +} +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - hasContext, - renderLanes - ); -} -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { - markRef(current, workInProgress); - var didCaptureError = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !didCaptureError) - return ( - hasContext && invalidateContextProvider(workInProgress, Component, !1), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - shouldUpdate = workInProgress.stateNode; - if ( - didCaptureError && - "function" !== typeof Component.getDerivedStateFromError + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ) { - var nextChildren = null; - profilerStartTime = -1; - } else - markComponentRenderStarted(workInProgress), - (nextChildren = shouldUpdate.render()), - markComponentRenderStopped(); - workInProgress.flags |= 1; - null !== current && didCaptureError - ? ((didCaptureError = nextChildren), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - didCaptureError, - renderLanes - ))) - : reconcileChildren(current, workInProgress, nextChildren, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - hasContext && invalidateContextProvider(workInProgress, Component, !0); - return workInProgress.child; -} -function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - root.pendingContext - ? pushTopLevelContextObject( - workInProgress, - root.pendingContext, - root.pendingContext !== root.context - ) - : root.context && - pushTopLevelContextObject(workInProgress, root.context, !1); - pushHostContainer(workInProgress, root.containerInfo); -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_LEGACY_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; } - nextInstance = JSCompiler_temp$jscomp$0; + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); + } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 32) - : (workInProgress.lanes = 536870912), - null + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes ); - popSuspenseHandler(workInProgress); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - nextInstance, - 0, - null - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - nextProps = Error(formatProdErrorMessage(419)); - nextProps.stack = ""; - nextProps.digest = JSCompiler_temp; - queueHydrationError({ value: nextProps, source: null, stack: null }); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) - ) { - JSCompiler_temp = workInProgressRoot; + thenableState = null; + return firstChildFiber; + } catch (x) { if ( - null !== JSCompiler_temp && - ((nextProps = renderLanes & -renderLanes), - (nextProps = - 0 !== (nextProps & 42) - ? 1 - : getBumpedLaneForHydrationByLane(nextProps)), - (nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps), - 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + x === SuspenseException || + x === SuspenseActionException || + (0 === (returnFiber.mode & 1) && + "object" === typeof x && + null !== x && + "function" === typeof x.then) ) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== renderLanes && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = renderLanes.id), - (treeContextOverflow = renderLanes.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; +} +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (didSuspend = { mode: "hidden", children: nextProps.children }), - 0 === (nextInstance & 1) && - workInProgress.child !== JSCompiler_temp$jscomp$0 - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = didSuspend), - workInProgress.mode & 2 && - ((nextProps.actualDuration = -0), - (nextProps.actualStartTime = -1.1), - (nextProps.selfBaseDuration = - JSCompiler_temp$jscomp$0.selfBaseDuration), - (nextProps.treeBaseDuration = - JSCompiler_temp$jscomp$0.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - JSCompiler_temp$jscomp$0, - didSuspend - )), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; + return null; } -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = createFiberFromOffscreen( - { mode: "visible", children: primaryChildren }, - workInProgress.mode, - 0, - null - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); } -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes -) { - var mode = workInProgress.mode, - progressedPrimaryFragment = workInProgress.child; - primaryChildren = { mode: "hidden", children: primaryChildren }; - 0 === (mode & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = createFiberFromOffscreen( - primaryChildren, - mode, - 0, - null - )); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - fallbackChildren.return = workInProgress; - progressedPrimaryFragment.sibling = fallbackChildren; - workInProgress.child = progressedPrimaryFragment; - return fallbackChildren; +function defaultOnCaughtError(error) { + console.error(error); } -function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; +function defaultOnRecoverableError(error) { + reportGlobalError(error); +} +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$76) { + setTimeout(function () { + throw e$76; + }); + } +} +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$77) { + setTimeout(function () { + throw e$77; + }); + } +} +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; +} +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; } -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + if (0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes +) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + currentSourceFiber = sourceFiber.tag; + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { + case 13: + return ( + sourceFiber.mode & 1 && + (null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === currentSourceFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3)), + (currentSourceFiber.flags &= -257), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + if (currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - nextProps &= 1; + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - push(suspenseStackCursor, nextProps); - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + if (isHydrating && sourceFiber.mode & 1) + return ( + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + case 1: + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); } - return workInProgress.child; -} -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; -} -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + current.child, + nextChildren, + renderLanes + ); } -function attemptEarlyBailoutIfNoScheduledUpdate( +function updateForwardRef( current, workInProgress, + Component, + nextProps, renderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostRootContext(workInProgress); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) +function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null === current) { + var type = Component.type; if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare ) - 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; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - var elementType = workInProgress.elementType; - a: { - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - elementType, - init, + type, + nextProps, renderLanes ) ); - case 3: - a: { - pushHostRootContext(workInProgress); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== elementType) { - elementType = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(elementType); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === elementType) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (elementType = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (elementType[internalInstanceKey] = workInProgress), - (elementType[internalPropsKey] = current), - setInitialProperties(elementType, renderLanes, current), - markNodeAsHoistable(elementType), - (workInProgress.stateNode = elementType)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); +} +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 27: + } + if (0 === (workInProgress.mode & 1)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((elementType = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(elementType.firstChild))), - (elementType = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren(current, workInProgress, elementType, renderLanes) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = elementType = nextHydratableInstance)) - (elementType = canHydrateInstance( - elementType, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== elementType - ? ((workInProgress.stateNode = elementType), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - elementType.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - elementType = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (elementType = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, + renderLanes + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + context, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + markComponentRenderStopped(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (nextProps = !0); + else if (null === current) { + var instance = workInProgress.stateNode, + unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + instance, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || + didPerformWorkStackCursor.current || + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps(Component, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( workInProgress, - workInProgress.stateNode.containerInfo - ), - (elementType = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, + instance, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, + newState, + oldContext + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldContext + )), + "function" === typeof instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + shouldUpdate = workInProgress.stateNode; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else + markComponentRenderStarted(workInProgress), + (nextChildren = shouldUpdate.render()), + markComponentRenderStopped(); + workInProgress.flags |= 1; + null !== current && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + current.child, + null, renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = -0), - (elementType.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + )), + (workInProgress.child = reconcileChildFibers( workInProgress, - workInProgress.type, - workInProgress.pendingProps, + null, + didCaptureError, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + ))) + : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; +} +function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext + ? pushTopLevelContextObject( workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, + root.pendingContext, + root.pendingContext !== root.context + ) + : root.context && + pushTopLevelContextObject(workInProgress, root.context, !1); + pushHostContainer(workInProgress, root.containerInfo); +} +function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes +) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; + + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (JSCompiler_temp$jscomp$0 = createFiber(18, null, null, 0)), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + } + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - elementType, - !0, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, + JSCompiler_temp, renderLanes - ) + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps ); - case 28: + if ("number" === typeof nextProps.unstable_expectedLoadTime) return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - elementType, - init, + nextInstance, + JSCompiler_temp$jscomp$0, renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_temp, renderLanes - ), - workInProgress.child + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps ); - case 29: - throw workInProgress.pendingProps; + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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; + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + nextInstance, + 0, + null + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + 0 !== (workInProgress.mode & 1) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + nextProps = Error(formatProdErrorMessage(419)); + nextProps.stack = ""; + nextProps.digest = JSCompiler_temp; + queueHydrationError({ value: nextProps, source: null, stack: null }); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== renderLanes && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (didSuspend = { mode: "hidden", children: nextProps.children }), + 0 === (nextInstance & 1) && + workInProgress.child !== JSCompiler_temp$jscomp$0 + ? ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + workInProgress.mode & 2 && + ((nextProps.actualDuration = -0), + (nextProps.actualStartTime = -1.1), + (nextProps.selfBaseDuration = + JSCompiler_temp$jscomp$0.selfBaseDuration), + (nextProps.treeBaseDuration = + JSCompiler_temp$jscomp$0.treeBaseDuration)), + (workInProgress.deletions = null)) + : ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; + null !== current && + ((renderLanes = workInProgress.deletions), + null === renderLanes + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; + workInProgress.memoizedState = null; + return JSCompiler_temp; } -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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 mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function propagateParentContextChanges( - current, +function mountSuspenseFallbackChildren( workInProgress, - renderLanes, - forcePropagateEntireTree + primaryChildren, + fallbackChildren, + renderLanes ) { - 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 = parent.type; - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + 0 === (mode & 1) && null !== progressedPrimaryFragment + ? ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))) + : (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; - } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; + else + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } + return workInProgress.child; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; +} +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 1: + isContextProvider(workInProgress.type) && + pushContextProvider(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + didPerformWorkStackCursor.current + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + var elementType = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var init = elementType._init; + elementType = init(elementType._payload); + workInProgress.type = elementType; + if ("function" === typeof elementType) + shouldConstruct(elementType) + ? ((current = resolveClassComponentProps(elementType, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ))); + else { + if (void 0 !== elementType && null !== elementType) + if ( + ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + elementType, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostRootContext(workInProgress); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + elementType = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== elementType) { + elementType = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(elementType); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === elementType) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (elementType = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((elementType = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren(current, workInProgress, elementType, renderLanes) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== elementType + ? ((workInProgress.stateNode = elementType), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + elementType.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + elementType = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (elementType = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, elementType, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (elementType = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + elementType, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = -0), + (elementType.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + markComponentRenderStarted(workInProgress), + (elementType = elementType(init)), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -10084,6 +10102,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -10903,9 +10929,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -11130,8 +11154,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= type.treeBaseDuration)); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -11157,11 +11183,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$171 = null; + var cache$172 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$171 = newProps.memoizedState.cachePool.pool); - cache$171 !== type && (newProps.flags |= 2048); + (cache$172 = newProps.memoizedState.cachePool.pool); + cache$172 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -11200,8 +11226,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$171 = type.rendering; - if (null === cache$171) + cache$172 = type.rendering; + if (null === cache$172) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -11209,11 +11235,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$171 = findFirstSuspended(current); - if (null !== cache$171) { + cache$172 = findFirstSuspended(current); + if (null !== cache$172) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$171.updateQueue; + current = cache$172.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11238,7 +11264,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$171)), null !== current)) { + if (((current = findFirstSuspended(cache$172)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11248,7 +11274,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$171.alternate && + !cache$172.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11261,13 +11287,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$171.sibling = workInProgress.child), - (workInProgress.child = cache$171)) + ? ((cache$172.sibling = workInProgress.child), + (workInProgress.child = cache$172)) : ((current = type.last), null !== current - ? (current.sibling = cache$171) - : (workInProgress.child = cache$171), - (type.last = cache$171)); + ? (current.sibling = cache$172) + : (workInProgress.child = cache$172), + (type.last = cache$172)); } if (null !== type.tail) return ( @@ -11477,7 +11503,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11606,7 +11631,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -11704,14 +11734,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -11837,7 +11859,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11894,7 +11916,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -12055,12 +12077,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$191) { - handleThrow(root, thrownValue$191); + } catch (thrownValue$192) { + handleThrow(root, thrownValue$192); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12179,11 +12201,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$193) { - handleThrow(root, thrownValue$193); + } catch (thrownValue$194) { + handleThrow(root, thrownValue$194); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12268,7 +12290,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -12444,9 +12466,6 @@ function commitRootImpl( 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( @@ -12460,24 +12479,30 @@ function commitRootImpl( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), + (updatedLanes = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), @@ -12495,12 +12520,12 @@ function commitRootImpl( "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), + (executionContext = suspendedRetryLanes), + (ReactDOMSharedInternals.p = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); @@ -12508,7 +12533,6 @@ function commitRootImpl( 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -12522,6 +12546,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), @@ -12541,7 +12566,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, + var root$198 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12591,7 +12616,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); + releaseRootPooledCache(root$198, remainingLanes); } } return !1; @@ -12742,14 +12767,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$199 = firstScheduledRoot; null !== root$199; ) { - if (!onlyLegacy || 0 === root$199.tag) + for (var root$200 = firstScheduledRoot; null !== root$200; ) { + if (!onlyLegacy || 0 === root$200.tag) if (0 !== syncTransitionLanes) { - var pendingLanes = root$199.pendingLanes; + var pendingLanes = root$200.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$199.suspendedLanes, - pingedLanes = root$199.pingedLanes; + var suspendedLanes = root$200.suspendedLanes, + pingedLanes = root$200.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12763,18 +12788,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$199, - root$199 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$200, + root$200 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$199, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$200, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); - root$199 = root$199.next; + performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); + root$200 = root$200.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -13008,20 +13033,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1568 = 0; - i$jscomp$inline_1568 < simpleEventPluginEvents.length; - i$jscomp$inline_1568++ + var i$jscomp$inline_1573 = 0; + i$jscomp$inline_1573 < simpleEventPluginEvents.length; + i$jscomp$inline_1573++ ) { - var eventName$jscomp$inline_1569 = - simpleEventPluginEvents[i$jscomp$inline_1568], - domEventName$jscomp$inline_1570 = - eventName$jscomp$inline_1569.toLowerCase(), - capitalizedEvent$jscomp$inline_1571 = - eventName$jscomp$inline_1569[0].toUpperCase() + - eventName$jscomp$inline_1569.slice(1); + var eventName$jscomp$inline_1574 = + simpleEventPluginEvents[i$jscomp$inline_1573], + domEventName$jscomp$inline_1575 = + eventName$jscomp$inline_1574.toLowerCase(), + capitalizedEvent$jscomp$inline_1576 = + eventName$jscomp$inline_1574[0].toUpperCase() + + eventName$jscomp$inline_1574.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1570, - "on" + capitalizedEvent$jscomp$inline_1571 + domEventName$jscomp$inline_1575, + "on" + capitalizedEvent$jscomp$inline_1576 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14204,34 +14229,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$213 = props[hasSrc]; - if (null != propValue$213) + var propValue$214 = props[hasSrc]; + if (null != propValue$214) switch (hasSrc) { case "name": - hasSrcSet = propValue$213; + hasSrcSet = propValue$214; break; case "type": - propValue = propValue$213; + propValue = propValue$214; break; case "checked": - checked = propValue$213; + checked = propValue$214; break; case "defaultChecked": - defaultChecked = propValue$213; + defaultChecked = propValue$214; break; case "value": - propKey = propValue$213; + propKey = propValue$214; break; case "defaultValue": - defaultValue = propValue$213; + defaultValue = propValue$214; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$213) + if (null != propValue$214) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$213, props, null); + setProp(domElement, tag, hasSrc, propValue$214, props, null); } } initInput( @@ -14368,14 +14393,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$213 in props) - props.hasOwnProperty(propValue$213) && - ((hasSrc = props[propValue$213]), + for (propValue$214 in props) + props.hasOwnProperty(propValue$214) && + ((hasSrc = props[propValue$214]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$213, + propValue$214, hasSrc, props, void 0 @@ -14423,14 +14448,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$230 in nextProps) { - var propKey = nextProps[propKey$230]; - lastProp = lastProps[propKey$230]; + for (var propKey$231 in nextProps) { + var propKey = nextProps[propKey$231]; + lastProp = lastProps[propKey$231]; if ( - nextProps.hasOwnProperty(propKey$230) && + nextProps.hasOwnProperty(propKey$231) && (null != propKey || null != lastProp) ) - switch (propKey$230) { + switch (propKey$231) { case "type": type = propKey; break; @@ -14459,7 +14484,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$230, + propKey$231, propKey, nextProps, lastProp @@ -14478,7 +14503,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$230 = null; + propKey = value = defaultValue = propKey$231 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14509,7 +14534,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$230 = type; + propKey$231 = type; break; case "defaultValue": defaultValue = type; @@ -14530,15 +14555,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$230 - ? updateOptions(domElement, !!lastProps, propKey$230, !1) + null != propKey$231 + ? updateOptions(domElement, !!lastProps, propKey$231, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$230 = null; + propKey = propKey$231 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14562,7 +14587,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$230 = name; + propKey$231 = name; break; case "defaultValue": propKey = name; @@ -14576,17 +14601,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$230, propKey); + updateTextarea(domElement, propKey$231, propKey); return; case "option": - for (var propKey$246 in lastProps) + for (var propKey$247 in lastProps) if ( - ((propKey$230 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$246)) + ((propKey$231 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$247)) ) - switch (propKey$246) { + switch (propKey$247) { case "selected": domElement.selected = !1; break; @@ -14594,33 +14619,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$246, + propKey$247, null, nextProps, - propKey$230 + propKey$231 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$230 = nextProps[lastDefaultValue]), + ((propKey$231 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$231 !== propKey && + (null != propKey$231 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$230 && - "function" !== typeof propKey$230 && - "symbol" !== typeof propKey$230; + propKey$231 && + "function" !== typeof propKey$231 && + "symbol" !== typeof propKey$231; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$230, + propKey$231, nextProps, propKey ); @@ -14641,24 +14666,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$251 in lastProps) - (propKey$230 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$251) && - setProp(domElement, tag, propKey$251, null, nextProps, propKey$230); + for (var propKey$252 in lastProps) + (propKey$231 = lastProps[propKey$252]), + lastProps.hasOwnProperty(propKey$252) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$252) && + setProp(domElement, tag, propKey$252, null, nextProps, propKey$231); for (checked in nextProps) if ( - ((propKey$230 = nextProps[checked]), + ((propKey$231 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$231 !== propKey && + (null != propKey$231 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$230) + if (null != propKey$231) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14666,7 +14691,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$230, + propKey$231, nextProps, propKey ); @@ -14674,49 +14699,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$256 in lastProps) - (propKey$230 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - void 0 !== propKey$230 && - !nextProps.hasOwnProperty(propKey$256) && + for (var propKey$257 in lastProps) + (propKey$231 = lastProps[propKey$257]), + lastProps.hasOwnProperty(propKey$257) && + void 0 !== propKey$231 && + !nextProps.hasOwnProperty(propKey$257) && setPropOnCustomElement( domElement, tag, - propKey$256, + propKey$257, void 0, nextProps, - propKey$230 + propKey$231 ); for (defaultChecked in nextProps) - (propKey$230 = nextProps[defaultChecked]), + (propKey$231 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$230 === propKey || - (void 0 === propKey$230 && void 0 === propKey) || + propKey$231 === propKey || + (void 0 === propKey$231 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$230, + propKey$231, nextProps, propKey ); return; } } - for (var propKey$261 in lastProps) - (propKey$230 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$261) && - setProp(domElement, tag, propKey$261, null, nextProps, propKey$230); + for (var propKey$262 in lastProps) + (propKey$231 = lastProps[propKey$262]), + lastProps.hasOwnProperty(propKey$262) && + null != propKey$231 && + !nextProps.hasOwnProperty(propKey$262) && + setProp(domElement, tag, propKey$262, null, nextProps, propKey$231); for (lastProp in nextProps) - (propKey$230 = nextProps[lastProp]), + (propKey$231 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$230 === propKey || - (null == propKey$230 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$230, nextProps, propKey); + propKey$231 === propKey || + (null == propKey$231 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$231, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15278,26 +15303,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$269 = getResourcesFromRoot( + var styles$270 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$270 = styles$269.get(type); - resource$270 || + resource$271 = styles$270.get(type); + resource$271 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$270 = { + (resource$271 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$269.set(type, resource$270), - (styles$269 = JSCompiler_inline_result.querySelector( + styles$270.set(type, resource$271), + (styles$270 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$269._p && - ((resource$270.instance = styles$269), - (resource$270.state.loading = 5)), + !styles$270._p && + ((resource$271.instance = styles$270), + (resource$271.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15310,16 +15335,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$269 || + styles$270 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$270.state + resource$271.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$270; + return resource$271; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15416,37 +15441,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$275 = hoistableRoot.querySelector( + var instance$276 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$275) + if (instance$276) return ( (resource.state.loading |= 4), - (resource.instance = instance$275), - markNodeAsHoistable(instance$275), - instance$275 + (resource.instance = instance$276), + markNodeAsHoistable(instance$276), + instance$276 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$275 = ( + instance$276 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$275); - var linkInstance = instance$275; + markNodeAsHoistable(instance$276); + var linkInstance = instance$276; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$275, "link", instance); + setInitialProperties(instance$276, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$275, props.precedence, hoistableRoot); - return (resource.instance = instance$275); + insertStylesheet(instance$276, props.precedence, hoistableRoot); + return (resource.instance = instance$276); case "script": - instance$275 = getScriptKey(props.src); + instance$276 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$275) + getScriptSelectorFromKey(instance$276) )) ) return ( @@ -15455,7 +15480,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$275))) + if ((styleProps = preloadPropsMap.get(instance$276))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16533,16 +16558,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1813 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1818 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== - isomorphicReactPackageVersion$jscomp$inline_1813 + "19.1.0-native-fb-a9bbe346-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1818 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1813, - "19.1.0-native-fb-d4287258-20241217" + isomorphicReactPackageVersion$jscomp$inline_1818, + "19.1.0-native-fb-a9bbe346-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16562,17 +16587,17 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1820 = { +var internals$jscomp$inline_1825 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$292 = 0; - 31 > index$292; - index$292++ + var map = new Map(), lane = 1, index$293 = 0; + 31 > index$293; + index$293++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -16585,16 +16610,16 @@ var internals$jscomp$inline_1820 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2232 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2240 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2232.isDisabled && - hook$jscomp$inline_2232.supportsFiber + !hook$jscomp$inline_2240.isDisabled && + hook$jscomp$inline_2240.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2232.inject( - internals$jscomp$inline_1820 + (rendererID = hook$jscomp$inline_2240.inject( + internals$jscomp$inline_1825 )), - (injectedHook = hook$jscomp$inline_2232); + (injectedHook = hook$jscomp$inline_2240); } catch (err) {} } function noop() {} @@ -16842,7 +16867,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js index 1fe4279bafafd..d0eebde4f0fc2 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,13 +7,13 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4bd0706dcec5bbe3aed6192a633dde35>> + * @generated SignedSource<> */ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1145() { + function JSCompiler_object_inline_createNodeMock_1165() { return null; } function findHook(fiber, id) { @@ -693,41 +693,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -747,11 +712,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function markCommitStopped() { - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markCommitStopped && - injectedProfilingHooks.markCommitStopped(); - } function markComponentRenderStarted(fiber) { null !== injectedProfilingHooks && "function" === @@ -975,53 +935,6 @@ __DEV__ && (root.pingedLanes = 0), (root.warmLanes = 0)); } - function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index] = null, index = 0; - index < hiddenUpdatesForLane.length; - index++ - ) { - var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); - } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1753,134 +1666,284 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { - for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; - - ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); - } - } - function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); - } - function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); - } - function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } - function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || - sourceFiber._visibility & 1 || - (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function getRootForUpdatedFiber(sourceFiber) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) - throw ( - ((nestedPassiveUpdateCount = nestedUpdateCount = 0), - (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && - ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null), + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2, providerFiber); + context._currentValue2 = nextValue; + push(renderer2CursorDEV, context._currentRenderer2, providerFiber); + void 0 !== context._currentRenderer2 && + null !== context._currentRenderer2 && + context._currentRenderer2 !== rendererSigil && error$jscomp$0( - "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." - )); - null === sourceFiber.alternate && - 0 !== (sourceFiber.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); - for (var node = sourceFiber, parent = node.return; null !== parent; ) - null === node.alternate && - 0 !== (node.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), - (node = parent), - (parent = node.return); - return 3 === node.tag ? node.stateNode : null; - } - function pushNestedEffectDurations() { - var prevEffectDuration = profilerEffectDuration; - profilerEffectDuration = 0; - return prevEffectDuration; - } - function popNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration = prevEffectDuration; - return elapsedTime; - } - function bubbleNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration += prevEffectDuration; - return elapsedTime; + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer2 = rendererSigil; } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + function popProvider(context, providerFiber) { + context._currentValue2 = valueCursor.current; + var currentRenderer2 = renderer2CursorDEV.current; + pop(renderer2CursorDEV, providerFiber); + context._currentRenderer2 = currentRenderer2; + pop(valueCursor, providerFiber); } - function stopProfilerTimerIfRunningAndRecordDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - fiber.selfBaseDuration = elapsedTime; - profilerStartTime = -1; + 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; } + parent !== propagationRoot && + error$jscomp$0( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." + ); } - function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - profilerStartTime = -1; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 + ) { + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + 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; + } + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; + } + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); + } + function readContext(context) { + isDisallowedContextReadInDEV && + error$jscomp$0( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); + } + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); + } + function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; + } + function retainCache(cache) { + cache.controller.signal.aborted && + warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; + } + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); + } + function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; + } + function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; + } + function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; + } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; } } function recordEffectDuration() { @@ -1998,12 +2061,13 @@ __DEV__ && } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -2018,44 +2082,45 @@ __DEV__ && (root.callbackPriority = 0) ); if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) - ) { - currentTime = suspendedLanes & -suspendedLanes; - if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; - } - null !== pingedLanes && cancelCallback(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; + 0 !== (suspendedLanes & 3) && + !checkIfRootIsPrerendering(root, suspendedLanes) + ) + return ( + null !== pingedLanes && cancelCallback(pingedLanes), + (root.callbackPriority = 2), + (root.callbackNode = null), + 2 + ); + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode) + ) + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode)) + : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; @@ -2087,7 +2152,7 @@ __DEV__ && performWorkOnRoot(root, lanes, !0); } function cancelCallback(callbackNode) { - callbackNode !== fakeActCallbackNode$1 && + callbackNode !== fakeActCallbackNode && null !== callbackNode && cancelCallback$1(callbackNode); } @@ -2097,7 +2162,7 @@ __DEV__ && cb(); return null; }); - scheduleCallback$3(ImmediatePriority, cb); + scheduleCallback$2(ImmediatePriority, cb); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -2121,44 +2186,275 @@ __DEV__ && thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); return thenable; } - function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners - ) { - null !== currentEntangledActionThenable && - (currentEntangledActionThenable.status = "fulfilled"); - var listeners = currentEntangledListeners; - currentEntangledListeners = null; - currentEntangledLane = 0; - currentEntangledActionThenable = null; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); - } + function pingEngtangledActionScope() { + if ( + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners + ) { + null !== currentEntangledActionThenable && + (currentEntangledActionThenable.status = "fulfilled"); + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = 0; + currentEntangledActionThenable = null; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); + } + } + function chainThenableValue(thenable, result) { + var listeners = [], + thenableWithOverride = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + listeners.push(resolve); + } + }; + thenable.then( + function () { + thenableWithOverride.status = "fulfilled"; + thenableWithOverride.value = result; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); + }, + function (error) { + thenableWithOverride.status = "rejected"; + thenableWithOverride.reason = error; + for (error = 0; error < listeners.length; error++) + (0, listeners[error])(void 0); + } + ); + return thenableWithOverride; + } + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; + } + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + } + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + } + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; + } + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + error$jscomp$0( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop, noop), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; + } + } + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; + } + function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + } + function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } + } + function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); + } + function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); } - function chainThenableValue(thenable, result) { - var listeners = [], - thenableWithOverride = { - status: "pending", - value: null, - reason: null, - then: function (resolve) { - listeners.push(resolve); - } - }; - thenable.then( - function () { - thenableWithOverride.status = "fulfilled"; - thenableWithOverride.value = result; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); - }, - function (error) { - thenableWithOverride.status = "rejected"; - thenableWithOverride.reason = error; - for (error = 0; error < listeners.length; error++) - (0, listeners[error])(void 0); - } - ); - return thenableWithOverride; + function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || + sourceFiber._visibility & 1 || + (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); + } + function getRootForUpdatedFiber(sourceFiber) { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) + throw ( + ((nestedPassiveUpdateCount = nestedUpdateCount = 0), + (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && + ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null), + error$jscomp$0( + "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." + )); + null === sourceFiber.alternate && + 0 !== (sourceFiber.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + for (var node = sourceFiber, parent = node.return; null !== parent; ) + null === node.alternate && + 0 !== (node.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), + (node = parent), + (parent = node.return); + return 3 === node.tag ? node.stateNode : null; } function initializeUpdateQueue(fiber) { fiber.updateQueue = { @@ -2397,190 +2693,72 @@ __DEV__ && null !== updateLane && ((workInProgress.flags |= 64), isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; - } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); - } - function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; - } - function noop() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - error$jscomp$0( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop, noop), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; } + currentlyProcessingQueue = null; } - function getSuspendedThenable() { - if (null === suspendedThenable) + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + callback.call(context); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } function pushHiddenContext(fiber, context) { var prevEntangledRenderLanes = entangledRenderLanes; @@ -2614,9 +2792,7 @@ __DEV__ && (hookTypesUpdateIndexDev++, hookTypesDev[hookTypesUpdateIndexDev] !== hookName) ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 - ); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( !didWarnAboutMismatchedHooksForComponent.has(componentName) && (didWarnAboutMismatchedHooksForComponent.add(componentName), @@ -2654,7 +2830,7 @@ __DEV__ && ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -2697,7 +2873,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -2708,9 +2884,7 @@ __DEV__ && "[object AsyncGeneratorFunction]" === Object.prototype.toString.call(Component) ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), didWarnAboutAsyncClientComponent.has(nextRenderLanes) || (didWarnAboutAsyncClientComponent.add(nextRenderLanes), error$jscomp$0( @@ -2770,7 +2944,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -2806,7 +2980,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -2841,7 +3015,7 @@ __DEV__ && : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); + dispatcher && (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -2869,7 +3043,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -2886,26 +3060,26 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -2920,7 +3094,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -2934,7 +3108,7 @@ __DEV__ && thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = createThenableState()); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -2955,10 +3129,10 @@ __DEV__ && } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -2974,7 +3148,7 @@ __DEV__ && null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue || ignorePreviousDependencies) @@ -3022,7 +3196,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -3100,7 +3274,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -3121,7 +3295,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -3168,7 +3342,7 @@ __DEV__ && return [newState, dispatch]; } function mountSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -3208,7 +3382,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -3260,10 +3434,10 @@ __DEV__ && function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -3321,11 +3495,7 @@ __DEV__ && function mountState(initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue - ); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; } @@ -3342,7 +3512,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -3506,14 +3676,14 @@ __DEV__ && stateHook.queue = stateQueue; stateHook = dispatchSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateQueue ); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -3527,7 +3697,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3563,7 +3733,7 @@ __DEV__ && var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( HasEffect | Passive, createEffectInstance(), @@ -3625,10 +3795,10 @@ __DEV__ && }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -3651,7 +3821,7 @@ __DEV__ && function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), @@ -3667,7 +3837,7 @@ __DEV__ && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, inst, @@ -3676,8 +3846,8 @@ __DEV__ && ))); } function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ? mountEffectImpl(142608384, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps); } @@ -3689,12 +3859,12 @@ __DEV__ && destroy ) { if ( - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ) { var hookFlags = Passive, hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 142608384; + currentlyRenderingFiber.flags |= 142608384; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -3709,7 +3879,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -3765,7 +3935,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -3778,7 +3948,7 @@ __DEV__ && } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); return mountEffectImpl(fiberFlags, Layout, create, deps); } function imperativeHandleEffect(create, ref) { @@ -3811,7 +3981,7 @@ __DEV__ && ); deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); mountEffectImpl( fiberFlags, Layout, @@ -3911,7 +4081,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -3926,7 +4096,7 @@ __DEV__ && if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -3998,7 +4168,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4040,7 +4210,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -4067,19 +4237,15 @@ __DEV__ && provider = provider.return; } } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, + args = requestUpdateLane(fiber); + var update = { + lane: args, revertLane: 0, action: action, hasEagerState: !1, @@ -4087,44 +4253,22 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); - } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args); + markStateUpdateScheduled(fiber, args); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -4209,8 +4353,8 @@ __DEV__ && function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -7980,325 +8124,74 @@ __DEV__ && ); case 19: return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2, providerFiber); - context._currentValue2 = nextValue; - push(renderer2CursorDEV, context._currentRenderer2, providerFiber); - void 0 !== context._currentRenderer2 && - null !== context._currentRenderer2 && - context._currentRenderer2 !== rendererSigil && - error$jscomp$0( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer2 = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue2 = valueCursor.current; - var currentRenderer2 = renderer2CursorDEV.current; - pop(renderer2CursorDEV, providerFiber); - context._currentRenderer2 = currentRenderer2; - pop(valueCursor, providerFiber); - } - 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; - } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + current, + workInProgress, + renderLanes ); - 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 - ) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - error$jscomp$0( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; - } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); - } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -8431,9 +8324,7 @@ __DEV__ && (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -8559,9 +8450,10 @@ __DEV__ && (workInProgress.treeBaseDuration -= child.treeBaseDuration)); child = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (child = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = child), (child = !0); if (!child) { if (workInProgress.flags & 256) @@ -9462,70 +9354,17 @@ __DEV__ && case 4: parent = parentFiber.stateNode.containerInfo; parentFiber = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - parentFiber, - parent - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitBeforeMutationEffects(root, firstChild) { - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((root = nextEffect), - (firstChild = root.child), - 0 !== (root.subtreeFlags & 1028) && null !== firstChild) - ) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - firstChild = root = nextEffect; - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - 0 !== (flags & 1024) && - null !== current && - commitClassSnapshot(firstChild, current); - break; - case 3: - 0 !== (flags & 1024) && - firstChild.stateNode.containerInfo.children.splice(0); - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return root; + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10585,6 +10424,14 @@ __DEV__ && committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -11207,7 +11054,13 @@ __DEV__ && } exitStatus = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = lanesThatJustErrored; - null !== exitStatus && queueRecoverableErrors(exitStatus); + null !== exitStatus && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = exitStatus) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + exitStatus + )); } exitStatus = renderWasConcurrent; } @@ -11221,9 +11074,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -11231,7 +11083,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -11246,63 +11098,43 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + exitStatus, + IMMEDIATE_COMMIT, + -0, + 0 + ); + else { if ( (lanes & 62914560) === lanes && - shouldTimeSlice === RootSuspended && - ((exitStatus = + exitStatus === RootSuspended && + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -11312,17 +11144,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -11332,7 +11164,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -11344,14 +11176,6 @@ __DEV__ && } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -11371,29 +11195,19 @@ __DEV__ && lanes = finishedWork.subtreeFlags; (lanes & 8192 || 16785408 === (lanes & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + exitStatus, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -11543,7 +11357,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -12062,132 +11876,258 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( - root, + function commitRoot( + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markCommitStarted && - injectedProfilingHooks.markCommitStarted(didIncludeRenderPhaseUpdate); - if (null === finishedWork) return markCommitStopped(), null; - 0 === didIncludeRenderPhaseUpdate && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - 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(!0); - return null; - })); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted( - didIncludeRenderPhaseUpdate - ), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root, !1); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (transitions = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - transitions + didIncludeRenderPhaseUpdate = ReactSharedInternals.T; + var previousUpdateLanePriority = currentUpdatePriority; + try { + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStarted && + injectedProfilingHooks.markCommitStarted(lanes); + if (null !== finishedWork) { + 0 === lanes && + error$jscomp$0( + "root.finishedLanes should not be empty during a commit. This is a bug in React." ); - 0 !== (pendingPassiveEffectsLanes & 3) && - 0 !== root.tag && - flushPassiveEffects(); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && - 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - markCommitStopped(); - return null; + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= + concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + remainingLanes$jscomp$0 = + previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < remainingLanes$jscomp$0; + + ) { + var index = 31 - clz32(remainingLanes$jscomp$0), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + remainingLanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + transitions = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + rootHasEffect = executionContext; + executionContext |= CommitContext; + for (nextEffect = finishedWork; null !== nextEffect; ) { + updatedLanes = nextEffect; + var child = updatedLanes.child; + if (0 !== (updatedLanes.subtreeFlags & 1028) && null !== child) + (child.return = updatedLanes), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + suspendedRetryLanes = updatedLanes = nextEffect; + var current = suspendedRetryLanes.alternate, + flags = suspendedRetryLanes.flags; + switch (suspendedRetryLanes.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(suspendedRetryLanes, current); + break; + case 3: + 0 !== (flags & 1024) && + suspendedRetryLanes.stateNode.containerInfo.children.splice( + 0 + ); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + var sibling = updatedLanes.sibling; + if (null !== sibling) { + sibling.return = updatedLanes.return; + nextEffect = sibling; + break b; + } + nextEffect = updatedLanes.return; + } + } + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + root$jscomp$0.current = finishedWork; + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + requestPaint(); + executionContext = rootHasEffect; + currentUpdatePriority = transitions; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + (prevTransition = spawnedLane) + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root$jscomp$0, remainingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && + (legacyErrorBoundariesThatAlreadyFailed = null); + prevTransition || commitDoubleInvokeEffectsInDEV(root$jscomp$0, !1); + var root = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && + 0 !== root$jscomp$0.tag && + flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStopped && + injectedProfilingHooks.markCommitStopped(); + } finally { + (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), + (currentUpdatePriority = previousUpdateLanePriority); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -12230,6 +12170,9 @@ __DEV__ && lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + root$jscomp$0.callbackNode = null; + root$jscomp$0.callbackPriority = 0; + root$jscomp$0.cancelPendingCommit = null; if ( (executionContext & (RenderContext | CommitContext)) !== NoContext @@ -12267,6 +12210,7 @@ __DEV__ && : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + ensureRootIsScheduled(root$jscomp$0); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -12483,7 +12427,7 @@ __DEV__ && shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -12551,12 +12495,6 @@ __DEV__ && } } } - function scheduleCallback(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode) - : scheduleCallback$3(priorityLevel, callback); - } function warnIfUpdatesNotWrappedWithActDEV(fiber) { if (fiber.mode & 1) { if (!isConcurrentActEnvironment()) return; @@ -13485,7 +13423,7 @@ __DEV__ && var current = null, isRendering = !1, isArrayImpl = Array.isArray, - scheduleCallback$3 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, cancelCallback$1 = Scheduler$1.unstable_cancelCallback, shouldYield = Scheduler$1.unstable_shouldYield, requestPaint = Scheduler$1.unstable_requestPaint, @@ -13554,9 +13492,42 @@ __DEV__ && needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0, + valueCursor = createCursor(null); + var renderer2CursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + 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$1.unstable_scheduleCallback, + NormalPriority = Scheduler$1.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, now = Scheduler$1.unstable_now, commitStartTime = -0, profilerStartTime = -1.1, @@ -13570,19 +13541,21 @@ __DEV__ && mightHavePendingSyncWork = !1, isFlushingWork = !1, currentEventTransitionLane = 0, - fakeActCallbackNode$1 = {}, + fakeActCallbackNode = {}, currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, + prevOnStartTransitionFinish = ReactSharedInternals.S; + ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); + }; + var resumedCache = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, @@ -13800,6 +13773,17 @@ __DEV__ && Insertion = 2, Layout = 4, Passive = 8, + concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), didWarnUncachedGetSnapshot; @@ -13810,7 +13794,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -15236,62 +15220,16 @@ __DEV__ && var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var renderer2CursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - 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$1.unstable_scheduleCallback, - NormalPriority = Scheduler$1.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null - }, - prevOnStartTransitionFinish = ReactSharedInternals.S; - ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); - }; - var resumedCache = createCursor(null), didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, suspenseyCommitFlag = 8192, @@ -15362,7 +15300,6 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -15381,8 +15318,7 @@ __DEV__ && didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var fakeActCallbackNode = {}, - resolveFamily = null, + var resolveFamily = null, failedBoundaries = null; var hasBadMapPolyfill = !1; try { @@ -15595,10 +15531,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15620,7 +15556,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1145, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1165, isConcurrent = !1, isStrictMode = !1; "object" === typeof options && @@ -15743,5 +15679,5 @@ __DEV__ && flushSyncWorkAcrossRoots_impl(0, !0)); } }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-a9bbe346-20241219"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js index 3bc6cc0ba6025..026628bb2ba38 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -448,7 +448,7 @@ function findCurrentFiberUsingSlowPath(fiber) { return a.stateNode.current === a ? fiber : alternate; } var isArrayImpl = Array.isArray, - scheduleCallback$3 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, cancelCallback$1 = Scheduler$1.unstable_cancelCallback, shouldYield = Scheduler$1.unstable_shouldYield, requestPaint = Scheduler$1.unstable_requestPaint, @@ -461,17 +461,6 @@ var isArrayImpl = Array.isArray, unstable_setDisableYieldValue = Scheduler$1.unstable_setDisableYieldValue, rendererID = null, injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -652,53 +641,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -925,92 +867,237 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -var firstScheduledRoot = null, +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$1.unstable_scheduleCallback, + NormalPriority = Scheduler$1.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 firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, mightHavePendingSyncWork = !1, @@ -1025,7 +1112,7 @@ function ensureRootIsScheduled(root) { mightHavePendingSyncWork = !0; didScheduleMicrotask || ((didScheduleMicrotask = !0), - scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); + scheduleCallback$2(ImmediatePriority, processRootScheduleInMicrotask)); } function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -1108,12 +1195,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -1151,7 +1239,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = NormalPriority$1; } pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -1246,6 +1334,229 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; +} +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } +} +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} var hasForceUpdate = !1; function initializeUpdateQueue(fiber) { fiber.updateQueue = { @@ -1489,121 +1800,9 @@ function commitCallbacks(updateQueue, context) { for ( updateQueue.callbacks = null, updateQueue = 0; updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); @@ -1623,7 +1822,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -1652,7 +1851,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -1677,7 +1876,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -1693,7 +1892,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -1726,7 +1925,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -1748,7 +1947,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -1762,26 +1961,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -1796,7 +1995,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -1810,7 +2009,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -1831,10 +2030,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -1850,7 +2049,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -1895,7 +2094,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$17 = !1; + didReadFromEntangledAsyncAction$19 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -1916,11 +2115,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$17 = !0); + (didReadFromEntangledAsyncAction$19 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$17 = !0); + (didReadFromEntangledAsyncAction$19 = !0); continue; } else (updateLane = { @@ -1935,7 +2134,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -1956,7 +2155,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -1966,7 +2165,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$17 && + didReadFromEntangledAsyncAction$19 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2002,7 +2201,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -2039,10 +2238,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -2164,8 +2363,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$21) { - onActionError(actionQueue, node, error$21); + } catch (error$23) { + onActionError(actionQueue, node, error$23); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -2228,16 +2427,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -2251,7 +2446,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -2287,7 +2482,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -2349,10 +2544,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -2373,7 +2568,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -2389,7 +2584,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -2432,7 +2627,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -2503,7 +2698,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -2518,7 +2713,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -2683,8 +2878,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -2797,7 +2992,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -2810,11 +3005,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue - ); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -2827,7 +3018,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -2836,7 +3027,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -2884,7 +3075,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -2895,7 +3086,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); }, useResourceEffect: function ( @@ -2906,7 +3097,7 @@ var HooksDispatcherOnMount = { destroy ) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -3952,9 +4143,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$47 in Component) - void 0 === newProps[propName$47] && - (newProps[propName$47] = Component[propName$47]); + for (var propName$49 in Component) + void 0 === newProps[propName$49] && + (newProps[propName$49] = Component[propName$49]); } return newProps; } @@ -4768,7 +4959,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -5658,325 +5854,81 @@ function beginWork(current, workInProgress, renderLanes) { return ( (elementType = workInProgress.type), (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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$1.unstable_scheduleCallback, - NormalPriority = Scheduler$1.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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -6073,9 +6025,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -6170,8 +6120,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); index = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (index = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = index), (index = !0); if (!index) { if (workInProgress.flags & 256) @@ -6192,11 +6144,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (index = newProps.alternate.memoizedState.cachePool.pool); - var cache$93 = null; + var cache$94 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$93 = newProps.memoizedState.cachePool.pool); - cache$93 !== index && (newProps.flags |= 2048); + (cache$94 = newProps.memoizedState.cachePool.pool); + cache$94 !== index && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -6221,8 +6173,8 @@ function completeWork(current, workInProgress, renderLanes) { index = workInProgress.memoizedState; if (null === index) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$93 = index.rendering; - if (null === cache$93) + cache$94 = index.rendering; + if (null === cache$94) if (newProps) cutOffTailIfNeeded(index, !1); else { if ( @@ -6230,11 +6182,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$93 = findFirstSuspended(current); - if (null !== cache$93) { + cache$94 = findFirstSuspended(current); + if (null !== cache$94) { workInProgress.flags |= 128; cutOffTailIfNeeded(index, !1); - current = cache$93.updateQueue; + current = cache$94.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6259,7 +6211,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$93)), null !== current)) { + if (((current = findFirstSuspended(cache$94)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6269,7 +6221,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(index, !0), null === index.tail && "hidden" === index.tailMode && - !cache$93.alternate) + !cache$94.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6281,13 +6233,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(index, !1), (workInProgress.lanes = 4194304)); index.isBackwards - ? ((cache$93.sibling = workInProgress.child), - (workInProgress.child = cache$93)) + ? ((cache$94.sibling = workInProgress.child), + (workInProgress.child = cache$94)) : ((current = index.last), null !== current - ? (current.sibling = cache$93) - : (workInProgress.child = cache$93), - (index.last = cache$93)); + ? (current.sibling = cache$94) + : (workInProgress.child = cache$94), + (index.last = cache$94)); } if (null !== index.tail) return ( @@ -6480,9 +6432,9 @@ function commitHookEffectListMount(flags, finishedWork) { updateQueue.update(updateQueue.inst.resource), null == updateQueue.resourceKind) ) { - var create$109 = updateQueue.create, + var create$110 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$109(); + lastEffect = create$110(); inst.destroy = lastEffect; } updateQueue = updateQueue.next; @@ -6619,8 +6571,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$111) { - captureCommitPhaseError(current, nearestMountedAncestor, error$111); + } catch (error$112) { + captureCommitPhaseError(current, nearestMountedAncestor, error$112); } else ref.current = null; } @@ -6677,83 +6629,7 @@ function insertOrAppendPlacementNode(node, before, parent) { var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((root = nextEffect), - (firstChild = root.child), - 0 !== (root.subtreeFlags & 1028) && null !== firstChild) - ) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - var current = root.alternate; - firstChild = root.flags; - switch (root.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (firstChild & 1024) && null !== current) { - firstChild = void 0; - var finishedWork = root, - prevProps = current.memoizedProps; - current = current.memoizedState; - var instance = finishedWork.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - finishedWork.type, - prevProps, - finishedWork.elementType === finishedWork.type - ); - firstChild = instance.getSnapshotBeforeUpdate( - resolvedPrevProps, - current - ); - instance.__reactInternalSnapshotBeforeUpdate = firstChild; - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } - } - break; - case 3: - 0 !== (firstChild & 1024) && - root.stateNode.containerInfo.children.splice(0); - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (firstChild & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; -} + nextEffect = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -6784,11 +6660,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$110) { + } catch (error$111) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$110 + error$111 ); } } @@ -7333,12 +7209,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$112 = JSCompiler_inline_result.stateNode.containerInfo, - before$113 = getHostSibling(finishedWork); + var parent$113 = JSCompiler_inline_result.stateNode.containerInfo, + before$114 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$113, - parent$112 + before$114, + parent$113 ); break; default: @@ -7603,6 +7479,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -8002,7 +7886,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -8125,7 +8008,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -8223,54 +8111,227 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( - root, - finishedWork, + root$jscomp$0, + finishedWork$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - lanes, + lanes$jscomp$0, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && - accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; + didIncludeRenderPhaseUpdate = finishedWork$jscomp$0.subtreeFlags; + (didIncludeRenderPhaseUpdate & 8192 || + 16785408 === (didIncludeRenderPhaseUpdate & 16785408)) && + accumulateSuspenseyCommitOnFiber(finishedWork$jscomp$0); + finishedWork$jscomp$0 = ReactSharedInternals.T; + didIncludeRenderPhaseUpdate = currentUpdatePriority; try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + lanes$jscomp$0 = remainingLanes |= concurrentlyUpdatedLanes; + var previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = lanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= lanes$jscomp$0; + root$jscomp$0.entangledLanes &= lanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= lanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + lanes$jscomp$0 = previouslyPendingLanes & ~lanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(lanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + transitions = currentUpdatePriority; + currentUpdatePriority = 2; + rootHasEffect = executionContext; + executionContext |= 4; + for (nextEffect = finishedWork; null !== nextEffect; ) { + updatedLanes = nextEffect; + var child = updatedLanes.child; + if (0 !== (updatedLanes.subtreeFlags & 1028) && null !== child) + (child.return = updatedLanes), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + updatedLanes = nextEffect; + suspendedRetryLanes = void 0; + previouslyPendingLanes = updatedLanes; + var current = previouslyPendingLanes.alternate, + flags = previouslyPendingLanes.flags; + switch (previouslyPendingLanes.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = previouslyPendingLanes.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + previouslyPendingLanes.type, + prevProps, + previouslyPendingLanes.elementType === + previouslyPendingLanes.type + ); + suspendedRetryLanes = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = + suspendedRetryLanes; + } catch (error) { + captureCommitPhaseError( + previouslyPendingLanes, + previouslyPendingLanes.return, + error + ); + } + } + break; + case 3: + 0 !== (flags & 1024) && + previouslyPendingLanes.stateNode.containerInfo.children.splice( + 0 + ); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + var sibling = updatedLanes.sibling; + if (null !== sibling) { + sibling.return = updatedLanes.return; + nextEffect = sibling; + break b; + } + nextEffect = updatedLanes.return; + } + } + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + root$jscomp$0.current = finishedWork; + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + requestPaint(); + executionContext = rootHasEffect; + currentUpdatePriority = transitions; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + spawnedLane + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + root, + void 0, + 128 === (root.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && + 0 !== root$jscomp$0.tag && + flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root$jscomp$0)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); + (ReactSharedInternals.T = finishedWork$jscomp$0), + (currentUpdatePriority = didIncludeRenderPhaseUpdate); } } function isRenderConsistentWithExternalStores(finishedWork) { @@ -8353,7 +8414,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -8410,7 +8471,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -8507,12 +8568,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$127) { - handleThrow(root, thrownValue$127); + } catch (thrownValue$128) { + handleThrow(root, thrownValue$128); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -8623,11 +8684,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$129) { - handleThrow(root, thrownValue$129); + } catch (thrownValue$130) { + handleThrow(root, thrownValue$130); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -8694,7 +8755,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -8800,103 +8861,6 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - 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(!0); - return null; - })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), - (currentUpdatePriority = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : 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]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && - 0 !== root.tag && - flushPassiveEffects(); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -8923,6 +8887,9 @@ function flushPassiveEffects() { lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + root$jscomp$0.callbackNode = null; + root$jscomp$0.callbackPriority = 0; + root$jscomp$0.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error("Cannot flush passive effects while already rendering."); var prevExecutionContext = executionContext; @@ -8936,6 +8903,7 @@ function flushPassiveEffects() { ); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(root$jscomp$0); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -9070,9 +9038,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function scheduleCallback(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -9753,24 +9718,24 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var internals$jscomp$inline_1381 = { +var internals$jscomp$inline_1460 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1382 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1461 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1382.isDisabled && - hook$jscomp$inline_1382.supportsFiber + !hook$jscomp$inline_1461.isDisabled && + hook$jscomp$inline_1461.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1382.inject( - internals$jscomp$inline_1381 + (rendererID = hook$jscomp$inline_1461.inject( + internals$jscomp$inline_1460 )), - (injectedHook = hook$jscomp$inline_1382); + (injectedHook = hook$jscomp$inline_1461); } catch (err) {} } exports._Scheduler = Scheduler; @@ -9894,4 +9859,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 661303fcc6cc8..bcc4306807452 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<34e3fe71d4860fc0127b774e7dbacb07>> + * @generated SignedSource<> */ "use strict"; @@ -448,7 +448,7 @@ function findCurrentFiberUsingSlowPath(fiber) { return a.stateNode.current === a ? fiber : alternate; } var isArrayImpl = Array.isArray, - scheduleCallback$3 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, cancelCallback$1 = Scheduler$1.unstable_cancelCallback, shouldYield = Scheduler$1.unstable_shouldYield, requestPaint = Scheduler$1.unstable_requestPaint, @@ -463,34 +463,6 @@ var isArrayImpl = Array.isArray, injectedHook = null, injectedProfilingHooks = null, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case 2: - var schedulerPriority = ImmediatePriority; - break; - case 8: - schedulerPriority = UserBlockingPriority; - break; - case 32: - schedulerPriority = NormalPriority$1; - break; - case 268435456: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -498,11 +470,6 @@ function setIsStrictModeForDevtools(newIsStrictMode) { injectedHook.setStrictMode(rendererID, newIsStrictMode); } catch (err) {} } -function markCommitStopped() { - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markCommitStopped && - injectedProfilingHooks.markCommitStopped(); -} function markComponentRenderStarted(fiber) { null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentRenderStarted && @@ -717,53 +684,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -990,96 +910,241 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); -} -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var now = Scheduler$1.unstable_now, - commitStartTime = -0, - profilerStartTime = -1.1, - profilerEffectDuration = -0; -function pushNestedEffectDurations() { +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + 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$1.unstable_scheduleCallback, + NormalPriority = Scheduler$1.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 now = Scheduler$1.unstable_now, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0; +function pushNestedEffectDurations() { var prevEffectDuration = profilerEffectDuration; profilerEffectDuration = 0; return prevEffectDuration; @@ -1144,7 +1209,7 @@ function ensureRootIsScheduled(root) { mightHavePendingSyncWork = !0; didScheduleMicrotask || ((didScheduleMicrotask = !0), - scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); + scheduleCallback$2(ImmediatePriority, processRootScheduleInMicrotask)); } function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -1227,12 +1292,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -1270,7 +1336,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = NormalPriority$1; } pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -1368,6 +1434,229 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; +} +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } +} +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} var hasForceUpdate = !1; function initializeUpdateQueue(fiber) { fiber.updateQueue = { @@ -1593,139 +1882,27 @@ function processUpdateQueue( queue.lastBaseUpdate = current; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; - } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } } -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) +function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; + callback.call(context); } -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); @@ -1745,7 +1922,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -1774,7 +1951,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -1799,7 +1976,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -1815,7 +1992,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -1848,7 +2025,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -1870,7 +2047,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -1884,26 +2061,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -1918,7 +2095,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -1932,7 +2109,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -1953,10 +2130,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -1972,7 +2149,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -2017,7 +2194,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$17 = !1; + didReadFromEntangledAsyncAction$19 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2038,11 +2215,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$17 = !0); + (didReadFromEntangledAsyncAction$19 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$17 = !0); + (didReadFromEntangledAsyncAction$19 = !0); continue; } else (updateLane = { @@ -2057,7 +2234,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -2078,7 +2255,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -2088,7 +2265,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$17 && + didReadFromEntangledAsyncAction$19 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2124,7 +2301,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -2161,10 +2338,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -2286,8 +2463,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$21) { - onActionError(actionQueue, node, error$21); + } catch (error$23) { + onActionError(actionQueue, node, error$23); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -2350,16 +2527,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -2373,7 +2546,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -2409,7 +2582,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -2471,10 +2644,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -2495,7 +2668,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -2511,7 +2684,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -2554,7 +2727,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -2625,7 +2798,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -2640,7 +2813,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -2808,8 +2981,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -2922,7 +3095,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -2935,11 +3108,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue - ); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -2952,7 +3121,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -2961,7 +3130,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -3009,7 +3178,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -3020,7 +3189,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); }, useResourceEffect: function ( @@ -3031,7 +3200,7 @@ var HooksDispatcherOnMount = { destroy ) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -4082,9 +4251,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$47 in Component) - void 0 === newProps[propName$47] && - (newProps[propName$47] = Component[propName$47]); + for (var propName$49 in Component) + void 0 === newProps[propName$49] && + (newProps[propName$49] = Component[propName$49]); } return newProps; } @@ -4911,7 +5080,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -5855,297 +6029,53 @@ function beginWork(current, workInProgress, renderLanes) { (nextProps = createCache()), (init.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { - parent: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { + parent: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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$1.unstable_scheduleCallback, - NormalPriority = Scheduler$1.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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -6278,9 +6208,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -6380,8 +6308,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= index.treeBaseDuration)); index = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (index = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = index), (index = !0); if (!index) { if (workInProgress.flags & 256) @@ -6407,11 +6337,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (index = newProps.alternate.memoizedState.cachePool.pool); - var cache$99 = null; + var cache$100 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$99 = newProps.memoizedState.cachePool.pool); - cache$99 !== index && (newProps.flags |= 2048); + (cache$100 = newProps.memoizedState.cachePool.pool); + cache$100 !== index && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -6441,8 +6371,8 @@ function completeWork(current, workInProgress, renderLanes) { index = workInProgress.memoizedState; if (null === index) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$99 = index.rendering; - if (null === cache$99) + cache$100 = index.rendering; + if (null === cache$100) if (newProps) cutOffTailIfNeeded(index, !1); else { if ( @@ -6450,11 +6380,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$99 = findFirstSuspended(current); - if (null !== cache$99) { + cache$100 = findFirstSuspended(current); + if (null !== cache$100) { workInProgress.flags |= 128; cutOffTailIfNeeded(index, !1); - current = cache$99.updateQueue; + current = cache$100.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6479,7 +6409,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$99)), null !== current)) { + if (((current = findFirstSuspended(cache$100)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6489,7 +6419,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(index, !0), null === index.tail && "hidden" === index.tailMode && - !cache$99.alternate) + !cache$100.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6501,13 +6431,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(index, !1), (workInProgress.lanes = 4194304)); index.isBackwards - ? ((cache$99.sibling = workInProgress.child), - (workInProgress.child = cache$99)) + ? ((cache$100.sibling = workInProgress.child), + (workInProgress.child = cache$100)) : ((current = index.last), null !== current - ? (current.sibling = cache$99) - : (workInProgress.child = cache$99), - (index.last = cache$99)); + ? (current.sibling = cache$100) + : (workInProgress.child = cache$100), + (index.last = cache$100)); } if (null !== index.tail) return ( @@ -6750,9 +6680,9 @@ function commitHookEffectListMount(flags, finishedWork) { null != updateQueue.inst.resource && updateQueue.update(updateQueue.inst.resource); if (null == updateQueue.resourceKind) { - var create$115 = updateQueue.create, + var create$116 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$115(); + lastEffect = create$116(); inst.destroy = lastEffect; } 0 !== (flags & 8) @@ -6916,8 +6846,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$119) { - captureCommitPhaseError(current, nearestMountedAncestor, error$119); + } catch (error$120) { + captureCommitPhaseError(current, nearestMountedAncestor, error$120); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -6977,8 +6907,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$120) { - captureCommitPhaseError(current, nearestMountedAncestor, error$120); + } catch (error$121) { + captureCommitPhaseError(current, nearestMountedAncestor, error$121); } else ref.current = null; } @@ -7068,83 +6998,7 @@ function insertOrAppendPlacementNode(node, before, parent) { var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((root = nextEffect), - (firstChild = root.child), - 0 !== (root.subtreeFlags & 1028) && null !== firstChild) - ) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - var current = root.alternate; - firstChild = root.flags; - switch (root.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (firstChild & 1024) && null !== current) { - firstChild = void 0; - var finishedWork = root, - prevProps = current.memoizedProps; - current = current.memoizedState; - var instance = finishedWork.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - finishedWork.type, - prevProps, - finishedWork.elementType === finishedWork.type - ); - firstChild = instance.getSnapshotBeforeUpdate( - resolvedPrevProps, - current - ); - instance.__reactInternalSnapshotBeforeUpdate = firstChild; - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } - } - break; - case 3: - 0 !== (firstChild & 1024) && - root.stateNode.containerInfo.children.splice(0); - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (firstChild & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; -} + nextEffect = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -7169,11 +7023,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$116) { + } catch (error$117) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$116 + error$117 ); } else { @@ -7190,11 +7044,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$117) { + } catch (error$118) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$117 + error$118 ); } recordEffectDuration(); @@ -7205,11 +7059,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$118) { + } catch (error$119) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$118 + error$119 ); } } @@ -7772,12 +7626,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$121 = JSCompiler_inline_result.stateNode.containerInfo, - before$122 = getHostSibling(finishedWork); + var parent$122 = JSCompiler_inline_result.stateNode.containerInfo, + before$123 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$122, - parent$121 + before$123, + parent$122 ); break; default: @@ -8066,6 +7920,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -8471,7 +8333,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -8594,7 +8455,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -8692,54 +8558,261 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( - root, - finishedWork, + root$jscomp$0, + finishedWork$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - lanes, + lanes$jscomp$0, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && - accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; + didIncludeRenderPhaseUpdate = finishedWork$jscomp$0.subtreeFlags; + (didIncludeRenderPhaseUpdate & 8192 || + 16785408 === (didIncludeRenderPhaseUpdate & 16785408)) && + accumulateSuspenseyCommitOnFiber(finishedWork$jscomp$0); + finishedWork$jscomp$0 = ReactSharedInternals.T; + didIncludeRenderPhaseUpdate = currentUpdatePriority; try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStarted && + injectedProfilingHooks.markCommitStarted(lanes); + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + lanes$jscomp$0 = remainingLanes |= concurrentlyUpdatedLanes; + var previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = lanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= lanes$jscomp$0; + root$jscomp$0.entangledLanes &= lanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= lanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + lanes$jscomp$0 = previouslyPendingLanes & ~lanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(lanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + transitions = currentUpdatePriority; + currentUpdatePriority = 2; + rootHasEffect = executionContext; + executionContext |= 4; + for (nextEffect = finishedWork; null !== nextEffect; ) { + updatedLanes = nextEffect; + var child = updatedLanes.child; + if (0 !== (updatedLanes.subtreeFlags & 1028) && null !== child) + (child.return = updatedLanes), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + updatedLanes = nextEffect; + suspendedRetryLanes = void 0; + previouslyPendingLanes = updatedLanes; + var current = previouslyPendingLanes.alternate, + flags = previouslyPendingLanes.flags; + switch (previouslyPendingLanes.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = previouslyPendingLanes.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + previouslyPendingLanes.type, + prevProps, + previouslyPendingLanes.elementType === + previouslyPendingLanes.type + ); + suspendedRetryLanes = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = + suspendedRetryLanes; + } catch (error) { + captureCommitPhaseError( + previouslyPendingLanes, + previouslyPendingLanes.return, + error + ); + } + } + break; + case 3: + 0 !== (flags & 1024) && + previouslyPendingLanes.stateNode.containerInfo.children.splice( + 0 + ); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + var sibling = updatedLanes.sibling; + if (null !== sibling) { + sibling.return = updatedLanes.return; + nextEffect = sibling; + break b; + } + nextEffect = updatedLanes.return; + } + } + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + root$jscomp$0.current = finishedWork; + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + requestPaint(); + executionContext = rootHasEffect; + currentUpdatePriority = transitions; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + spawnedLane + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (didIncludeRenderPhaseUpdate) { + case 2: + var schedulerPriority = ImmediatePriority; + break; + case 8: + schedulerPriority = UserBlockingPriority; + break; + case 32: + schedulerPriority = NormalPriority$1; + break; + case 268435456: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) {} + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && + 0 !== root$jscomp$0.tag && + flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStopped && + injectedProfilingHooks.markCommitStopped(); } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); + (ReactSharedInternals.T = finishedWork$jscomp$0), + (currentUpdatePriority = didIncludeRenderPhaseUpdate); } } function isRenderConsistentWithExternalStores(finishedWork) { @@ -8822,7 +8895,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -8879,7 +8952,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -9007,12 +9080,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$140) { - handleThrow(root, thrownValue$140); + } catch (thrownValue$141) { + handleThrow(root, thrownValue$141); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -9125,11 +9198,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$142) { - handleThrow(root, thrownValue$142); + } catch (thrownValue$143) { + handleThrow(root, thrownValue$143); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -9214,7 +9287,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -9327,117 +9400,6 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markCommitStarted && - injectedProfilingHooks.markCommitStarted(didIncludeRenderPhaseUpdate); - if (null === finishedWork) return markCommitStopped(), null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - 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(!0); - return null; - })); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), - (currentUpdatePriority = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted( - didIncludeRenderPhaseUpdate - ), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : 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]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && - 0 !== root.tag && - flushPassiveEffects(); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - markCommitStopped(); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -9464,6 +9426,9 @@ function flushPassiveEffects() { lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + root$jscomp$0.callbackNode = null; + root$jscomp$0.callbackPriority = 0; + root$jscomp$0.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error("Cannot flush passive effects while already rendering."); null !== injectedProfilingHooks && @@ -9485,6 +9450,7 @@ function flushPassiveEffects() { injectedProfilingHooks.markPassiveEffectsStopped(); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(root$jscomp$0); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -9622,9 +9588,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function scheduleCallback(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -10322,17 +10285,17 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var internals$jscomp$inline_1194 = { +var internals$jscomp$inline_1243 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$146 = 0; - 31 > index$146; - index$146++ + var map = new Map(), lane = 1, index$147 = 0; + 31 > index$147; + index$147++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -10345,16 +10308,16 @@ var internals$jscomp$inline_1194 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1438 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1519 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1438.isDisabled && - hook$jscomp$inline_1438.supportsFiber + !hook$jscomp$inline_1519.isDisabled && + hook$jscomp$inline_1519.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1438.inject( - internals$jscomp$inline_1194 + (rendererID = hook$jscomp$inline_1519.inject( + internals$jscomp$inline_1243 )), - (injectedHook = hook$jscomp$inline_1438); + (injectedHook = hook$jscomp$inline_1519); } catch (err) {} } exports._Scheduler = Scheduler; @@ -10478,4 +10441,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js index 3b8dff4448a15..7dc5c97a8e862 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9ca458cf4e4f7e28d1d6dc8d5f0f71d0>> + * @generated SignedSource<<897157d62f13bcf2e48c6dabe7590167>> */ "use strict"; @@ -1824,7 +1824,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-a9bbe346-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js index aeae2728c91b8..737295cccd470 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<58debbbcaf0045517e17bdd174a463cf>> + * @generated SignedSource<<92de39d104ea6a1e1823ac6c3d080a25>> */ "use strict"; @@ -592,4 +592,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js index 48a0014cd67b8..5dc8debb67a33 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<1064ef4095af3f4d10ca022bc6cb97cf>> + * @generated SignedSource<> */ "use strict"; @@ -596,7 +596,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-native-fb-d4287258-20241217"; +exports.version = "19.1.0-native-fb-a9bbe346-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-dev.js index 59508ea67b941..8335cd75ba860 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-dev.js @@ -7,14 +7,13 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<683e9f5f7bc802658826ccfe11ea74a7>> + * @generated SignedSource<> */ "use strict"; __DEV__ && (function () { function performWorkUntilDeadline() { - needsPaint = !1; if (isMessageLoopRunning) { var currentTime = exports.unstable_now(); startTime = currentTime; @@ -31,15 +30,7 @@ __DEV__ && try { b: { advanceTimers(currentTime); - for ( - currentTask = peek(taskQueue); - null !== currentTask && - !( - currentTask.expirationTime > currentTime && - shouldYieldToHost() - ); - - ) { + for (currentTask = peek(taskQueue); null !== currentTask; ) { var callback = currentTask.callback; if ("function" === typeof callback) { currentTask.callback = null; @@ -58,6 +49,11 @@ __DEV__ && advanceTimers(currentTime); } else pop(taskQueue); currentTask = peek(taskQueue); + if ( + null === currentTask || + currentTask.expirationTime > currentTime + ) + break; } if (null !== currentTask) hasMoreWork = !0; else { @@ -153,7 +149,9 @@ __DEV__ && advanceTimers(currentTime); if (!isHostCallbackScheduled) if (null !== peek(taskQueue)) - (isHostCallbackScheduled = !0), requestHostCallback(); + (isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); else { var firstTimer = peek(timerQueue); null !== firstTimer && @@ -163,17 +161,6 @@ __DEV__ && ); } } - function shouldYieldToHost() { - return needsPaint - ? !0 - : exports.unstable_now() - startTime < frameInterval - ? !1 - : !0; - } - function requestHostCallback() { - isMessageLoopRunning || - ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); - } function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function () { callback(exports.unstable_now()); @@ -207,7 +194,6 @@ __DEV__ && isPerformingWork = !1, isHostCallbackScheduled = !1, isHostTimeoutScheduled = !1, - needsPaint = !1, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, @@ -241,11 +227,6 @@ __DEV__ && exports.unstable_cancelCallback = function (task) { task.callback = null; }; - exports.unstable_continueExecution = function () { - isHostCallbackScheduled || - isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback()); - }; exports.unstable_forceFrameRate = function (fps) { 0 > fps || 125 < fps ? console.error( @@ -256,9 +237,6 @@ __DEV__ && exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; }; - exports.unstable_getFirstCallbackNode = function () { - return peek(taskQueue); - }; exports.unstable_next = function (eventHandler) { switch (currentPriorityLevel) { case 1: @@ -277,10 +255,7 @@ __DEV__ && currentPriorityLevel = previousPriorityLevel; } }; - exports.unstable_pauseExecution = function () {}; - exports.unstable_requestPaint = function () { - needsPaint = !0; - }; + exports.unstable_requestPaint = function () {}; exports.unstable_runWithPriority = function (priorityLevel, eventHandler) { switch (priorityLevel) { case 1: @@ -351,10 +326,15 @@ __DEV__ && push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback())); + ((isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), + schedulePerformWorkUntilDeadline()))); return priorityLevel; }; - exports.unstable_shouldYield = shouldYieldToHost; + exports.unstable_shouldYield = function () { + return exports.unstable_now() - startTime < frameInterval ? !1 : !0; + }; exports.unstable_wrapCallback = function (callback) { var parentPriorityLevel = currentPriorityLevel; return function () { diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-prod.js index 529523ec3701c..0958def978bcd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<0aa31a904fd9ab46080403092821d67a>> */ "use strict"; @@ -100,7 +100,9 @@ function handleTimeout(currentTime) { advanceTimers(currentTime); if (!isHostCallbackScheduled) if (null !== peek(taskQueue)) - (isHostCallbackScheduled = !0), requestHostCallback(); + (isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); else { var firstTimer = peek(timerQueue); null !== firstTimer && @@ -205,10 +207,6 @@ else if ("undefined" !== typeof MessageChannel) { schedulePerformWorkUntilDeadline = function () { localSetTimeout(performWorkUntilDeadline, 0); }; -function requestHostCallback() { - isMessageLoopRunning || - ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); -} function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function () { callback(exports.unstable_now()); @@ -223,11 +221,6 @@ exports.unstable_UserBlockingPriority = 2; exports.unstable_cancelCallback = function (task) { task.callback = null; }; -exports.unstable_continueExecution = function () { - isHostCallbackScheduled || - isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback()); -}; exports.unstable_forceFrameRate = function (fps) { 0 > fps || 125 < fps ? console.error( @@ -238,9 +231,6 @@ exports.unstable_forceFrameRate = function (fps) { exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; }; -exports.unstable_getFirstCallbackNode = function () { - return peek(taskQueue); -}; exports.unstable_next = function (eventHandler) { switch (currentPriorityLevel) { case 1: @@ -259,7 +249,6 @@ exports.unstable_next = function (eventHandler) { currentPriorityLevel = previousPriorityLevel; } }; -exports.unstable_pauseExecution = function () {}; exports.unstable_requestPaint = function () { needsPaint = !0; }; @@ -333,7 +322,9 @@ exports.unstable_scheduleCallback = function ( push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback())); + ((isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()))); return priorityLevel; }; exports.unstable_shouldYield = shouldYieldToHost; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-profiling.js index e8499a941b437..d322065f0c9c4 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/Scheduler-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<986564b4951c81159a5a3662d151907b>> + * @generated SignedSource<> */ "use strict"; @@ -104,7 +104,9 @@ function handleTimeout(currentTime) { advanceTimers(currentTime); if (!isHostCallbackScheduled) if (null !== peek(taskQueue)) - (isHostCallbackScheduled = !0), requestHostCallback(); + (isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); else { var firstTimer = peek(timerQueue); null !== firstTimer && @@ -209,10 +211,6 @@ else if ("undefined" !== typeof MessageChannel) { schedulePerformWorkUntilDeadline = function () { localSetTimeout(performWorkUntilDeadline, 0); }; -function requestHostCallback() { - isMessageLoopRunning || - ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()); -} function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function () { callback(exports.unstable_now()); @@ -227,11 +225,6 @@ exports.unstable_UserBlockingPriority = 2; exports.unstable_cancelCallback = function (task) { task.callback = null; }; -exports.unstable_continueExecution = function () { - isHostCallbackScheduled || - isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback()); -}; exports.unstable_forceFrameRate = function (fps) { 0 > fps || 125 < fps ? console.error( @@ -242,9 +235,6 @@ exports.unstable_forceFrameRate = function (fps) { exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; }; -exports.unstable_getFirstCallbackNode = function () { - return peek(taskQueue); -}; exports.unstable_next = function (eventHandler) { switch (currentPriorityLevel) { case 1: @@ -263,7 +253,6 @@ exports.unstable_next = function (eventHandler) { currentPriorityLevel = previousPriorityLevel; } }; -exports.unstable_pauseExecution = function () {}; exports.unstable_requestPaint = function () { needsPaint = !0; }; @@ -337,7 +326,9 @@ exports.unstable_scheduleCallback = function ( push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || - ((isHostCallbackScheduled = !0), requestHostCallback())); + ((isHostCallbackScheduled = !0), + isMessageLoopRunning || + ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline()))); return priorityLevel; }; exports.unstable_shouldYield = shouldYieldToHost; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-dev.js index 788f65dd06f65..626ef96f72010 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<5886fbc0f64ed5eebaca2fb991a78031>> */ "use strict"; @@ -234,11 +234,6 @@ __DEV__ && yieldedValues = null; return values; }; - exports.unstable_continueExecution = function () { - isHostCallbackScheduled || - isPerformingWork || - ((isHostCallbackScheduled = !0), (scheduledCallback = flushWork)); - }; exports.unstable_flushAll = function () { if (null !== yieldedValues) throw Error( @@ -301,9 +296,6 @@ __DEV__ && exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; }; - exports.unstable_getFirstCallbackNode = function () { - return peek(taskQueue); - }; exports.unstable_hasPendingWork = function () { return null !== scheduledCallback; }; @@ -328,7 +320,6 @@ __DEV__ && exports.unstable_now = function () { return currentMockTime; }; - exports.unstable_pauseExecution = function () {}; exports.unstable_requestPaint = function () { needsPaint = !0; }; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-prod.js index d0fd88233fe5b..d6057b4e610a3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/scheduler/cjs/SchedulerMock-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<87e7b57a62257e3d246f6aac3f6ce7c3>> + * @generated SignedSource<> */ "use strict"; @@ -228,11 +228,6 @@ exports.unstable_clearLog = function () { yieldedValues = null; return values; }; -exports.unstable_continueExecution = function () { - isHostCallbackScheduled || - isPerformingWork || - ((isHostCallbackScheduled = !0), (scheduledCallback = flushWork)); -}; exports.unstable_flushAll = function () { if (null !== yieldedValues) throw Error( @@ -294,9 +289,6 @@ exports.unstable_forceFrameRate = function () {}; exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; }; -exports.unstable_getFirstCallbackNode = function () { - return peek(taskQueue); -}; exports.unstable_hasPendingWork = function () { return null !== scheduledCallback; }; @@ -321,7 +313,6 @@ exports.unstable_next = function (eventHandler) { exports.unstable_now = function () { return currentMockTime; }; -exports.unstable_pauseExecution = function () {}; exports.unstable_requestPaint = function () { needsPaint = !0; }; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 38ba8aec4e512..b7f5bdda2aadc 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -d42872588282b9eef56b8fa02441b33d596fd197 +a9bbe34622885ef5667d33236d580fe7321c0d8b diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index a9ad94e05e468..b9058e2e9cf3e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<61c567b0ecf9b67fcf147775ca8a7e65>> + * @generated SignedSource<<127878892f5ca44751dd11b9221f4e55>> */ "use strict"; @@ -2687,101 +2687,251 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; + } + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; + } + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2, providerFiber); + context._currentValue2 = nextValue; + push(renderer2CursorDEV, context._currentRenderer2, providerFiber); + void 0 !== context._currentRenderer2 && + null !== context._currentRenderer2 && + context._currentRenderer2 !== rendererSigil && + error$jscomp$0( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer2 = rendererSigil; + } + function popProvider(context, providerFiber) { + context._currentValue2 = valueCursor.current; + var currentRenderer2 = renderer2CursorDEV.current; + pop(renderer2CursorDEV, providerFiber); + context._currentRenderer2 = currentRenderer2; + pop(valueCursor, providerFiber); + } + 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; + } + parent !== propagationRoot && + error$jscomp$0( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." + ); + } + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 + ) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } - function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); + function readContext(context) { + isDisallowedContextReadInDEV && + error$jscomp$0( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || - sourceFiber._visibility & 1 || - (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function getRootForUpdatedFiber(sourceFiber) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) - throw ( - ((nestedPassiveUpdateCount = nestedUpdateCount = 0), - (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && - ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null), - error$jscomp$0( - "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." - )); - null === sourceFiber.alternate && - 0 !== (sourceFiber.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); - for (var node = sourceFiber, parent = node.return; null !== parent; ) - null === node.alternate && - 0 !== (node.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), - (node = parent), - (parent = node.return); - return 3 === node.tag ? node.stateNode : null; + function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; + } + function retainCache(cache) { + cache.controller.signal.aborted && + warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; + } + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } function pushNestedEffectDurations() { var prevEffectDuration = profilerEffectDuration; @@ -3101,90 +3251,321 @@ __DEV__ && ); return thenableWithOverride; } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - error$jscomp$0( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return !0; } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + error$jscomp$0( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop, noop), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; + } + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - null !== current && - ((current = current.updateQueue), queue === current) + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + } + function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } + } + function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); + } + function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); + } + function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || + sourceFiber._visibility & 1 || + (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); + } + function getRootForUpdatedFiber(sourceFiber) { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) + throw ( + ((nestedPassiveUpdateCount = nestedUpdateCount = 0), + (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && + ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null), + error$jscomp$0( + "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." + )); + null === sourceFiber.alternate && + 0 !== (sourceFiber.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + for (var node = sourceFiber, parent = node.return; null !== parent; ) + null === node.alternate && + 0 !== (node.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), + (node = parent), + (parent = node.return); + return 3 === node.tag ? node.stateNode : null; + } + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; + } + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); + } + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + } + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if ( + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate + ) { + var componentName = getComponentNameFromFiber(fiber); + error$jscomp$0( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName + ); + didWarnUpdateInsideUpdate = !0; + } + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update + ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); + } + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } + } + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, payload: queue.payload, callback: null, next: null @@ -3405,197 +3786,77 @@ __DEV__ && ) callCallback(callbacks[updateQueue], context); } - function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + } + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); + } + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + error$jscomp$0( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table + ); + } } - return !0; } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; - } - function noop() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - error$jscomp$0( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop, noop), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; - } - } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; - } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; - if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) - ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 - ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - error$jscomp$0( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } - } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - error$jscomp$0( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps - ); + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || + error$jscomp$0( + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps + ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -3638,7 +3899,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -3649,9 +3910,7 @@ __DEV__ && "[object AsyncGeneratorFunction]" === Object.prototype.toString.call(Component) ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), didWarnAboutAsyncClientComponent.has(nextRenderLanes) || (didWarnAboutAsyncClientComponent.add(nextRenderLanes), error$jscomp$0( @@ -3711,7 +3970,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -3747,7 +4006,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -3782,7 +4041,7 @@ __DEV__ && : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); + dispatcher && (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -3810,7 +4069,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -3827,26 +4086,26 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -3861,7 +4120,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3875,7 +4134,7 @@ __DEV__ && thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = createThenableState()); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -3896,10 +4155,10 @@ __DEV__ && } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -3915,7 +4174,7 @@ __DEV__ && null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue || ignorePreviousDependencies) @@ -3963,7 +4222,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4041,7 +4300,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -4062,7 +4321,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -4109,7 +4368,7 @@ __DEV__ && return [newState, dispatch]; } function mountSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4149,7 +4408,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4201,10 +4460,10 @@ __DEV__ && function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -4262,11 +4521,7 @@ __DEV__ && function mountState(initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue - ); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; } @@ -4283,7 +4538,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4447,14 +4702,14 @@ __DEV__ && stateHook.queue = stateQueue; stateHook = dispatchSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateQueue ); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -4468,7 +4723,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -4504,7 +4759,7 @@ __DEV__ && var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( HasEffect | Passive, createEffectInstance(), @@ -4566,10 +4821,10 @@ __DEV__ && }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -4592,7 +4847,7 @@ __DEV__ && function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), @@ -4608,7 +4863,7 @@ __DEV__ && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, inst, @@ -4617,8 +4872,8 @@ __DEV__ && ))); } function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ? mountEffectImpl(142608384, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps); } @@ -4630,12 +4885,12 @@ __DEV__ && destroy ) { if ( - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ) { var hookFlags = Passive, hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 142608384; + currentlyRenderingFiber.flags |= 142608384; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -4650,7 +4905,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -4706,7 +4961,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -4719,7 +4974,7 @@ __DEV__ && } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); return mountEffectImpl(fiberFlags, Layout, create, deps); } function imperativeHandleEffect(create, ref) { @@ -4752,7 +5007,7 @@ __DEV__ && ); deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); mountEffectImpl( fiberFlags, Layout, @@ -4852,7 +5107,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -4867,7 +5122,7 @@ __DEV__ && if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -4939,7 +5194,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4981,7 +5236,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -5008,19 +5263,15 @@ __DEV__ && provider = provider.return; } } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, + args = requestUpdateLane(fiber); + var update = { + lane: args, revertLane: 0, action: action, hasEagerState: !1, @@ -5028,44 +5279,22 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); - } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args); + markStateUpdateScheduled(fiber, args); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -5150,8 +5379,8 @@ __DEV__ && function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -8931,336 +9160,85 @@ __DEV__ && workInProgress.pendingProps )), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2, providerFiber); - context._currentValue2 = nextValue; - push(renderer2CursorDEV, context._currentRenderer2, providerFiber); - void 0 !== context._currentRenderer2 && - null !== context._currentRenderer2 && - context._currentRenderer2 !== rendererSigil && - error$jscomp$0( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer2 = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue2 = valueCursor.current; - var currentRenderer2 = renderer2CursorDEV.current; - pop(renderer2CursorDEV, providerFiber); - context._currentRenderer2 = currentRenderer2; - pop(valueCursor, providerFiber); - } - 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; - } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 - ) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - error$jscomp$0( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; - } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); - } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); @@ -9513,9 +9491,7 @@ __DEV__ && (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null @@ -9717,9 +9693,10 @@ __DEV__ && keepChildren.treeBaseDuration)); keepChildren = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (keepChildren = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = keepChildren), (keepChildren = !0); if (!keepChildren) { if (workInProgress.flags & 256) @@ -11564,6 +11541,14 @@ __DEV__ && committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -12179,7 +12164,13 @@ __DEV__ && } exitStatus = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = lanesThatJustErrored; - null !== exitStatus && queueRecoverableErrors(exitStatus); + null !== exitStatus && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = exitStatus) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + exitStatus + )); } exitStatus = renderWasConcurrent; } @@ -12315,14 +12306,6 @@ __DEV__ && } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -12492,7 +12475,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -13095,9 +13078,6 @@ __DEV__ && throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -13111,24 +13091,30 @@ __DEV__ && 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= CommitContext), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects( @@ -13149,12 +13135,12 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - (transitions = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), + (transitions = spawnedLane) + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : (releaseRootPooledCache(root, remainingLanes), @@ -13165,7 +13151,6 @@ __DEV__ && transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -13173,16 +13158,17 @@ __DEV__ && finishedWork++ ) (remainingLanes = recoverableErrors[finishedWork]), - (transitions = makeErrorInfo(remainingLanes.stack)), + (spawnedLane = makeErrorInfo(remainingLanes.stack)), runWithFiberInDEV( remainingLanes.source, renderPriorityLevel, remainingLanes.value, - transitions + spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) @@ -13490,7 +13476,7 @@ __DEV__ && shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -15322,9 +15308,42 @@ __DEV__ && needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0, + valueCursor = createCursor(null); + var renderer2CursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + 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$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, now = Scheduler.unstable_now, commitStartTime = -0, profilerStartTime = -1.1, @@ -15343,14 +15362,16 @@ __DEV__ && currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, + prevOnStartTransitionFinish = ReactSharedInternals.S; + ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); + }; + var resumedCache = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, @@ -15568,6 +15589,17 @@ __DEV__ && Insertion = 2, Layout = 4, Passive = 8, + concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), didWarnUncachedGetSnapshot; @@ -15578,7 +15610,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -17020,55 +17052,10 @@ __DEV__ && var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var renderer2CursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - 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, - _currentRenderer: null, - _currentRenderer2: null - }, - prevOnStartTransitionFinish = ReactSharedInternals.S; - ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); - }; - var resumedCache = createCursor(null), didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -17146,7 +17133,6 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -17468,10 +17454,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 2ff4ee97a9607..3a808bbdbf908 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<85f56c7bc097a205ee4a462d846714eb>> */ "use strict"; @@ -1230,7 +1230,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_279 = { +var injectedNamesToPlugins$jscomp$inline_280 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -1276,32 +1276,32 @@ var injectedNamesToPlugins$jscomp$inline_279 = { } } }, - isOrderingDirty$jscomp$inline_280 = !1, - pluginName$jscomp$inline_281; -for (pluginName$jscomp$inline_281 in injectedNamesToPlugins$jscomp$inline_279) + isOrderingDirty$jscomp$inline_281 = !1, + pluginName$jscomp$inline_282; +for (pluginName$jscomp$inline_282 in injectedNamesToPlugins$jscomp$inline_280) if ( - injectedNamesToPlugins$jscomp$inline_279.hasOwnProperty( - pluginName$jscomp$inline_281 + injectedNamesToPlugins$jscomp$inline_280.hasOwnProperty( + pluginName$jscomp$inline_282 ) ) { - var pluginModule$jscomp$inline_282 = - injectedNamesToPlugins$jscomp$inline_279[pluginName$jscomp$inline_281]; + var pluginModule$jscomp$inline_283 = + injectedNamesToPlugins$jscomp$inline_280[pluginName$jscomp$inline_282]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_281) || - namesToPlugins[pluginName$jscomp$inline_281] !== - pluginModule$jscomp$inline_282 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_282) || + namesToPlugins[pluginName$jscomp$inline_282] !== + pluginModule$jscomp$inline_283 ) { - if (namesToPlugins[pluginName$jscomp$inline_281]) + if (namesToPlugins[pluginName$jscomp$inline_282]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_281 + "`.") + (pluginName$jscomp$inline_282 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_281] = - pluginModule$jscomp$inline_282; - isOrderingDirty$jscomp$inline_280 = !0; + namesToPlugins[pluginName$jscomp$inline_282] = + pluginModule$jscomp$inline_283; + isOrderingDirty$jscomp$inline_281 = !0; } } -isOrderingDirty$jscomp$inline_280 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_281 && recomputePluginOrdering(); var emptyObject$1 = {}, removedKeys = null, removedKeyCount = 0, @@ -2173,110 +2173,255 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); -} -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var firstScheduledRoot = null, - lastScheduledRoot = null, - didScheduleMicrotask = !1, - mightHavePendingSyncWork = !1, - isFlushingWork = !1, - currentEventTransitionLane = 0; -function ensureRootIsScheduled(root) { - root !== lastScheduledRoot && - null === root.next && - (null === lastScheduledRoot - ? (firstScheduledRoot = lastScheduledRoot = root) - : (lastScheduledRoot = lastScheduledRoot.next = root)); - mightHavePendingSyncWork = !0; - didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { - if (!isFlushingWork && mightHavePendingSyncWork) { +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$2 = 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$2(NormalPriority, function () { + cache.controller.abort(); + }); +} +var firstScheduledRoot = null, + lastScheduledRoot = null, + didScheduleMicrotask = !1, + mightHavePendingSyncWork = !1, + isFlushingWork = !1, + currentEventTransitionLane = 0; +function ensureRootIsScheduled(root) { + root !== lastScheduledRoot && + null === root.next && + (null === lastScheduledRoot + ? (firstScheduledRoot = lastScheduledRoot = root) + : (lastScheduledRoot = lastScheduledRoot.next = root)); + mightHavePendingSyncWork = !0; + didScheduleMicrotask || + ((didScheduleMicrotask = !0), + scheduleImmediateTask(processRootScheduleInMicrotask)); +} +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { + if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; @@ -2504,73 +2649,296 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return !0; } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - null !== current && - ((current = current.updateQueue), queue === current) + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; +} +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); +} +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +} +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } +} +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, callback: null, next: null }; @@ -2751,118 +3119,6 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); -} var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); function pushHiddenContext(fiber, context) { @@ -2881,7 +3137,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -2910,7 +3166,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -2935,7 +3191,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -2951,7 +3207,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -2984,7 +3240,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -3006,7 +3262,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3020,26 +3276,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -3054,7 +3310,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3068,7 +3324,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -3089,10 +3345,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -3108,7 +3364,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -3153,7 +3409,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$21 = !1; + didReadFromEntangledAsyncAction$23 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3174,11 +3430,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$21 = !0); + (didReadFromEntangledAsyncAction$23 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$21 = !0); + (didReadFromEntangledAsyncAction$23 = !0); continue; } else (updateLane = { @@ -3193,7 +3449,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -3214,7 +3470,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -3224,7 +3480,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$21 && + didReadFromEntangledAsyncAction$23 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3260,7 +3516,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -3297,10 +3553,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -3422,8 +3678,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$25) { - onActionError(actionQueue, node, error$25); + } catch (error$27) { + onActionError(actionQueue, node, error$27); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3486,16 +3742,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -3509,7 +3761,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3545,7 +3797,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -3607,10 +3859,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -3631,7 +3883,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -3647,7 +3899,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -3663,7 +3915,7 @@ function updateEffect(create, deps) { } function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -3705,7 +3957,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -3776,7 +4028,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -3791,7 +4043,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -3956,8 +4208,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -4071,7 +4323,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4084,7 +4336,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -4097,7 +4349,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4106,7 +4358,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -4154,7 +4406,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4165,7 +4417,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5205,9 +5457,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$51 in Component) - void 0 === newProps[propName$51] && - (newProps[propName$51] = Component[propName$51]); + for (var propName$53 in Component) + void 0 === newProps[propName$53] && + (newProps[propName$53] = Component[propName$53]); } return newProps; } @@ -6015,7 +6267,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -6813,417 +7070,173 @@ function beginWork(current, workInProgress, renderLanes) { reconcileChildren( current, workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (elementType = elementType(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (elementType = elementType(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); @@ -7440,9 +7453,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null @@ -7536,7 +7547,7 @@ function completeWork(current, workInProgress, renderLanes) { renderLanes, workInProgress ); - newProps = { + current = { node: oldProps, canonical: { nativeTag: current, @@ -7547,8 +7558,8 @@ function completeWork(current, workInProgress, renderLanes) { } }; markCloned(workInProgress); - appendAllChildren(newProps, workInProgress, !1, !1); - workInProgress.stateNode = newProps; + appendAllChildren(current, workInProgress, !1, !1); + workInProgress.stateNode = current; } bubbleProperties(workInProgress); workInProgress.flags &= -16777217; @@ -7606,8 +7617,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); oldProps = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (oldProps = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = oldProps), (oldProps = !0); if (!oldProps) { if (workInProgress.flags & 256) @@ -7675,14 +7688,14 @@ function completeWork(current, workInProgress, renderLanes) { if (null !== newChildSet) { workInProgress.flags |= 128; cutOffTailIfNeeded(oldProps, !1); - newProps = newChildSet.updateQueue; - workInProgress.updateQueue = newProps; - scheduleRetryEffect(workInProgress, newProps); + current = newChildSet.updateQueue; + workInProgress.updateQueue = current; + scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; - newProps = renderLanes; - for (current = workInProgress.child; null !== current; ) - resetWorkInProgress(current, newProps), - (current = current.sibling); + current = renderLanes; + for (newProps = workInProgress.child; null !== newProps; ) + resetWorkInProgress(newProps, current), + (newProps = newProps.sibling); push( suspenseStackCursor, (suspenseStackCursor.current & 1) | 2 @@ -7923,16 +7936,16 @@ function commitHookEffectListMount(flags, finishedWork) { enableUseResourceEffectHook) ) { if (null == updateQueue.resourceKind) { - var create$117 = updateQueue.create, + var create$118 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$117(); + lastEffect = create$118(); inst.destroy = lastEffect; } } else { - var create$118 = updateQueue.create, - inst$119 = updateQueue.inst; - lastEffect = create$118(); - inst$119.destroy = lastEffect; + var create$119 = updateQueue.create, + inst$120 = updateQueue.inst; + lastEffect = create$119(); + inst$120.destroy = lastEffect; } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8085,8 +8098,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$121) { - captureCommitPhaseError(current, nearestMountedAncestor, error$121); + } catch (error$122) { + captureCommitPhaseError(current, nearestMountedAncestor, error$122); } else ref.current = null; } @@ -8220,11 +8233,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$120) { + } catch (error$121) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$120 + error$121 ); } } @@ -8903,6 +8916,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -9302,7 +9323,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -9425,7 +9445,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -9523,14 +9548,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -9636,7 +9653,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -9693,7 +9710,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -9818,12 +9835,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$133) { - handleThrow(root, thrownValue$133); + } catch (thrownValue$134) { + handleThrow(root, thrownValue$134); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -9934,11 +9951,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$135) { - handleThrow(root, thrownValue$135); + } catch (thrownValue$136) { + handleThrow(root, thrownValue$136); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10005,7 +10022,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -10138,9 +10155,6 @@ function commitRootImpl( throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -10154,42 +10168,47 @@ function commitRootImpl( 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffectsOnFiber(finishedWork, root), (root.current = finishedWork), commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : 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; @@ -10203,6 +10222,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates @@ -11095,26 +11115,26 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - internals$jscomp$inline_1210 = { + internals$jscomp$inline_1215 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1210.rendererConfig = extraDevToolsConfig); + (internals$jscomp$inline_1215.rendererConfig = extraDevToolsConfig); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1526 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1534 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1526.isDisabled && - hook$jscomp$inline_1526.supportsFiber + !hook$jscomp$inline_1534.isDisabled && + hook$jscomp$inline_1534.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1526.inject( - internals$jscomp$inline_1210 + (rendererID = hook$jscomp$inline_1534.inject( + internals$jscomp$inline_1215 )), - (injectedHook = hook$jscomp$inline_1526); + (injectedHook = hook$jscomp$inline_1534); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 6edd2ceba6de3..b6d5833cb0462 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<42833538eb0c93969d4abdb97ac0625e>> + * @generated SignedSource<> */ "use strict"; @@ -1234,7 +1234,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_295 = { +var injectedNamesToPlugins$jscomp$inline_296 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -1280,32 +1280,32 @@ var injectedNamesToPlugins$jscomp$inline_295 = { } } }, - isOrderingDirty$jscomp$inline_296 = !1, - pluginName$jscomp$inline_297; -for (pluginName$jscomp$inline_297 in injectedNamesToPlugins$jscomp$inline_295) + isOrderingDirty$jscomp$inline_297 = !1, + pluginName$jscomp$inline_298; +for (pluginName$jscomp$inline_298 in injectedNamesToPlugins$jscomp$inline_296) if ( - injectedNamesToPlugins$jscomp$inline_295.hasOwnProperty( - pluginName$jscomp$inline_297 + injectedNamesToPlugins$jscomp$inline_296.hasOwnProperty( + pluginName$jscomp$inline_298 ) ) { - var pluginModule$jscomp$inline_298 = - injectedNamesToPlugins$jscomp$inline_295[pluginName$jscomp$inline_297]; + var pluginModule$jscomp$inline_299 = + injectedNamesToPlugins$jscomp$inline_296[pluginName$jscomp$inline_298]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_297) || - namesToPlugins[pluginName$jscomp$inline_297] !== - pluginModule$jscomp$inline_298 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_298) || + namesToPlugins[pluginName$jscomp$inline_298] !== + pluginModule$jscomp$inline_299 ) { - if (namesToPlugins[pluginName$jscomp$inline_297]) + if (namesToPlugins[pluginName$jscomp$inline_298]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_297 + "`.") + (pluginName$jscomp$inline_298 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_297] = - pluginModule$jscomp$inline_298; - isOrderingDirty$jscomp$inline_296 = !0; + namesToPlugins[pluginName$jscomp$inline_298] = + pluginModule$jscomp$inline_299; + isOrderingDirty$jscomp$inline_297 = !0; } } -isOrderingDirty$jscomp$inline_296 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_297 && recomputePluginOrdering(); var emptyObject$1 = {}, removedKeys = null, removedKeyCount = 0, @@ -2272,90 +2272,235 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + 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$2 = 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$2(NormalPriority, function () { + cache.controller.abort(); + }); } var now = Scheduler.unstable_now, commitStartTime = -0, @@ -2660,6 +2805,229 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; +} +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } +} +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} var hasForceUpdate = !1; function initializeUpdateQueue(fiber) { fiber.updateQueue = { @@ -2907,118 +3275,6 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); -} var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); function pushHiddenContext(fiber, context) { @@ -3037,7 +3293,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3066,7 +3322,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3091,7 +3347,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3107,7 +3363,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -3140,7 +3396,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -3162,7 +3418,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3176,26 +3432,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -3210,7 +3466,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3224,7 +3480,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -3245,10 +3501,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -3264,7 +3520,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -3309,7 +3565,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$23 = !1; + didReadFromEntangledAsyncAction$25 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3330,11 +3586,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$23 = !0); + (didReadFromEntangledAsyncAction$25 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$23 = !0); + (didReadFromEntangledAsyncAction$25 = !0); continue; } else (updateLane = { @@ -3349,7 +3605,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -3370,7 +3626,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -3380,7 +3636,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$23 && + didReadFromEntangledAsyncAction$25 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3416,7 +3672,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -3453,10 +3709,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -3578,8 +3834,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$27) { - onActionError(actionQueue, node, error$27); + } catch (error$29) { + onActionError(actionQueue, node, error$29); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3642,16 +3898,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -3665,7 +3917,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3701,7 +3953,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -3763,10 +4015,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -3787,7 +4039,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -3803,7 +4055,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -3819,7 +4071,7 @@ function updateEffect(create, deps) { } function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -3861,7 +4113,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -3932,7 +4184,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -3947,7 +4199,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -4115,8 +4367,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -4230,7 +4482,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4243,7 +4495,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -4256,7 +4508,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4265,7 +4517,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -4313,7 +4565,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4324,7 +4576,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5369,9 +5621,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$55 in Component) + void 0 === newProps[propName$55] && + (newProps[propName$55] = Component[propName$55]); } return newProps; } @@ -6193,7 +6445,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -6988,186 +7245,35 @@ function beginWork(current, workInProgress, renderLanes) { null, elementType, renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = -0), - (elementType.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child ); - case 28: + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + reconcileChildren( + current, workInProgress, - elementType, - init, + workInProgress.pendingProps, renderLanes - ) + ), + workInProgress.child ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + case 8: return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), reconcileChildren( current, workInProgress, @@ -7176,258 +7282,165 @@ function beginWork(current, workInProgress, renderLanes) { ), workInProgress.child ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = -0), + (elementType.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + markComponentRenderStarted(workInProgress), + (elementType = elementType(init)), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); @@ -7680,9 +7693,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null @@ -7851,8 +7862,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= oldProps.treeBaseDuration)); oldProps = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (oldProps = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = oldProps), (oldProps = !0); if (!oldProps) { if (workInProgress.flags & 256) @@ -8228,16 +8241,16 @@ function commitHookEffectListMount(flags, finishedWork) { updateQueue.update(updateQueue.inst.resource)); if (enableUseResourceEffectHook) { if (null == updateQueue.resourceKind) { - var create$125 = updateQueue.create, + var create$126 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$125(); + lastEffect = create$126(); inst.destroy = lastEffect; } } else { - var create$126 = updateQueue.create, - inst$127 = updateQueue.inst; - lastEffect = create$126(); - inst$127.destroy = lastEffect; + var create$127 = updateQueue.create, + inst$128 = updateQueue.inst; + lastEffect = create$127(); + inst$128.destroy = lastEffect; } 0 !== (flags & 8) ? null !== injectedProfilingHooks && @@ -8416,8 +8429,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$131) { - captureCommitPhaseError(current, nearestMountedAncestor, error$131); + } catch (error$132) { + captureCommitPhaseError(current, nearestMountedAncestor, error$132); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -8477,8 +8490,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$132) { - captureCommitPhaseError(current, nearestMountedAncestor, error$132); + } catch (error$133) { + captureCommitPhaseError(current, nearestMountedAncestor, error$133); } else ref.current = null; } @@ -8641,11 +8654,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$128) { + } catch (error$129) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$128 + error$129 ); } else { @@ -8662,11 +8675,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$129) { + } catch (error$130) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$129 + error$130 ); } recordEffectDuration(); @@ -8677,11 +8690,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$130) { + } catch (error$131) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$130 + error$131 ); } } @@ -9424,6 +9437,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -9829,7 +9850,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -9953,7 +9973,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -10051,14 +10076,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -10164,7 +10181,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -10221,7 +10238,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10386,12 +10403,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$148) { - handleThrow(root, thrownValue$148); + } catch (thrownValue$149) { + handleThrow(root, thrownValue$149); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10510,11 +10527,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$150) { - handleThrow(root, thrownValue$150); + } catch (thrownValue$151) { + handleThrow(root, thrownValue$151); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10599,7 +10616,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -10742,9 +10759,6 @@ function commitRootImpl( throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -10758,24 +10772,30 @@ function commitRootImpl( 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), @@ -10790,12 +10810,12 @@ function commitRootImpl( "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); @@ -10803,7 +10823,6 @@ function commitRootImpl( 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -10817,6 +10836,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), @@ -11752,20 +11772,20 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - internals$jscomp$inline_1298 = { + internals$jscomp$inline_1303 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1298.rendererConfig = extraDevToolsConfig); -internals$jscomp$inline_1298.getLaneLabelMap = function () { + (internals$jscomp$inline_1303.rendererConfig = extraDevToolsConfig); +internals$jscomp$inline_1303.getLaneLabelMap = function () { for ( - var map = new Map(), lane = 1, index$154 = 0; - 31 > index$154; - index$154++ + var map = new Map(), lane = 1, index$155 = 0; + 31 > index$155; + index$155++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -11773,20 +11793,20 @@ internals$jscomp$inline_1298.getLaneLabelMap = function () { } return map; }; -internals$jscomp$inline_1298.injectProfilingHooks = function (profilingHooks) { +internals$jscomp$inline_1303.injectProfilingHooks = function (profilingHooks) { injectedProfilingHooks = profilingHooks; }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1577 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1585 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1577.isDisabled && - hook$jscomp$inline_1577.supportsFiber + !hook$jscomp$inline_1585.isDisabled && + hook$jscomp$inline_1585.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1577.inject( - internals$jscomp$inline_1298 + (rendererID = hook$jscomp$inline_1585.inject( + internals$jscomp$inline_1303 )), - (injectedHook = hook$jscomp$inline_1577); + (injectedHook = hook$jscomp$inline_1585); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 2f38b8fd5686a..b3eb3b910bbc5 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<67fb3ee487a36cff510e3165a5819a66>> */ "use strict"; @@ -2922,101 +2922,251 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; + } + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; + } + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && + error$jscomp$0( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer = rendererSigil; + } + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); + } + 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; + } + parent !== propagationRoot && + error$jscomp$0( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." + ); + } + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 + ) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } - function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); + function readContext(context) { + isDisallowedContextReadInDEV && + error$jscomp$0( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || - sourceFiber._visibility & 1 || - (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function getRootForUpdatedFiber(sourceFiber) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) - throw ( - ((nestedPassiveUpdateCount = nestedUpdateCount = 0), - (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && - ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null), - error$jscomp$0( - "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." - )); - null === sourceFiber.alternate && - 0 !== (sourceFiber.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); - for (var node = sourceFiber, parent = node.return; null !== parent; ) - null === node.alternate && - 0 !== (node.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), - (node = parent), - (parent = node.return); - return 3 === node.tag ? node.stateNode : null; + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; + } + function retainCache(cache) { + cache.controller.signal.aborted && + warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; + } + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } function pushNestedEffectDurations() { var prevEffectDuration = profilerEffectDuration; @@ -3330,90 +3480,321 @@ __DEV__ && ); return thenableWithOverride; } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - error$jscomp$0( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return !0; } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + error$jscomp$0( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop, noop), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; + } + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - null !== current && - ((current = current.updateQueue), queue === current) + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + } + function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } + } + function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); + } + function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); + } + function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || + sourceFiber._visibility & 1 || + (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); + } + function getRootForUpdatedFiber(sourceFiber) { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) + throw ( + ((nestedPassiveUpdateCount = nestedUpdateCount = 0), + (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && + ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null), + error$jscomp$0( + "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." + )); + null === sourceFiber.alternate && + 0 !== (sourceFiber.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + for (var node = sourceFiber, parent = node.return; null !== parent; ) + null === node.alternate && + 0 !== (node.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), + (node = parent), + (parent = node.return); + return 3 === node.tag ? node.stateNode : null; + } + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; + } + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); + } + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + } + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if ( + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate + ) { + var componentName = getComponentNameFromFiber(fiber); + error$jscomp$0( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName + ); + didWarnUpdateInsideUpdate = !0; + } + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update + ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); + } + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } + } + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, payload: queue.payload, callback: null, next: null @@ -3634,197 +4015,77 @@ __DEV__ && ) callCallback(callbacks[updateQueue], context); } - function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + } + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); + } + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + error$jscomp$0( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table + ); + } } - return !0; } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; - } - function noop() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - error$jscomp$0( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop, noop), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; - } - } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; - } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; - if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) - ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 - ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - error$jscomp$0( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } - } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - error$jscomp$0( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps - ); + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || + error$jscomp$0( + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps + ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -3867,7 +4128,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -3878,9 +4139,7 @@ __DEV__ && "[object AsyncGeneratorFunction]" === Object.prototype.toString.call(Component) ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), didWarnAboutAsyncClientComponent.has(nextRenderLanes) || (didWarnAboutAsyncClientComponent.add(nextRenderLanes), error$jscomp$0( @@ -3940,7 +4199,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -3976,7 +4235,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -4011,7 +4270,7 @@ __DEV__ && : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); + dispatcher && (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -4039,7 +4298,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -4056,26 +4315,26 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -4090,7 +4349,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -4104,7 +4363,7 @@ __DEV__ && thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = createThenableState()); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -4125,10 +4384,10 @@ __DEV__ && } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -4144,7 +4403,7 @@ __DEV__ && null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue || ignorePreviousDependencies) @@ -4192,7 +4451,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4270,7 +4529,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -4291,7 +4550,7 @@ __DEV__ && ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -4338,7 +4597,7 @@ __DEV__ && return [newState, dispatch]; } function mountSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4378,7 +4637,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4430,10 +4689,10 @@ __DEV__ && function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -4491,11 +4750,7 @@ __DEV__ && function mountState(initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue - ); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; } @@ -4512,7 +4767,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4676,14 +4931,14 @@ __DEV__ && stateHook.queue = stateQueue; stateHook = dispatchSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateQueue ); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -4697,7 +4952,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -4733,7 +4988,7 @@ __DEV__ && var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( HasEffect | Passive, createEffectInstance(), @@ -4795,10 +5050,10 @@ __DEV__ && }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -4821,7 +5076,7 @@ __DEV__ && function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), @@ -4837,7 +5092,7 @@ __DEV__ && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, inst, @@ -4846,8 +5101,8 @@ __DEV__ && ))); } function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ? mountEffectImpl(142608384, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps); } @@ -4859,12 +5114,12 @@ __DEV__ && destroy ) { if ( - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + 0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64) ) { var hookFlags = Passive, hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 142608384; + currentlyRenderingFiber.flags |= 142608384; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -4879,7 +5134,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -4935,7 +5190,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -4948,7 +5203,7 @@ __DEV__ && } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); return mountEffectImpl(fiberFlags, Layout, create, deps); } function imperativeHandleEffect(create, ref) { @@ -4981,7 +5236,7 @@ __DEV__ && ); deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 67108864); mountEffectImpl( fiberFlags, Layout, @@ -5081,7 +5336,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -5096,7 +5351,7 @@ __DEV__ && if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -5168,7 +5423,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -5210,7 +5465,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -5237,19 +5492,15 @@ __DEV__ && provider = provider.return; } } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, + args = requestUpdateLane(fiber); + var update = { + lane: args, revertLane: 0, action: action, hasEagerState: !1, @@ -5257,44 +5508,22 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); - } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + markStateUpdateScheduled(fiber, args); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && error$jscomp$0( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ); - markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args); + markStateUpdateScheduled(fiber, args); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -5379,8 +5608,8 @@ __DEV__ && function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -9160,336 +9389,85 @@ __DEV__ && workInProgress.pendingProps )), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - error$jscomp$0( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); - } - 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; - } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 - ) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - error$jscomp$0( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; - } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { - cache.controller.abort(); - }); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); - } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -9623,9 +9601,7 @@ __DEV__ && (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -9768,9 +9744,10 @@ __DEV__ && (workInProgress.treeBaseDuration -= key.treeBaseDuration)); key = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (key = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = key), (key = !0); if (!key) { if (workInProgress.flags & 256) @@ -11917,6 +11894,14 @@ __DEV__ && committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -12541,7 +12526,13 @@ __DEV__ && } exitStatus = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = lanesThatJustErrored; - null !== exitStatus && queueRecoverableErrors(exitStatus); + null !== exitStatus && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = exitStatus) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + exitStatus + )); } exitStatus = renderWasConcurrent; } @@ -12678,14 +12669,6 @@ __DEV__ && } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -12855,7 +12838,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -13458,9 +13441,6 @@ __DEV__ && throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -13474,24 +13454,30 @@ __DEV__ && 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= CommitContext), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects( @@ -13512,12 +13498,12 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - (transitions = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), + (transitions = spawnedLane) + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : (releaseRootPooledCache(root, remainingLanes), @@ -13528,7 +13514,6 @@ __DEV__ && transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -13536,16 +13521,17 @@ __DEV__ && finishedWork++ ) (remainingLanes = recoverableErrors[finishedWork]), - (transitions = makeErrorInfo(remainingLanes.stack)), + (spawnedLane = makeErrorInfo(remainingLanes.stack)), runWithFiberInDEV( remainingLanes.source, renderPriorityLevel, remainingLanes.value, - transitions + spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) @@ -13853,7 +13839,7 @@ __DEV__ && shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -15757,9 +15743,42 @@ __DEV__ && hydrationDiffRootDEV = null, hydrationErrors = null, StrictLegacyMode = 8, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + 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$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, now = Scheduler.unstable_now, commitStartTime = -0, profilerStartTime = -1.1, @@ -15778,14 +15797,16 @@ __DEV__ && currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, + prevOnStartTransitionFinish = ReactSharedInternals.S; + ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); + }; + var resumedCache = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, @@ -16004,6 +16025,17 @@ __DEV__ && Insertion = 2, Layout = 4, Passive = 8, + concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), didWarnUncachedGetSnapshot; @@ -16014,7 +16046,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -17456,55 +17488,10 @@ __DEV__ && var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - 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, - _currentRenderer: null, - _currentRenderer2: null - }, - prevOnStartTransitionFinish = ReactSharedInternals.S; - ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); - }; - var resumedCache = createCursor(null), didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -17584,7 +17571,6 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -17691,11 +17677,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-a9bbe346-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.1.0-native-fb-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.1.0-native-fb-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -17721,10 +17707,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 944d490a3766c..92552a7833ef8 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<8bc5476f49683b66058bfbe29ae17d79>> + * @generated SignedSource<> */ "use strict"; @@ -1225,7 +1225,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_286 = { +var injectedNamesToPlugins$jscomp$inline_287 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -1271,32 +1271,32 @@ var injectedNamesToPlugins$jscomp$inline_286 = { } } }, - isOrderingDirty$jscomp$inline_287 = !1, - pluginName$jscomp$inline_288; -for (pluginName$jscomp$inline_288 in injectedNamesToPlugins$jscomp$inline_286) + isOrderingDirty$jscomp$inline_288 = !1, + pluginName$jscomp$inline_289; +for (pluginName$jscomp$inline_289 in injectedNamesToPlugins$jscomp$inline_287) if ( - injectedNamesToPlugins$jscomp$inline_286.hasOwnProperty( - pluginName$jscomp$inline_288 + injectedNamesToPlugins$jscomp$inline_287.hasOwnProperty( + pluginName$jscomp$inline_289 ) ) { - var pluginModule$jscomp$inline_289 = - injectedNamesToPlugins$jscomp$inline_286[pluginName$jscomp$inline_288]; + var pluginModule$jscomp$inline_290 = + injectedNamesToPlugins$jscomp$inline_287[pluginName$jscomp$inline_289]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_288) || - namesToPlugins[pluginName$jscomp$inline_288] !== - pluginModule$jscomp$inline_289 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_289) || + namesToPlugins[pluginName$jscomp$inline_289] !== + pluginModule$jscomp$inline_290 ) { - if (namesToPlugins[pluginName$jscomp$inline_288]) + if (namesToPlugins[pluginName$jscomp$inline_289]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_288 + "`.") + (pluginName$jscomp$inline_289 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_288] = - pluginModule$jscomp$inline_289; - isOrderingDirty$jscomp$inline_287 = !0; + namesToPlugins[pluginName$jscomp$inline_289] = + pluginModule$jscomp$inline_290; + isOrderingDirty$jscomp$inline_288 = !0; } } -isOrderingDirty$jscomp$inline_287 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_288 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -2477,110 +2477,255 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); -} -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var firstScheduledRoot = null, - lastScheduledRoot = null, - didScheduleMicrotask = !1, - mightHavePendingSyncWork = !1, - isFlushingWork = !1, - currentEventTransitionLane = 0; -function ensureRootIsScheduled(root) { - root !== lastScheduledRoot && - null === root.next && - (null === lastScheduledRoot - ? (firstScheduledRoot = lastScheduledRoot = root) - : (lastScheduledRoot = lastScheduledRoot.next = root)); - mightHavePendingSyncWork = !0; - didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { - if (!isFlushingWork && mightHavePendingSyncWork) { +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$2 = 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$2(NormalPriority, function () { + cache.controller.abort(); + }); +} +var firstScheduledRoot = null, + lastScheduledRoot = null, + didScheduleMicrotask = !1, + mightHavePendingSyncWork = !1, + isFlushingWork = !1, + currentEventTransitionLane = 0; +function ensureRootIsScheduled(root) { + root !== lastScheduledRoot && + null === root.next && + (null === lastScheduledRoot + ? (firstScheduledRoot = lastScheduledRoot = root) + : (lastScheduledRoot = lastScheduledRoot.next = root)); + mightHavePendingSyncWork = !0; + didScheduleMicrotask || + ((didScheduleMicrotask = !0), + scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); +} +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { + if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; @@ -2799,73 +2944,296 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); + return !0; } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - null !== current && - ((current = current.updateQueue), queue === current) + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; +} +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); +} +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +} +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } +} +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, callback: null, next: null }; @@ -3046,118 +3414,6 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); -} var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); function pushHiddenContext(fiber, context) { @@ -3176,7 +3432,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3205,7 +3461,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3230,7 +3486,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3246,7 +3502,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -3279,7 +3535,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -3301,7 +3557,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3315,26 +3571,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -3349,7 +3605,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3363,7 +3619,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -3384,10 +3640,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -3403,7 +3659,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -3448,7 +3704,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$23 = !1; + didReadFromEntangledAsyncAction$25 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3469,11 +3725,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$23 = !0); + (didReadFromEntangledAsyncAction$25 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$23 = !0); + (didReadFromEntangledAsyncAction$25 = !0); continue; } else (updateLane = { @@ -3488,7 +3744,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -3509,7 +3765,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -3519,7 +3775,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$23 && + didReadFromEntangledAsyncAction$25 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3555,7 +3811,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -3592,10 +3848,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -3717,8 +3973,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$27) { - onActionError(actionQueue, node, error$27); + } catch (error$29) { + onActionError(actionQueue, node, error$29); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3781,16 +4037,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -3804,7 +4056,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3840,7 +4092,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -3902,10 +4154,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -3926,7 +4178,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -3942,7 +4194,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -3958,7 +4210,7 @@ function updateEffect(create, deps) { } function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -4000,7 +4252,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -4071,7 +4323,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -4086,7 +4338,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -4251,8 +4503,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -4366,7 +4618,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4379,7 +4631,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -4392,7 +4644,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4401,7 +4653,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -4449,7 +4701,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4460,7 +4712,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5500,9 +5752,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$55 in Component) + void 0 === newProps[propName$55] && + (newProps[propName$55] = Component[propName$55]); } return newProps; } @@ -6310,7 +6562,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -7108,417 +7365,173 @@ function beginWork(current, workInProgress, renderLanes) { reconcileChildren( current, workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (elementType = elementType(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) - ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (elementType = elementType(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -7616,9 +7629,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -7730,8 +7741,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -8046,16 +8059,16 @@ function commitHookEffectListMount(flags, finishedWork) { enableUseResourceEffectHook) ) { if (null == updateQueue.resourceKind) { - var create$117 = updateQueue.create, + var create$118 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$117(); + lastEffect = create$118(); inst.destroy = lastEffect; } } else { - var create$118 = updateQueue.create, - inst$119 = updateQueue.inst; - lastEffect = create$118(); - inst$119.destroy = lastEffect; + var create$119 = updateQueue.create, + inst$120 = updateQueue.inst; + lastEffect = create$119(); + inst$120.destroy = lastEffect; } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8208,8 +8221,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$121) { - captureCommitPhaseError(current, nearestMountedAncestor, error$121); + } catch (error$122) { + captureCommitPhaseError(current, nearestMountedAncestor, error$122); } else ref.current = null; } @@ -8423,11 +8436,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$120) { + } catch (error$121) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$120 + error$121 ); } } @@ -9065,12 +9078,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$122 = JSCompiler_inline_result.stateNode.containerInfo, - before$123 = getHostSibling(finishedWork); + var parent$123 = JSCompiler_inline_result.stateNode.containerInfo, + before$124 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$123, - parent$122 + before$124, + parent$123 ); break; default: @@ -9335,6 +9348,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -9734,7 +9755,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -9859,7 +9879,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -9957,14 +9982,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -10070,7 +10087,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -10127,7 +10144,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10252,12 +10269,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$137) { - handleThrow(root, thrownValue$137); + } catch (thrownValue$138) { + handleThrow(root, thrownValue$138); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10368,11 +10385,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$139) { - handleThrow(root, thrownValue$139); + } catch (thrownValue$140) { + handleThrow(root, thrownValue$140); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10439,7 +10456,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -10572,9 +10589,6 @@ function commitRootImpl( throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -10588,42 +10602,47 @@ function commitRootImpl( 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffectsOnFiber(finishedWork, root), (root.current = finishedWork), commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : 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; @@ -10637,6 +10656,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates @@ -11229,11 +11249,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) +if ("19.1.0-native-fb-a9bbe346-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.1.0-native-fb-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.1.0-native-fb-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11280,26 +11300,26 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - internals$jscomp$inline_1276 = { + internals$jscomp$inline_1281 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1276.rendererConfig = extraDevToolsConfig); + (internals$jscomp$inline_1281.rendererConfig = extraDevToolsConfig); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1613 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1621 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1613.isDisabled && - hook$jscomp$inline_1613.supportsFiber + !hook$jscomp$inline_1621.isDisabled && + hook$jscomp$inline_1621.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1613.inject( - internals$jscomp$inline_1276 + (rendererID = hook$jscomp$inline_1621.inject( + internals$jscomp$inline_1281 )), - (injectedHook = hook$jscomp$inline_1613); + (injectedHook = hook$jscomp$inline_1621); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 3bdb779473d92..0b58bd44e7874 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -1229,7 +1229,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_302 = { +var injectedNamesToPlugins$jscomp$inline_303 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -1275,32 +1275,32 @@ var injectedNamesToPlugins$jscomp$inline_302 = { } } }, - isOrderingDirty$jscomp$inline_303 = !1, - pluginName$jscomp$inline_304; -for (pluginName$jscomp$inline_304 in injectedNamesToPlugins$jscomp$inline_302) + isOrderingDirty$jscomp$inline_304 = !1, + pluginName$jscomp$inline_305; +for (pluginName$jscomp$inline_305 in injectedNamesToPlugins$jscomp$inline_303) if ( - injectedNamesToPlugins$jscomp$inline_302.hasOwnProperty( - pluginName$jscomp$inline_304 + injectedNamesToPlugins$jscomp$inline_303.hasOwnProperty( + pluginName$jscomp$inline_305 ) ) { - var pluginModule$jscomp$inline_305 = - injectedNamesToPlugins$jscomp$inline_302[pluginName$jscomp$inline_304]; + var pluginModule$jscomp$inline_306 = + injectedNamesToPlugins$jscomp$inline_303[pluginName$jscomp$inline_305]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_304) || - namesToPlugins[pluginName$jscomp$inline_304] !== - pluginModule$jscomp$inline_305 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_305) || + namesToPlugins[pluginName$jscomp$inline_305] !== + pluginModule$jscomp$inline_306 ) { - if (namesToPlugins[pluginName$jscomp$inline_304]) + if (namesToPlugins[pluginName$jscomp$inline_305]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_304 + "`.") + (pluginName$jscomp$inline_305 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_304] = - pluginModule$jscomp$inline_305; - isOrderingDirty$jscomp$inline_303 = !0; + namesToPlugins[pluginName$jscomp$inline_305] = + pluginModule$jscomp$inline_306; + isOrderingDirty$jscomp$inline_304 = !0; } } -isOrderingDirty$jscomp$inline_303 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_304 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -2576,90 +2576,235 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue = null)); } -var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; +} +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = 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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + 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( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + 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 +) { + current = null; for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + 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("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + 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$2 = 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$2(NormalPriority, function () { + cache.controller.abort(); + }); } var now = Scheduler.unstable_now, commitStartTime = -0, @@ -2955,6 +3100,229 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; +} +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function noop() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } +} +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } +} +function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); +} +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + isHidden && + null !== update && + 3 === sourceFiber.tag && + ((parent = sourceFiber.stateNode), + (isHidden = 31 - clz32(lane)), + (parent = parent.hiddenUpdates), + (sourceFiber = parent[isHidden]), + null === sourceFiber + ? (parent[isHidden] = [update]) + : sourceFiber.push(update), + (update.lane = lane | 536870912)); +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} var hasForceUpdate = !1; function initializeUpdateQueue(fiber) { fiber.updateQueue = { @@ -3202,118 +3570,6 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -var hasOwnProperty = Object.prototype.hasOwnProperty; -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; -} -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); -} var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); function pushHiddenContext(fiber, context) { @@ -3332,7 +3588,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3361,7 +3617,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3386,7 +3642,7 @@ function finishRenderingHooks(current) { ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdate = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3402,7 +3658,7 @@ function finishRenderingHooks(current) { (didReceiveUpdate = !0)); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -3435,7 +3691,7 @@ function TransitionAwareHostComponent() { : maybeThenable; dispatcher = dispatcher.useState()[0]; (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); + (currentlyRenderingFiber.flags |= 1024); return maybeThenable; } function bailoutHooks(current, workInProgress, lanes) { @@ -3457,7 +3713,7 @@ function resetHooksOnUnwind(workInProgress) { didScheduleRenderPhaseUpdate = !1; } renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + workInProgressHook = currentHook = currentlyRenderingFiber = null; didScheduleRenderPhaseUpdateDuringThisPass = !1; thenableIndexCounter$1 = 0; thenableState$1 = null; @@ -3471,26 +3727,26 @@ function mountWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) : (workInProgressHook = workInProgressHook.next = hook); return workInProgressHook; } function updateWorkInProgressHook() { if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; + var nextCurrentHook = currentlyRenderingFiber.alternate; nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; } else nextCurrentHook = currentHook.next; var nextWorkInProgressHook = null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState + ? currentlyRenderingFiber.memoizedState : workInProgressHook.next; if (null !== nextWorkInProgressHook) (workInProgressHook = nextWorkInProgressHook), (currentHook = nextCurrentHook); else { if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) + if (null === currentlyRenderingFiber.alternate) throw Error( "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); @@ -3505,7 +3761,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3519,7 +3775,7 @@ function useThenable(thenable) { thenableIndexCounter$1 += 1; null === thenableState$1 && (thenableState$1 = []); thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; + index = currentlyRenderingFiber; null === (null === workInProgressHook ? index.memoizedState @@ -3540,10 +3796,10 @@ function use(usable) { } function useMemoCache(size) { var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; + updateQueue = currentlyRenderingFiber.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + var current = currentlyRenderingFiber.alternate; null !== current && ((current = current.updateQueue), null !== current && @@ -3559,7 +3815,7 @@ function useMemoCache(size) { null == memoCache && (memoCache = { data: [], index: 0 }); null === updateQueue && ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); + (currentlyRenderingFiber.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; if (void 0 === updateQueue) @@ -3604,7 +3860,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$25 = !1; + didReadFromEntangledAsyncAction$27 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3625,11 +3881,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$25 = !0); + (didReadFromEntangledAsyncAction$27 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$25 = !0); + (didReadFromEntangledAsyncAction$27 = !0); continue; } else (updateLane = { @@ -3644,7 +3900,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), + (currentlyRenderingFiber.lanes |= revertLane), (workInProgressRootSkippedLanes |= revertLane); updateLane = update.action; shouldDoubleInvokeUserFnsInHooksDEV && @@ -3665,7 +3921,7 @@ function updateReducerImpl(hook, current, reducer) { ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), (baseFirst = pendingQueue)) : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), + (currentlyRenderingFiber.lanes |= updateLane), (workInProgressRootSkippedLanes |= updateLane); update = update.next; } while (null !== update && update !== current); @@ -3675,7 +3931,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$25 && + didReadFromEntangledAsyncAction$27 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3711,7 +3967,7 @@ function rerenderReducer(reducer) { return [newState, dispatch]; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); var snapshotChanged = !objectIs( @@ -3748,10 +4004,10 @@ function updateSyncExternalStore(subscribe, getSnapshot) { function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= 16384; fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; + getSnapshot = currentlyRenderingFiber.updateQueue; null === getSnapshot ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), + (currentlyRenderingFiber.updateQueue = getSnapshot), (getSnapshot.stores = [fiber])) : ((renderedSnapshot = getSnapshot.stores), null === renderedSnapshot @@ -3873,8 +4129,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$29) { - onActionError(actionQueue, node, error$29); + } catch (error$31) { + onActionError(actionQueue, node, error$31); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3937,16 +4193,12 @@ function mountActionState(action, initialStateProp) { lastRenderedState: initialStateProp }; stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - stateQueue - ); + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); stateQueue.dispatch = stateHook; stateQueue = mountStateImpl(!1); var setPendingState = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !1, stateQueue.queue ); @@ -3960,7 +4212,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3996,7 +4248,7 @@ function updateActionStateImpl(stateHook, currentStateHook, action) { var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch; action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), + ((currentlyRenderingFiber.flags |= 2048), pushSimpleEffect( 9, createEffectInstance(), @@ -4058,10 +4310,10 @@ function pushResourceEffect( }); } function pushEffectImpl(effect) { - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; null === componentUpdateQueue && ((componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue)); + (currentlyRenderingFiber.updateQueue = componentUpdateQueue)); var lastEffect = componentUpdateQueue.lastEffect; if (null === lastEffect) componentUpdateQueue.lastEffect = effect.next = effect; @@ -4082,7 +4334,7 @@ function updateRef() { function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; + currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), @@ -4098,7 +4350,7 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), + : ((currentlyRenderingFiber.flags |= fiberFlags), (hook.memoizedState = pushSimpleEffect( 1 | hookFlags, inst, @@ -4114,7 +4366,7 @@ function updateEffect(create, deps) { } function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= 8390656; + currentlyRenderingFiber.flags |= 8390656; var inst = createEffectInstance(); inst.destroy = destroy; hook.memoizedState = pushResourceEffect( @@ -4156,7 +4408,7 @@ function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= 2048); + (currentlyRenderingFiber.flags |= 2048); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? 8 : 9, isUpdateDepsSame ? 8 : 9, @@ -4227,7 +4479,7 @@ function mountDeferredValueImpl(hook, value, initialValue) { return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -4242,7 +4494,7 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return prevValue; } @@ -4410,8 +4662,8 @@ function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); } function enqueueRenderPhaseUpdate(queue, update) { @@ -4525,7 +4777,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4538,7 +4790,7 @@ var HooksDispatcherOnMount = { useState: function (initialState) { initialState = mountStateImpl(initialState); var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); queue.dispatch = dispatch; return [initialState.memoizedState, dispatch]; }, @@ -4551,7 +4803,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4560,7 +4812,7 @@ var HooksDispatcherOnMount = { return [!1, stateHook]; }, useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (null === workInProgressRoot) @@ -4608,7 +4860,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4619,7 +4871,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5664,9 +5916,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$55 in Component) - void 0 === newProps[propName$55] && - (newProps[propName$55] = Component[propName$55]); + for (var propName$57 in Component) + void 0 === newProps[propName$57] && + (newProps[propName$57] = Component[propName$57]); } return newProps; } @@ -6488,7 +6740,12 @@ function pushHostRootContext(workInProgress) { pushTopLevelContextObject(workInProgress, root.context, !1); pushHostContainer(workInProgress, root.containerInfo); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -7283,186 +7540,35 @@ function beginWork(current, workInProgress, renderLanes) { null, elementType, renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = -0), - (elementType.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( - current, - workInProgress, - elementType.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - isContextProvider(elementType) - ? ((current = !0), pushContextProvider(workInProgress)) - : (current = !1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - current, - renderLanes - ) + )) + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), + workInProgress.child ); - case 28: + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + reconcileChildren( + current, workInProgress, - elementType, - init, + workInProgress.pendingProps, renderLanes - ) + ), + workInProgress.child ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + case 8: return ( - prepareToReadContext(workInProgress), - (elementType = 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: elementType, - 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 !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), reconcileChildren( current, workInProgress, @@ -7471,258 +7577,165 @@ function beginWork(current, workInProgress, renderLanes) { ), workInProgress.child ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = 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 propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - 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( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - 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 -) { - 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("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - 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("Should have a current fiber. This is a bug in React."); - 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; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = -0), + (elementType.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - 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 prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + case 10: + return ( + (elementType = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, elementType.value), + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (elementType = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + markComponentRenderStarted(workInProgress), + (elementType = elementType(init)), + markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, elementType, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 17: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 1), + isContextProvider(elementType) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1), + prepareToReadContext(workInProgress), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), + finishClassComponent( + null, + workInProgress, + elementType, + !0, + current, + renderLanes + ) + ); + case 28: + return ( + (elementType = workInProgress.type), + (init = resolveClassComponentProps( + elementType, + workInProgress.pendingProps + )), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (workInProgress.tag = 0), + updateFunctionComponent( + null, + workInProgress, + elementType, + init, + renderLanes + ) + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (elementType = 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: elementType, + 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 !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -7856,9 +7869,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))), + upgradeHydrationErrorsToRecoverable()), bubbleProperties(workInProgress), null ); @@ -7975,8 +7986,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= type.treeBaseDuration)); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -8351,16 +8364,16 @@ function commitHookEffectListMount(flags, finishedWork) { updateQueue.update(updateQueue.inst.resource)); if (enableUseResourceEffectHook) { if (null == updateQueue.resourceKind) { - var create$125 = updateQueue.create, + var create$126 = updateQueue.create, inst = updateQueue.inst; - lastEffect = create$125(); + lastEffect = create$126(); inst.destroy = lastEffect; } } else { - var create$126 = updateQueue.create, - inst$127 = updateQueue.inst; - lastEffect = create$126(); - inst$127.destroy = lastEffect; + var create$127 = updateQueue.create, + inst$128 = updateQueue.inst; + lastEffect = create$127(); + inst$128.destroy = lastEffect; } 0 !== (flags & 8) ? null !== injectedProfilingHooks && @@ -8539,8 +8552,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$131) { - captureCommitPhaseError(current, nearestMountedAncestor, error$131); + } catch (error$132) { + captureCommitPhaseError(current, nearestMountedAncestor, error$132); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -8600,8 +8613,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$132) { - captureCommitPhaseError(current, nearestMountedAncestor, error$132); + } catch (error$133) { + captureCommitPhaseError(current, nearestMountedAncestor, error$133); } else ref.current = null; } @@ -8844,11 +8857,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$128) { + } catch (error$129) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$128 + error$129 ); } else { @@ -8865,11 +8878,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$129) { + } catch (error$130) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$129 + error$130 ); } recordEffectDuration(); @@ -8880,11 +8893,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$130) { + } catch (error$131) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$130 + error$131 ); } } @@ -9555,12 +9568,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$133 = JSCompiler_inline_result.stateNode.containerInfo, - before$134 = getHostSibling(finishedWork); + var parent$134 = JSCompiler_inline_result.stateNode.containerInfo, + before$135 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$134, - parent$133 + before$135, + parent$134 ); break; default: @@ -9855,6 +9868,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -10260,7 +10281,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -10386,7 +10406,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -10484,14 +10509,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -10597,7 +10614,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -10654,7 +10671,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10819,12 +10836,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$152) { - handleThrow(root, thrownValue$152); + } catch (thrownValue$153) { + handleThrow(root, thrownValue$153); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10943,11 +10960,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$154) { - handleThrow(root, thrownValue$154); + } catch (thrownValue$155) { + handleThrow(root, thrownValue$155); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11032,7 +11049,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11175,9 +11192,6 @@ function commitRootImpl( throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished( @@ -11191,24 +11205,30 @@ function commitRootImpl( 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(!0); - return null; - })); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), + (root.callbackPriority = 0), + (root.cancelPendingCommit = null)); commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), - (spawnedLane = currentUpdatePriority), + (updatedLanes = currentUpdatePriority), (currentUpdatePriority = 2), - (updatedLanes = executionContext), + (suspendedRetryLanes = executionContext), (executionContext |= 4), commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), @@ -11223,12 +11243,12 @@ function commitRootImpl( "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(), requestPaint(), - (executionContext = updatedLanes), - (currentUpdatePriority = spawnedLane), + (executionContext = suspendedRetryLanes), + (currentUpdatePriority = updatedLanes), (ReactSharedInternals.T = transitions)) : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), + spawnedLane + ? ((spawnedLane = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); @@ -11236,7 +11256,6 @@ function commitRootImpl( 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( renderPriorityLevel = root.onRecoverableError, finishedWork = 0; @@ -11250,6 +11269,7 @@ function commitRootImpl( 0 !== (pendingPassiveEffectsLanes & 3) && 0 !== root.tag && flushPassiveEffects(); + ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), @@ -11885,11 +11905,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) +if ("19.1.0-native-fb-a9bbe346-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.1.0-native-fb-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.1.0-native-fb-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11936,20 +11956,20 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - internals$jscomp$inline_1364 = { + internals$jscomp$inline_1369 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-a9bbe346-20241219", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-a9bbe346-20241219" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1364.rendererConfig = extraDevToolsConfig); -internals$jscomp$inline_1364.getLaneLabelMap = function () { + (internals$jscomp$inline_1369.rendererConfig = extraDevToolsConfig); +internals$jscomp$inline_1369.getLaneLabelMap = function () { for ( - var map = new Map(), lane = 1, index$158 = 0; - 31 > index$158; - index$158++ + var map = new Map(), lane = 1, index$159 = 0; + 31 > index$159; + index$159++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -11957,20 +11977,20 @@ internals$jscomp$inline_1364.getLaneLabelMap = function () { } return map; }; -internals$jscomp$inline_1364.injectProfilingHooks = function (profilingHooks) { +internals$jscomp$inline_1369.injectProfilingHooks = function (profilingHooks) { injectedProfilingHooks = profilingHooks; }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1664 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1672 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1664.isDisabled && - hook$jscomp$inline_1664.supportsFiber + !hook$jscomp$inline_1672.isDisabled && + hook$jscomp$inline_1672.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1664.inject( - internals$jscomp$inline_1364 + (rendererID = hook$jscomp$inline_1672.inject( + internals$jscomp$inline_1369 )), - (injectedHook = hook$jscomp$inline_1664); + (injectedHook = hook$jscomp$inline_1672); } catch (err) {} } exports.createPortal = function (children, containerTag) {