From c244ce99d4385c165f24483e425b7cbc0b5d9f83 Mon Sep 17 00:00:00 2001 From: "pull[bot]" Date: Tue, 17 Dec 2024 11:35:46 -0800 Subject: [PATCH] Clean up enableLazyContextPropagation (#31810) This flag has shipped everywhere, let's clean it up. DiffTrain build for [34ee3919c39bc9b149462322713a9811db4b8498](https://github.com/facebook/react/commit/34ee3919c39bc9b149462322713a9811db4b8498) --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../react/react-dom/cjs/ReactDOM-dev.js | 4 +- .../react/react-dom/cjs/ReactDOM-prod.js | 4 +- .../react/react-dom/cjs/ReactDOM-profiling.js | 4 +- .../react/react-dom/cjs/ReactDOMClient-dev.js | 13850 ++++++++-------- .../react-dom/cjs/ReactDOMClient-prod.js | 10194 ++++++------ .../react-dom/cjs/ReactDOMClient-profiling.js | 10294 ++++++------ .../react-dom/cjs/ReactDOMProfiling-dev.js | 13850 ++++++++-------- .../react-dom/cjs/ReactDOMProfiling-prod.js | 10194 ++++++------ .../cjs/ReactDOMProfiling-profiling.js | 10294 ++++++------ .../cjs/ReactTestRenderer-dev.js | 1592 +- .../cjs/ReactTestRenderer-prod.js | 1070 +- .../cjs/ReactTestRenderer-profiling.js | 1070 +- .../vendor/react/react/cjs/React-dev.js | 4 +- .../vendor/react/react/cjs/React-prod.js | 4 +- .../vendor/react/react/cjs/React-profiling.js | 4 +- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 1590 +- .../implementations/ReactFabric-prod.fb.js | 1068 +- .../ReactFabric-profiling.fb.js | 1068 +- .../ReactNativeRenderer-dev.fb.js | 1594 +- .../ReactNativeRenderer-prod.fb.js | 1072 +- .../ReactNativeRenderer-profiling.fb.js | 1072 +- 23 files changed, 39914 insertions(+), 39986 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 27a192921e0b4..7e7e3c166588b 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-34ee3919-20241217 \ 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..b816fadf01d6c 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<<30f52d921681128a0384ae46787dc225>> */ "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-34ee3919-20241217"; })(); 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..9d2372e89016a 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<<071057a56fce7a4c79ad8d6f2900e7b2>> */ "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-34ee3919-20241217"; 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..9d2372e89016a 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<<071057a56fce7a4c79ad8d6f2900e7b2>> */ "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-34ee3919-20241217"; 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..2e5ab0c5fa823 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<<44d6e479cf988ecaa5efc9779c05bcad>> */ /* @@ -4271,472 +4271,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) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; + 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 resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); + 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 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 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 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 +4536,6864 @@ __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) - ); - } - 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 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; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - 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( - '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.' + 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 ); - 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 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 - ); - 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 - ); - 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 - ); - 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 - ); - 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; - } - 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; - } - 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); - } - "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); - } - "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) - ); - 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 - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + "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]); } - 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; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - 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; - } - 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; + return newProps; + } + 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 pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); + } + 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 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); } - 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; + return hydrationDiffRootDEV; } - 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; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + 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 ); - 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; + 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); + } + 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; } - 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; + } + 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 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; + 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) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; + } + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; + } + 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." + )), + 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; } - 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." + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) ); - 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; } - 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); + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - 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 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 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 pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, fiber ); } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, 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 peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - 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 pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - 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 getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - 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 { - 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; - } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - 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 - ))); + function updateHookTypesDev() { + var hookName = currentHookNameInDev; 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"); + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - null !== props || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) ) { - 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 : "" - )); + 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 + ); } } - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return addendum; - } - 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 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 && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - name + "%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 ); - 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), + } + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), 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 + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName )); - "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 + } + 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 ); - instance.defaultProps && + nextDeps.length !== prevDeps.length && 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 + "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(", ") + "]" ); - "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) + 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 )); - "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 && + 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 = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.mode & ConcurrentMode) !== NoMode && error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name + "Internal React error: Expected static flag was missing. Please notify the React team." ); - "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 + 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." ); - (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 + 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); + } + 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; + } + didScheduleRenderPhaseUpdate = !1; + } + 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." + ); + 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.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; + 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.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 ( + 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, + 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)" ); - 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), + 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( - "%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 + "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 = 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 + (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 && + ((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( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - instance + 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 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 ); - 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 && + return nextSnapshot; + } + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + 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( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" + "The result of getSnapshot should be cached to avoid an infinite loop" ), - 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 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; - }; + (didWarnUncachedGetSnapshot = !0)); } - 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." + 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 ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + 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 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 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 defaultOnRecoverableError(error) { - reportGlobalError(error); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function logUncaughtError(root, errorInfo) { + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; 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; - }); + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error$3) { + return !0; } } - 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; - }); + 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); + } + } } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + 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 }; - return lane; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } - 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 updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); } - 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 rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload ) { - 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 - ); + 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); + } + 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 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; } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); + isMatching && (initialStateProp = ssrFormState[0]); } - 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 + 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 ); - 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 - ); + 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 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; } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; + 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 reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } - 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 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 updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + 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 ) { - 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 - ); + 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.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; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + 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 + ) { + if ( + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ) { + 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 updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function updateResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) + 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 ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + 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); + } } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= fiberFlags); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? hookFlags : HasEffect | hookFlags, + isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); } - 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 mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); } - 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 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; + } + ); + } + 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" + ); + 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 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 mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : 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 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 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 - ); - 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; + hook.memoizedState = [prevState, deps]; + return prevState; } - 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 + 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 ); - 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 + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) ); - 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)); + } 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." + )); } - current = finishClassComponent( - current, - workInProgress, - Component, - state, - _instance, - 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." + ); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } ); - 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 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 && + error$jscomp$0( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - 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); - } + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); + } + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + 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 + )); + } + 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; } - markComponentRenderStopped(); + provider = provider.return; } - 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 + function dispatchReducerAction( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p0 ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && + "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && error$jscomp$0( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + "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()." ); - "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() }; + 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 getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes + function dispatchSetState( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; + "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + 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); } - 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 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 + } + 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." + ); + 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 || + (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); + } + } + 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 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_message_2359 + break; + } + } + } + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + 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( + '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 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); + } } - 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 + 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 ); - } 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 + 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 ); - } 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; + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - 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( + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, current, - JSCompiler_object_inline_digest_2360, - renderLanes + element.props.children, + lanes, + element.key + )), + 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 + ); + 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; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2361 - ); - 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 + (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; + } + 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); } - ); - (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; - } - 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] - ) + "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 ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - 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 + 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 ); } - 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; + 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; } - 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 + 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); + } + "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) ); - 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; + 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; } - 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 + 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 ); - 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 ("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; + } + 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 "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); } - 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 knownKeys; } - 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 + 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 ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + 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 ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + 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 ); - 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) + 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; + } + 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 ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); - 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 + 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." ); - workInProgress.flags |= 128; + 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; } - 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 ("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 ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + (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 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; + 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; } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; - } - if (null !== current) + }; + } + 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) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current || - workInProgress.type !== current.type - ) - didReceiveUpdate = !0; - else { + (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 ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + 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; } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + 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; } - 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 null; + } + 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 ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + } + } + 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 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; + }); + } + } + 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 ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - 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 + "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 ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, + 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 - )), - 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 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + currentSourceFiber.tag + + "). This is a bug in React." ); - case 5: + } + if (1 === root.tag) 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 + 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 )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, + 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, - returnFiber, + current.child, + nextChildren, 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: + ); + } + 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 ( - pushHostContainer( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + Component, + nextProps, + renderLanes + ) ); - case 11: - return updateForwardRef( + 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, - workInProgress.type, - workInProgress.pendingProps, + nextProps, renderLanes ); - case 7: + } + 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 ( - reconcileChildren( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.pendingProps, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, renderLanes - ), - workInProgress.child + ) ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + } 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." ); - 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 + 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) ); - 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, + 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, - 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." + 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 ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, + (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, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + 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, - workInProgress.type, - workInProgress.pendingProps, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + ) + ); + 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, - workInProgress.type, - workInProgress.pendingProps, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, 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: + 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_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)); + } + 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) 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 + 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 ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + if ( + "number" === + typeof JSCompiler_object_inline_stack_2361.unstable_expectedLoadTime + ) 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 + 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 ); - 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." + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_message_2359 ); - 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; + 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; } - } 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." + 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 ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + queueHydrationError(JSCompiler_object_inline_stack_2361); + workInProgress = retrySuspenseComponentWithoutHydrating( + 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; + } 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; } - } - 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])); + 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 + ); + 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 } - parent = parent.return; - } + ); + (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 && - 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); + ((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; } - 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 mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); + 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 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 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 initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); } - 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 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 createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + 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 enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; 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); + 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 enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + (workInProgress.mode & ConcurrentMode) === NoMode && 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)); } - 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("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 processUpdateQueue( + 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, - 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))); + 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 + ); } - 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 (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 ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); + !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 && - (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; + "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 + ); } - 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; + 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; @@ -15760,7 +15752,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -23430,6 +23422,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 +23669,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 +23783,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 +23803,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -25099,82 +25181,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 @@ -25223,20 +25229,6 @@ __DEV__ && retryLane: 0 }, 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, @@ -25891,11 +25883,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-34ee3919-20241217" !== 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-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25932,10 +25924,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -26081,5 +26073,5 @@ __DEV__ && listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-34ee3919-20241217"; })(); 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..6e8b6c2c69b66 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<<3ce4685c4d100cff61246b33dd2513d1>> */ /* @@ -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,5148 @@ 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; + 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 createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -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 - ); +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 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 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; + } } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -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 currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -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$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +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 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 pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -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 getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -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 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 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 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 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 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 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); } - } - hook.memoizedState = [prevState, deps]; - return prevState; + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -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 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 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 checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -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 +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 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); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -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, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, + queue: null, 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; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -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 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(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); } - provider = provider.return; + 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 workInProgressHook; } -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 createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); +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 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 ( - 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 - ); +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); } - return !1; + throw Error(formatProdErrorMessage(438, String(usable))); } -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 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 isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -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 updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -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 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 = 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]; } -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 +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, + 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 ); - 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); - } - 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 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -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); + return getServerSnapshot; } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +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 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 updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(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 checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; +} +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 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; + 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 useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; +} +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 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; + 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 placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + 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 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; + 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 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; + (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 updatePortal(returnFiber, current, portal, lanes) { + 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; +} +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 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 - ); - 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) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) 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; + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - 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; +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); } -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 coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function defaultOnCaughtError(error) { - console.error(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 defaultOnRecoverableError(error) { - reportGlobalError(error); +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { - setTimeout(function () { - throw e$68; - }); +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 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 deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return 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 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 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; } - 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 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)); - } - 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; - } - } - nextInstance = JSCompiler_temp$jscomp$0; - } - 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); - } - 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, - 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 (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.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); -} -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 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 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((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; - } - 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 + 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 ); - 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; + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - 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: + 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 ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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; + 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 - (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, "")); - } + 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 workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 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 ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - init, - renderLanes - ) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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, + 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, - 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; + 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; } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); } - 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 + 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 + ); + } + 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 ); - 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 + 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) + ) { + 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; +} +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 defaultOnCaughtError(error) { + console.error(error); +} +function defaultOnRecoverableError(error) { + reportGlobalError(error); +} +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$74) { + setTimeout(function () { + throw e$74; + }); + } +} +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; + }); + } +} +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); + }; + } + 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 ); - 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 + 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 ), - 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: + 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) return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 ); - case 12: - return ( - reconcileChildren( - current, + 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, - workInProgress.pendingProps.children, + current.child, + nextChildren, renderLanes - ), - workInProgress.child - ); - case 10: + ); +} +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 ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - elementType.children, + type, + nextProps, 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 = 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, - workInProgress.type, - workInProgress.pendingProps, + nextProps, renderLanes ); - case 17: + } + 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 ( - (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, + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, + workInProgress, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, renderLanes ) ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + } 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, - 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, + 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.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; + 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)); } - 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; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); } -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); +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 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 }; +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 + }), + (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; + 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); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - + 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 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; +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; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + 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)); } -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); + 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 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 { @@ -11297,7 +11297,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 +11354,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()), @@ -11480,7 +11480,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11595,7 +11595,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$178); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11662,7 +11662,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -15867,14 +15867,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1722 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== + "19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion$jscomp$inline_1722 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1722, - "19.1.0-native-fb-d4287258-20241217" + "19.1.0-native-fb-34ee3919-20241217" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15896,10 +15896,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2177 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2178 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16005,4 +16005,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-34ee3919-20241217"; 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..a6a541711742c 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<> */ /* @@ -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,5198 @@ 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 - ); -} -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 - ))); + 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 mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -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); +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 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) + 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 ); - 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, - current.child, + 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, - 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); + 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 mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +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 getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -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 - }), - (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); +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) + } + 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 ( - 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 + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) + 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 ( - 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 + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; } - 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( + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, current, - workInProgress, - renderLanes + element.props.children, + lanes, + element.key ); - } 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 + 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 ); - } 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; + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; } - 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, + 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 )), - (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); -} -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 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 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 + (newChild.return = returnFiber), + newChild ); - 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 ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + throwOnInvalidObjectType(returnFiber, newChild); } - return workInProgress.child; -} -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - 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(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 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) + 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 ( - 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 + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) ); - 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 (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; } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + 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 ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + 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); } - 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 + 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 ); - 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); - } - workInProgress = workInProgress.child; + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return workInProgress; - case 26: + 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 ( - 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 + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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 + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx )), - 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 === 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 !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); + 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 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: + 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 ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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); -} -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; + 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 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; + 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)); } - list = dependency.next; + 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 + ) + ); } - } 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; + 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 + ); } - 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(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])); + 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); } - parent = parent.return; + 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); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + 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 { + } + }; } -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { +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 ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); +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 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 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); } -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 defaultOnCaughtError(error) { + console.error(error); } -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 defaultOnRecoverableError(error) { + reportGlobalError(error); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$76) { + setTimeout(function () { + throw e$76; + }); + } } -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; +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; + }); } - 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 createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return 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 - }; - 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 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); }; - workInProgress.updateQueue = queue; - return; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + 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 : "" + }); + }); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +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 processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, - renderLanes +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - 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))); - } - 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: { - 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 - (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; + 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 + ); + } + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + 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; } -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); +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 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 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 ( + (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 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 + ); + } + 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) + ); + 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, + 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, + 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; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + 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); + } + 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, + 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 (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 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 }; + 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 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 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && + 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(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; +} +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); + 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 (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 + ); + 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 + ); + 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; + } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -11833,7 +11833,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 +11890,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()), @@ -12056,7 +12056,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12179,7 +12179,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$193); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12264,7 +12264,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -16520,14 +16520,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== + "19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion$jscomp$inline_1812 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1812, - "19.1.0-native-fb-d4287258-20241217" + "19.1.0-native-fb-34ee3919-20241217" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16549,10 +16549,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_1819 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$292 = 0; @@ -16673,4 +16673,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-34ee3919-20241217"; 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..27885e4a3b84b 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<<343a6b404a717cb1221275fd09848a76>> */ /* @@ -4279,472 +4279,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) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; + 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 resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); + 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 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 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 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 +4544,6864 @@ __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) - ); - } - 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 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; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - 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( - '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.' + 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 ); - 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 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 - ); - 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 - ); - 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 - ); - 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 - ); - 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; - } - 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; - } - 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); - } - "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); - } - "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) - ); - 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 - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + "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]); } - 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; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - 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; - } - 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; + return newProps; + } + 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 pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); + } + 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 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); } - 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; + return hydrationDiffRootDEV; } - 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; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + 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 ); - 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; + 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); + } + 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; } - 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; + } + 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 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; + 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) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; + } + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; + } + 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." + )), + 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; } - 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." + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) ); - 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; } - 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); + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - 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 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 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 pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, fiber ); } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, 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 peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - 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 pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - 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 getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - 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 { - 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; - } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - 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 - ))); + function updateHookTypesDev() { + var hookName = currentHookNameInDev; 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"); + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); if ( - null !== props || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) ) { - 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 : "" - )); + 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 + ); } } - isLegacyContextConsumer && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return addendum; - } - 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 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 && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - name + "%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 ); - 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), + } + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), 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 + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName )); - "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 + } + 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 ); - instance.defaultProps && + nextDeps.length !== prevDeps.length && 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 + "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(", ") + "]" ); - "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) + 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 )); - "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 && + 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 = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.mode & ConcurrentMode) !== NoMode && error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name + "Internal React error: Expected static flag was missing. Please notify the React team." ); - "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 + 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." ); - (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 + 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); + } + 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; + } + didScheduleRenderPhaseUpdate = !1; + } + 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." + ); + 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.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; + 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.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 ( + 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, + 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)" ); - 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), + 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( - "%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 + "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 = 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 + (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 && + ((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( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - instance + 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 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 ); - 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 && + return nextSnapshot; + } + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + 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( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" + "The result of getSnapshot should be cached to avoid an infinite loop" ), - 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 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; - }; + (didWarnUncachedGetSnapshot = !0)); } - 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." + 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 ); - } finally { - enableOwnerStacks || - (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + 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 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 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 defaultOnRecoverableError(error) { - reportGlobalError(error); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function logUncaughtError(root, errorInfo) { + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; 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; - }); + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error$3) { + return !0; } } - 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; - }); + 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); + } + } } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + 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 }; - return lane; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } - 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 updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); } - 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 rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload ) { - 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 - ); + 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); + } + 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 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; } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); + isMatching && (initialStateProp = ssrFormState[0]); } - 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 + 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 ); - 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 - ); + 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 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; } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; + 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 reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } - 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 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 updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + 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 ) { - 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 - ); + 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.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; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + 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 + ) { + if ( + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ) { + 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 updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + function updateResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) + 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 ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) + null != destroy.resourceKind && + destroy.resourceKind === ResourceEffectUpdateKind ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + 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); + } } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= fiberFlags); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? hookFlags : HasEffect | hookFlags, + isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, + inst, + create, + createDeps, + update, + updateDeps ); } - 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 mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); } - 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 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; + } + ); + } + 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" + ); + 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 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 mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : 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 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 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 - ); - 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; + hook.memoizedState = [prevState, deps]; + return prevState; } - 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 + 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 ); - 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 + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) ); - 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)); + } 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." + )); } - current = finishClassComponent( - current, - workInProgress, - Component, - state, - _instance, - 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." + ); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } ); - 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 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 && + error$jscomp$0( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - 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); - } + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); + } + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + 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 + )); + } + 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; } - markComponentRenderStopped(); + provider = provider.return; } - 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 + function dispatchReducerAction( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p0 ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && + "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && error$jscomp$0( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + "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()." ); - "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() }; + 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 getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes + function dispatchSetState( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; + "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + 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); } - 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 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 + } + 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." + ); + 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 || + (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); + } + } + 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 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_message_2364 + break; + } + } + } + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + 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( + '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 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); + } } - 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 + 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 ); - } 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 + 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 ); - } 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; + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - 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( + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, current, - JSCompiler_object_inline_digest_2365, - renderLanes + element.props.children, + lanes, + element.key + )), + 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 + ); + 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; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2366 - ); - 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 + (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; + } + 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); } - ); - (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; - } - 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] - ) + "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 ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - 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 + 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 ); } - 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; + 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; } - 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 + 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); + } + "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) ); - 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; + 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; } - 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 + 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 ); - 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 ("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; + } + 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 "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); } - 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 knownKeys; } - 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 + 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 ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 1: - isContextProvider(workInProgress.type) && - pushContextProvider(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + 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 ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + 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 ); - 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) + 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; + } + 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 ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); - 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 + 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." ); - workInProgress.flags |= 128; + 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; } - 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 ("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 ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + (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 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; + 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; } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; - } - if (null !== current) + }; + } + 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) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current || - workInProgress.type !== current.type - ) - didReceiveUpdate = !0; - else { + (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 ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + 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; } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + 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; } - 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 null; + } + 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 ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + } finally { + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); + } + } + 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 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; + }); + } + } + 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 ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - 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 + "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 ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, + 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 - )), - 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 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + currentSourceFiber.tag + + "). This is a bug in React." ); - case 5: + } + if (1 === root.tag) 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 + 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 )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, + 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, - returnFiber, + current.child, + nextChildren, 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: + ); + } + 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 ( - pushHostContainer( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + Component, + nextProps, + renderLanes + ) ); - case 11: - return updateForwardRef( + 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, - workInProgress.type, - workInProgress.pendingProps, + nextProps, renderLanes ); - case 7: + } + 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 ( - reconcileChildren( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.pendingProps, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, renderLanes - ), - workInProgress.child + ) ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + } 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." ); - 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 + 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) ); - 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, + 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, - 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." + 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 ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, + (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, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, + 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, - workInProgress.type, - workInProgress.pendingProps, renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, + ) + ); + 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, - workInProgress.type, - workInProgress.pendingProps, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, 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: + 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_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)); + } + 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) 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 + 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 ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: + if ( + "number" === + typeof JSCompiler_object_inline_stack_2366.unstable_expectedLoadTime + ) 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 + 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 ); - 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." + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_message_2364 ); - 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; + 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; } - } 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." + 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 ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + queueHydrationError(JSCompiler_object_inline_stack_2366); + workInProgress = retrySuspenseComponentWithoutHydrating( + 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; + } 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; } - } - 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])); + 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 + ); + 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 } - parent = parent.return; - } + ); + (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 && - 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); + ((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; } - 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 mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen( + { mode: "visible", children: primaryChildren }, + workInProgress.mode, + 0, + null + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); + 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 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 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 initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); } - 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 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 createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + 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 enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; 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); + 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 enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + (workInProgress.mode & ConcurrentMode) === NoMode && 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)); } - 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("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 processUpdateQueue( + 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, - 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))); + 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 + ); } - 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 (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 ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); + !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 && - (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; + "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 + ); } - 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; + 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; @@ -15772,7 +15764,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -23491,6 +23483,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 +23730,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 +23844,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 +23864,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -25160,82 +25242,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 @@ -25284,20 +25290,6 @@ __DEV__ && retryLane: 0 }, 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, @@ -25952,11 +25944,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-34ee3919-20241217" !== 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-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25993,10 +25985,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -26458,7 +26450,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-34ee3919-20241217"; "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..f0fe2a844d00c 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<<69a847d74e147c198c7e587d0365fe6a>> */ /* @@ -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,5148 @@ 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; + 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 createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -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 - ); +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 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 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; + } } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -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 currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -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$1.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +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 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 pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -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 getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -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 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 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 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 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 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 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); } - } - hook.memoizedState = [prevState, deps]; - return prevState; + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -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 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 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 checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -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 +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 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); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -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, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, + queue: null, 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; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -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 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(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); } - provider = provider.return; + 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 workInProgressHook; } -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 createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane); +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 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 ( - 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 - ); +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); } - return !1; + throw Error(formatProdErrorMessage(438, String(usable))); } -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 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 isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -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 updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -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 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 = 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]; } -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 +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, + 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 ); - 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); - } - 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 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -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); + return getServerSnapshot; } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +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 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 updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(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 checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; +} +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 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; + 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 useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; +} +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 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; + 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 placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + 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 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; + 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 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; + (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 updatePortal(returnFiber, current, portal, lanes) { + 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; +} +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 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 - ); - 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) + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) 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; + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - 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; +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); } -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 coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function defaultOnCaughtError(error) { - console.error(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 defaultOnRecoverableError(error) { - reportGlobalError(error); +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { - setTimeout(function () { - throw e$68; - }); +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 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 deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return 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 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 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; } - 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 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)); - } - 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; - } - } - nextInstance = JSCompiler_temp$jscomp$0; - } - 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); - } - 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, - 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 (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.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); -} -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 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 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((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; - } - 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 + 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 ); - 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; + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - 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: + 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 ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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; + 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 - (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, "")); - } + 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 workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 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 ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - init, - renderLanes - ) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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, + 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, - 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; + 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; } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); } - 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 + 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 + ); + } + 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 ); - 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 + 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) + ) { + 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; +} +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 defaultOnCaughtError(error) { + console.error(error); +} +function defaultOnRecoverableError(error) { + reportGlobalError(error); +} +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$74) { + setTimeout(function () { + throw e$74; + }); + } +} +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; + }); + } +} +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); + }; + } + 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 ); - 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 + 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 ), - 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: + 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) return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 ); - case 12: - return ( - reconcileChildren( - current, + 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, - workInProgress.pendingProps.children, + current.child, + nextChildren, renderLanes - ), - workInProgress.child - ); - case 10: + ); +} +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 ( - (elementType = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, elementType.value), - reconcileChildren( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - elementType.children, + type, + nextProps, 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 = 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, - workInProgress.type, - workInProgress.pendingProps, + nextProps, renderLanes ); - case 17: + } + 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 ( - (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, + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, + workInProgress, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, renderLanes ) ); - case 28: - return ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, + } 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, - 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, + 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.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; + 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)); } - 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; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); } -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); +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 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 }; +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 + }), + (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; + 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); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - + 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 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; +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; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + 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)); } -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); + 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 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 { @@ -11297,7 +11297,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 +11354,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()), @@ -11480,7 +11480,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11595,7 +11595,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$178); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11662,7 +11662,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -15878,14 +15878,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1723 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== + "19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion$jscomp$inline_1723 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1723, - "19.1.0-native-fb-d4287258-20241217" + "19.1.0-native-fb-34ee3919-20241217" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15907,10 +15907,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2180 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2181 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16170,4 +16170,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-34ee3919-20241217"; 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..38fd951529b01 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<> */ /* @@ -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,5198 @@ 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 - ); -} -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 - ))); + 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 mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -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); +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 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) + 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 ); - 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, - current.child, + 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, - 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); + 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 mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +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 getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -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 - }), - (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); +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) + } + 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 ( - 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 + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) + 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 ( - 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 + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; } - 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( + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, current, - workInProgress, - renderLanes + element.props.children, + lanes, + element.key ); - } 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 + 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 ); - } 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; + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; } - 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, + 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 )), - (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); -} -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 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 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 + (newChild.return = returnFiber), + newChild ); - 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 ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; + throwOnInvalidObjectType(returnFiber, newChild); } - return workInProgress.child; -} -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - 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(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 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) + 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 ( - 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 + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) ); - 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 (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; } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { if ( - current.memoizedProps !== workInProgress.pendingProps || - didPerformWorkStackCursor.current + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + 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 ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + 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); } - 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 + 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 ); - 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); - } - workInProgress = workInProgress.child; + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return workInProgress; - case 26: + 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 ( - 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 + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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 + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx )), - 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 === 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 !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); + 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 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: + 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 ( - (elementType = workInProgress.type), - (init = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - init, - renderLanes - ) + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - 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); -} -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; + 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 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; + 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)); } - list = dependency.next; + 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 + ) + ); } - } 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; + 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 + ); } - 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(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])); + 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); } - parent = parent.return; + 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); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + 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 { + } + }; } -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { +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 ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); +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 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 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); } -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 defaultOnCaughtError(error) { + console.error(error); } -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 defaultOnRecoverableError(error) { + reportGlobalError(error); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$76) { + setTimeout(function () { + throw e$76; + }); + } } -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; +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; + }); } - 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 createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return 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 - }; - 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 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); }; - workInProgress.updateQueue = queue; - return; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + 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 : "" + }); + }); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +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 processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, - renderLanes +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - 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))); - } - 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: { - 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 - (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; + 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 + ); + } + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); + } + if (1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + 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; } -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); +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 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 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 ( + (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 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 + ); + } + 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) + ); + 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, + 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, + 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; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + 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); + } + 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, + 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 (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 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 }; + 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 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 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && + 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(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; +} +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); + 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 (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 + ); + 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 + ); + 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; + } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -11837,7 +11837,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 +11894,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()), @@ -12060,7 +12060,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12183,7 +12183,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$193); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12268,7 +12268,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -16535,14 +16535,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1813 = React.version; if ( - "19.1.0-native-fb-d4287258-20241217" !== + "19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion$jscomp$inline_1813 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1813, - "19.1.0-native-fb-d4287258-20241217" + "19.1.0-native-fb-34ee3919-20241217" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16564,10 +16564,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_1820 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$292 = 0; @@ -16842,7 +16842,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-34ee3919-20241217"; "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..b489a5e2f8b83 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,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4bd0706dcec5bbe3aed6192a633dde35>> + * @generated SignedSource<<1d2dcb1da8d83e774be01a8e02f58b6d>> */ "use strict"; @@ -1753,101 +1753,239 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { + 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; @@ -2160,92 +2298,323 @@ __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, - payload: queue.payload, - callback: null, + 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 }; null === newLast @@ -2464,183 +2833,63 @@ __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; - } - 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 - ); - } + !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) { @@ -2654,7 +2903,7 @@ __DEV__ && ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -2697,7 +2946,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -2708,9 +2957,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 +3017,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -2806,7 +3053,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -2841,7 +3088,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 +3116,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -2886,26 +3133,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 +3167,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -2934,7 +3181,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 +3202,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 +3221,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 +3269,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -3100,7 +3347,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 +3368,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 +3415,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 +3455,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -3260,10 +3507,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 +3568,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 +3585,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -3506,14 +3749,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 +3770,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3563,7 +3806,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 +3868,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 +3894,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 +3910,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 +3919,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 +3932,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 +3952,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -3765,7 +4008,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -3778,7 +4021,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 +4054,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 +4154,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -3926,7 +4169,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 +4241,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4040,7 +4283,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -4209,8 +4452,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) { @@ -7951,354 +8194,103 @@ __DEV__ && 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._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()." + ), + finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + 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 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 scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -11543,7 +11535,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -13554,9 +13546,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$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, @@ -13575,14 +13600,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 () {}, @@ -13800,6 +13827,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 +13848,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -15239,52 +15277,6 @@ __DEV__ && retryLane: 0 }, 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, @@ -15595,10 +15587,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15743,5 +15735,5 @@ __DEV__ && flushSyncWorkAcrossRoots_impl(0, !0)); } }; - exports.version = "19.1.0-native-fb-d4287258-20241217"; + exports.version = "19.1.0-native-fb-34ee3919-20241217"; })(); 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..ab70984c484bb 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"; @@ -926,89 +926,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue2 = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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$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$2(NormalPriority, function () { + cache.controller.abort(); + }); } var firstScheduledRoot = null, lastScheduledRoot = null, @@ -1201,50 +1334,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -1485,125 +1841,13 @@ function callCallback(callback, 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; - } -} -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." - ); + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0); @@ -1623,7 +1867,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -1652,7 +1896,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -1677,7 +1921,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 +1937,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 +1970,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 +1992,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 +2006,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 +2040,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -1810,7 +2054,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 +2075,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 +2094,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 +2139,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 +2160,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 +2179,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 +2200,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 +2210,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 +2246,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 +2283,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 +2408,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 +2472,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 +2491,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -2287,7 +2527,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 +2589,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 +2613,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 +2629,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 +2672,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 +2743,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 +2758,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 +2923,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 +3037,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -2810,11 +3050,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 +3063,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -2836,7 +3072,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 +3120,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -2895,7 +3131,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); }, useResourceEffect: function ( @@ -2906,7 +3142,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 +4188,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; } @@ -5734,250 +5970,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); workInProgress.flags & 16384 && @@ -8353,7 +8345,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 +8402,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()), @@ -8512,7 +8504,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -8627,7 +8619,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$129); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -8694,7 +8686,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -9755,10 +9747,10 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1381 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1382 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -9894,4 +9886,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-34ee3919-20241217"; 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..eec4db8848622 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<<532f4d4667c2437e554408bae6406eb2>> */ "use strict"; @@ -991,89 +991,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue2 = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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$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$2(NormalPriority, function () { + cache.controller.abort(); + }); } var now = Scheduler$1.unstable_now, commitStartTime = -0, @@ -1323,50 +1456,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -1607,125 +1963,13 @@ function callCallback(callback, 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; - } -} -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." - ); + 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 +1989,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -1774,7 +2018,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -1799,7 +2043,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 +2059,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 +2092,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 +2114,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 +2128,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 +2162,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -1932,7 +2176,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 +2197,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 +2216,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 +2261,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 +2282,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 +2301,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 +2322,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 +2332,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 +2368,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 +2405,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 +2530,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 +2594,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 +2613,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -2409,7 +2649,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 +2711,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 +2735,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 +2751,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 +2794,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 +2865,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 +2880,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 +3048,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 +3162,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -2935,11 +3175,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 +3188,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -2961,7 +3197,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 +3245,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -3020,7 +3256,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); }, useResourceEffect: function ( @@ -3031,7 +3267,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 +4318,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; } @@ -5903,250 +6139,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); workInProgress.flags & 16384 && @@ -8822,7 +8814,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 +8871,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()), @@ -9012,7 +9004,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -9129,7 +9121,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$142); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -9214,7 +9206,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -10324,10 +10316,10 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1194 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217", + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$146 = 0; @@ -10478,4 +10470,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-34ee3919-20241217"; 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..eb371ded7d7d2 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<<293ea55251e6a3f8d3965b196ae82180>> */ "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-34ee3919-20241217"; "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..42422958a3941 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<> */ "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-34ee3919-20241217"; 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..1d9da241bf4e7 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<<9f4abfa6c11e9cf10f3fe0d31aaeeabc>> */ "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-34ee3919-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && 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..f1b7f1341af0c 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 +34ee3919c39bc9b149462322713a9811db4b8498 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..ccd782dca1484 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<<471dde6f0de3836986d15241a8166a48>> */ "use strict"; @@ -2687,101 +2687,239 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { + 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,92 +3239,323 @@ __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, - payload: queue.payload, - callback: null, + 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 }; null === newLast @@ -3405,183 +3774,63 @@ __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; - } - 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 - ); - } + !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) { @@ -3595,7 +3844,7 @@ __DEV__ && ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -3638,7 +3887,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -3649,9 +3898,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 +3958,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -3747,7 +3994,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -3782,7 +4029,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 +4057,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -3827,26 +4074,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 +4108,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3875,7 +4122,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 +4143,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 +4162,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 +4210,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4041,7 +4288,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 +4309,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 +4356,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 +4396,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4201,10 +4448,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 +4509,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 +4526,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4447,14 +4690,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 +4711,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -4504,7 +4747,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 +4809,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 +4835,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 +4851,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 +4860,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 +4873,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 +4893,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -4706,7 +4949,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -4719,7 +4962,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 +4995,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 +5095,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -4867,7 +5110,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 +5182,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4981,7 +5224,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -5150,8 +5393,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) { @@ -8913,354 +9156,103 @@ __DEV__ && 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._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()." + ), + finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + 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 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 markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); @@ -12492,7 +12484,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15322,9 +15314,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 +15368,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 +15595,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 +15616,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -17023,52 +17061,6 @@ __DEV__ && retryLane: 0 }, 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, @@ -17468,10 +17460,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; 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..6971d596513df 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<<4cf130575f43dd0fbd60ae80844cf90c>> */ "use strict"; @@ -2174,89 +2174,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue2 = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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 firstScheduledRoot = null, lastScheduledRoot = null, @@ -2459,50 +2592,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -2741,127 +3097,15 @@ function callCallback(callback, context) { ); 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; - } -} -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." - ); +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); @@ -2881,7 +3125,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -2910,7 +3154,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -2935,7 +3179,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 +3195,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 +3228,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 +3250,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 +3264,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 +3298,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3068,7 +3312,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 +3333,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 +3352,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 +3397,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 +3418,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 +3437,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 +3458,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 +3468,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 +3504,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 +3541,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 +3666,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 +3730,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 +3749,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3545,7 +3785,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 +3847,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 +3871,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 +3887,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 +3903,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 +3945,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 +4016,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 +4031,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 +4196,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 +4311,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4084,7 +4324,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 +4337,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4106,7 +4346,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 +4394,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4165,7 +4405,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5205,9 +5445,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; } @@ -6981,250 +7221,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); } @@ -9636,7 +9632,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 +9689,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -9823,7 +9819,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -9938,7 +9934,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$135); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10005,7 +10001,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11097,10 +11093,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1210 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1210.rendererConfig = extraDevToolsConfig); 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..d2923eea524e7 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<<2475949145c515276e8b9a33a4a9ffa8>> */ "use strict"; @@ -2273,89 +2273,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue2 = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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, @@ -2615,50 +2748,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -2897,127 +3253,15 @@ function callCallback(callback, context) { ); 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; - } -} -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." - ); +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); @@ -3037,7 +3281,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3066,7 +3310,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3091,7 +3335,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 +3351,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 +3384,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 +3406,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 +3420,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 +3454,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3224,7 +3468,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 +3489,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 +3508,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 +3553,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 +3574,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 +3593,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 +3614,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 +3624,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 +3660,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 +3697,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 +3822,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 +3886,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 +3905,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3701,7 +3941,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 +4003,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 +4027,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 +4043,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 +4059,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 +4101,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 +4172,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 +4187,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 +4355,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 +4470,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4243,7 +4483,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 +4496,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4265,7 +4505,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 +4553,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4324,7 +4564,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5369,9 +5609,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; } @@ -7185,250 +7425,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function markCloned(workInProgress) { enablePersistedModeClonedFlag && (workInProgress.flags |= 8); } @@ -10164,7 +10160,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 +10217,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10391,7 +10387,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10514,7 +10510,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$150); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10599,7 +10595,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11754,10 +11750,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1298 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1298.rendererConfig = extraDevToolsConfig); 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..fffa012dbc95e 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<<254a5e1bf61bc266ea4932c326eabe24>> */ "use strict"; @@ -2922,101 +2922,239 @@ __DEV__ && )); return skipToNode + debugInfo + propName; } - function finishQueueingConcurrentUpdates() { + 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,92 +3468,323 @@ __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, - payload: queue.payload, - callback: null, + 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 }; null === newLast @@ -3634,183 +4003,63 @@ __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; - } - 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 - ); - } + !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) { @@ -3824,7 +4073,7 @@ __DEV__ && ); } function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); didWarnAboutUseFormState.has(componentName) || (didWarnAboutUseFormState.add(componentName), error$jscomp$0( @@ -3867,7 +4116,7 @@ __DEV__ && nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; hookTypesDev = null !== current ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -3878,9 +4127,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 +4187,7 @@ __DEV__ && currentHookNameInDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; null !== current && @@ -3976,7 +4223,7 @@ __DEV__ && ))); } function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); @@ -4011,7 +4258,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 +4286,7 @@ __DEV__ && hookTypesDev = workInProgressHook = currentHook = - currentlyRenderingFiber$1 = + currentlyRenderingFiber = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; @@ -4056,26 +4303,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 +4337,7 @@ __DEV__ && next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -4104,7 +4351,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 +4372,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 +4391,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 +4439,7 @@ __DEV__ && hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4270,7 +4517,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 +4538,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 +4585,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 +4625,7 @@ __DEV__ && return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber$1, + var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(); var nextSnapshot = getSnapshot(); if (!didWarnUncachedGetSnapshot) { @@ -4430,10 +4677,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 +4738,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 +4755,7 @@ __DEV__ && hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4676,14 +4919,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 +4940,7 @@ __DEV__ && stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -4733,7 +4976,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 +5038,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 +5064,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 +5080,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 +5089,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 +5102,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 +5122,7 @@ __DEV__ && } else (hookFlags = Passive), (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber$1.flags |= 8390656), + (currentlyRenderingFiber.flags |= 8390656), (inst = createEffectInstance()), (inst.destroy = destroy), (hook.memoizedState = pushResourceEffect( @@ -4935,7 +5178,7 @@ __DEV__ && } } (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber$1.flags |= fiberFlags); + (currentlyRenderingFiber.flags |= fiberFlags); hook.memoizedState = pushResourceEffect( isCreateDepsSame ? hookFlags : HasEffect | hookFlags, isUpdateDepsSame ? hookFlags : HasEffect | hookFlags, @@ -4948,7 +5191,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 +5224,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 +5324,7 @@ __DEV__ && return (hook.memoizedState = value); hook.memoizedState = initialValue; hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; + currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } @@ -5096,7 +5339,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 +5411,7 @@ __DEV__ && var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -5210,7 +5453,7 @@ __DEV__ && function mountRefresh() { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } function refreshCache(fiber, seedKey) { @@ -5379,8 +5622,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) { @@ -9142,354 +9385,103 @@ __DEV__ && 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; - } - 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()." + ), + finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + 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 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 scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); @@ -12855,7 +12847,7 @@ __DEV__ && return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15757,9 +15749,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 +15803,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 +16031,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 +16052,7 @@ __DEV__ && var ResourceEffectIdentityKind = 0, ResourceEffectUpdateKind = 1, renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -17459,52 +17497,6 @@ __DEV__ && retryLane: 0 }, 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, @@ -17691,11 +17683,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isomorphicReactPackageVersion = React.version; - if ("19.1.0-native-fb-d4287258-20241217" !== isomorphicReactPackageVersion) + if ("19.1.0-native-fb-34ee3919-20241217" !== 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-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -17721,10 +17713,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; 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..0c6d995c41946 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"; @@ -2478,89 +2478,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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 firstScheduledRoot = null, lastScheduledRoot = null, @@ -2754,50 +2887,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -3036,127 +3392,15 @@ function callCallback(callback, context) { ); 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; - } -} -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." - ); +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); @@ -3176,7 +3420,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3205,7 +3449,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3230,7 +3474,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 +3490,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 +3523,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 +3545,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 +3559,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 +3593,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3363,7 +3607,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 +3628,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 +3647,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 +3692,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 +3713,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 +3732,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 +3753,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 +3763,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 +3799,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 +3836,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 +3961,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 +4025,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 +4044,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3840,7 +4080,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 +4142,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 +4166,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 +4182,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 +4198,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 +4240,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 +4311,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 +4326,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 +4491,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 +4606,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4379,7 +4619,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 +4632,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4401,7 +4641,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 +4689,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4460,7 +4700,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5500,9 +5740,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; } @@ -7276,250 +7516,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); workInProgress.flags & 16384 && @@ -10070,7 +10066,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 +10123,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10257,7 +10253,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10372,7 +10368,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$139); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -10439,7 +10435,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11229,11 +11225,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-34ee3919-20241217" !== 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-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11282,10 +11278,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1276 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1276.rendererConfig = extraDevToolsConfig); 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..49f159a9d7550 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<<4476873260c0352d9a60e0832063bf3e>> */ "use strict"; @@ -2577,89 +2577,222 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = null)); } var hydrationErrors = null, - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { + 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, @@ -2910,50 +3043,273 @@ function entangleAsyncAction(transition, thenable) { 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 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; +} +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; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); +} +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 pingEngtangledActionScope() { +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - 0 === --currentEntangledPendingCount && - null !== currentEntangledListeners + 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; + ) { - 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])(); + 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 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 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) { @@ -3192,127 +3548,15 @@ function callCallback(callback, context) { ); 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; - } -} -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." - ); +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); @@ -3332,7 +3576,7 @@ function popHiddenContext() { pop(prevEntangledRenderLanesCursor); } var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -3361,7 +3605,7 @@ function renderWithHooks( nextRenderLanes ) { renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; + currentlyRenderingFiber = workInProgress; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = 0; @@ -3386,7 +3630,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 +3646,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 +3679,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 +3701,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 +3715,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 +3749,7 @@ function updateWorkInProgressHook() { next: null }; null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook) : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } @@ -3519,7 +3763,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 +3784,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 +3803,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 +3848,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 +3869,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 +3888,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 +3909,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 +3919,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 +3955,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 +3992,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 +4117,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 +4181,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 +4200,7 @@ function mountActionState(action, initialStateProp) { stateQueue.queue = actionQueue; stateHook = dispatchActionState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, actionQueue, setPendingState, stateHook @@ -3996,7 +4236,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 +4298,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 +4322,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 +4338,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 +4354,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 +4396,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 +4467,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 +4482,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 +4650,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 +4765,7 @@ var HooksDispatcherOnMount = { hook.queue = reducer; reducer = reducer.dispatch = dispatchReducerAction.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, reducer ); return [hook.memoizedState, reducer]; @@ -4538,7 +4778,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 +4791,7 @@ var HooksDispatcherOnMount = { var stateHook = mountStateImpl(!1); stateHook = startTransition.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, stateHook.queue, !0, !1 @@ -4560,7 +4800,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 +4848,7 @@ var HooksDispatcherOnMount = { hook.queue = queue; hook = dispatchOptimisticSetState.bind( null, - currentlyRenderingFiber$1, + currentlyRenderingFiber, !0, queue ); @@ -4619,7 +4859,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, - currentlyRenderingFiber$1 + currentlyRenderingFiber )); } }; @@ -5664,9 +5904,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; } @@ -7480,250 +7720,6 @@ function beginWork(current, workInProgress, renderLanes) { "). 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()." - ); - 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 }; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue && (workInProgress.flags |= 4); workInProgress.flags & 16384 && @@ -10597,7 +10593,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 +10650,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; if ( thrownValue === SuspenseException || @@ -10824,7 +10820,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -10947,7 +10943,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$154); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11032,7 +11028,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11885,11 +11881,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-34ee3919-20241217" !== 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-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11938,10 +11934,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1364 = { bundleType: 0, - version: "19.1.0-native-fb-d4287258-20241217", + version: "19.1.0-native-fb-34ee3919-20241217", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-native-fb-d4287258-20241217" + reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1364.rendererConfig = extraDevToolsConfig);