From a8f485b32942552e8d97f9b9591cbe584a9cbae7 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 4 Dec 2024 08:54:04 +0000 Subject: [PATCH] ncc-compiled --- .../cjs/react-dom-client.development.js | 7049 +++++++++-------- .../cjs/react-dom-client.production.js | 4953 ++++++------ .../cjs/react-dom-profiling.development.js | 7049 +++++++++-------- .../cjs/react-dom-profiling.profiling.js | 5470 +++++++------ ...t-dom-server-legacy.browser.development.js | 4 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 4 +- ...react-dom-server-legacy.node.production.js | 4 +- .../react-dom-server.browser.development.js | 8 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 8 +- .../cjs/react-dom-server.edge.development.js | 8 +- .../cjs/react-dom-server.edge.production.js | 8 +- .../cjs/react-dom-server.node.development.js | 8 +- .../cjs/react-dom-server.node.production.js | 8 +- .../react-dom-unstable_testing.development.js | 7049 +++++++++-------- .../react-dom-unstable_testing.production.js | 4953 ++++++------ .../cjs/react-dom.development.js | 2 +- .../cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../react-dom-experimental/package.json | 4 +- .../cjs/react-dom-client.development.js | 6350 +++++++-------- .../cjs/react-dom-client.production.js | 4835 +++++------ .../cjs/react-dom-profiling.development.js | 6350 +++++++-------- .../cjs/react-dom-profiling.profiling.js | 4848 ++++++------ ...t-dom-server-legacy.browser.development.js | 4 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 4 +- ...react-dom-server-legacy.node.production.js | 4 +- .../react-dom-server.browser.development.js | 8 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 8 +- .../cjs/react-dom-server.edge.development.js | 8 +- .../cjs/react-dom-server.edge.production.js | 8 +- .../cjs/react-dom-server.node.development.js | 8 +- .../cjs/react-dom-server.node.production.js | 8 +- .../react-dom/cjs/react-dom.development.js | 2 +- .../react-dom/cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../next/src/compiled/react-dom/package.json | 4 +- .../cjs/react.development.js | 3 +- .../cjs/react.production.js | 3 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/react-is/package.json | 2 +- ...om-turbopack-client.browser.development.js | 6 +- ...dom-turbopack-client.browser.production.js | 2 +- ...r-dom-turbopack-client.edge.development.js | 2 +- ...er-dom-turbopack-client.edge.production.js | 2 +- ...r-dom-turbopack-client.node.development.js | 2 +- ...er-dom-turbopack-client.node.production.js | 2 +- ...om-turbopack-server.browser.development.js | 2 +- ...dom-turbopack-server.browser.production.js | 2 +- ...r-dom-turbopack-server.edge.development.js | 2 +- ...er-dom-turbopack-server.edge.production.js | 2 +- ...r-dom-turbopack-server.node.development.js | 2 +- ...er-dom-turbopack-server.node.production.js | 2 +- .../package.json | 4 +- ...om-turbopack-client.browser.development.js | 6 +- ...dom-turbopack-client.browser.production.js | 2 +- ...r-dom-turbopack-client.edge.development.js | 2 +- ...er-dom-turbopack-client.edge.production.js | 2 +- ...r-dom-turbopack-client.node.development.js | 2 +- ...er-dom-turbopack-client.node.production.js | 2 +- ...om-turbopack-server.browser.development.js | 2 +- ...dom-turbopack-server.browser.production.js | 2 +- ...r-dom-turbopack-server.edge.development.js | 2 +- ...er-dom-turbopack-server.edge.production.js | 2 +- ...r-dom-turbopack-server.node.development.js | 2 +- ...er-dom-turbopack-server.node.production.js | 2 +- .../react-server-dom-turbopack/package.json | 4 +- ...-dom-webpack-client.browser.development.js | 6 +- ...r-dom-webpack-client.browser.production.js | 2 +- ...ver-dom-webpack-client.edge.development.js | 2 +- ...rver-dom-webpack-client.edge.production.js | 2 +- ...ver-dom-webpack-client.node.development.js | 2 +- ...rver-dom-webpack-client.node.production.js | 2 +- ...bpack-client.node.unbundled.development.js | 2 +- ...ebpack-client.node.unbundled.production.js | 2 +- ...-dom-webpack-server.browser.development.js | 2 +- ...r-dom-webpack-server.browser.production.js | 2 +- ...ver-dom-webpack-server.edge.development.js | 2 +- ...rver-dom-webpack-server.edge.production.js | 2 +- ...ver-dom-webpack-server.node.development.js | 2 +- ...rver-dom-webpack-server.node.production.js | 2 +- ...bpack-server.node.unbundled.development.js | 2 +- ...ebpack-server.node.unbundled.production.js | 2 +- .../package.json | 4 +- ...-dom-webpack-client.browser.development.js | 6 +- ...r-dom-webpack-client.browser.production.js | 2 +- ...ver-dom-webpack-client.edge.development.js | 2 +- ...rver-dom-webpack-client.edge.production.js | 2 +- ...ver-dom-webpack-client.node.development.js | 2 +- ...rver-dom-webpack-client.node.production.js | 2 +- ...bpack-client.node.unbundled.development.js | 2 +- ...ebpack-client.node.unbundled.production.js | 2 +- ...-dom-webpack-server.browser.development.js | 2 +- ...r-dom-webpack-server.browser.production.js | 2 +- ...ver-dom-webpack-server.edge.development.js | 2 +- ...rver-dom-webpack-server.edge.production.js | 2 +- ...ver-dom-webpack-server.node.development.js | 2 +- ...rver-dom-webpack-server.node.production.js | 2 +- ...bpack-server.node.unbundled.development.js | 2 +- ...ebpack-server.node.unbundled.production.js | 2 +- .../react-server-dom-webpack/package.json | 4 +- .../compiled/react/cjs/react.development.js | 2 +- .../compiled/react/cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/unistore/unistore.js | 2 +- 112 files changed, 30157 insertions(+), 29075 deletions(-) diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 3578695bbb18f..d293c691e51b1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -76,6 +76,7 @@ function createFiber(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function warnForMissingKey() {} function warnInvalidHookAccess() { console.error( "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks" @@ -87,7 +88,6 @@ ); } function noop$2() {} - function warnForMissingKey() {} function setToSortedString(set) { var array = []; set.forEach(function (value) { @@ -1247,17 +1247,6 @@ lanes &= ~root; } } - function getGroupNameOfHighestPriorityLane(lanes) { - return lanes & 63 - ? "Blocking" - : lanes & 4194240 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; - } function lanesToEventPriority(lanes) { lanes &= -lanes; return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes @@ -3780,6 +3769,18 @@ topLevelEventsToReactNames.set(domEventName, reactName); registerTwoPhaseEvent(reactName, [domEventName]); } + function setCurrentTrackFromLanes(lanes) { + reusableLaneDevToolDetails.track = + lanes & 63 + ? "Blocking" + : lanes & 4194240 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; + } function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -3803,6 +3804,27 @@ (reusableLaneOptions.end = endTime), performance.measure("Render", reusableLaneOptions)); } + function logSuspendedRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "primary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime), + performance.measure("Prewarm", reusableLaneOptions)); + } + function logSuspendedWithDelayPhase(startTime, endTime) { + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "primary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime), + performance.measure("Suspended", reusableLaneOptions)); + } + function logErroredRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "error"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime), + performance.measure("Errored Render", reusableLaneOptions)); + } function logSuspenseThrottlePhase(startTime, endTime) { supportsUserTiming && ((reusableLaneDevToolDetails.color = "secondary-light"), @@ -4045,27 +4067,34 @@ var JSCompiler_temp; (JSCompiler_temp = 0 !== (lane & 3)) || (JSCompiler_temp = 0 !== (lane & 60)); - JSCompiler_temp - ? 0 > blockingUpdateTime && - ((blockingUpdateTime = now()), - (lane = resolveEventTimeStamp()), - (JSCompiler_temp = resolveEventType()), - (blockingEventIsRepeat = - lane === blockingEventTime && - JSCompiler_temp === blockingEventType), - (blockingEventTime = lane), - (blockingEventType = JSCompiler_temp)) - : 0 !== (lane & 4194176) && - 0 > transitionUpdateTime && - ((transitionUpdateTime = now()), - 0 > transitionStartTime && - ((lane = resolveEventTimeStamp()), - (JSCompiler_temp = resolveEventType()), - (transitionEventIsRepeat = - lane === transitionEventTime && - JSCompiler_temp === transitionEventType), - (transitionEventTime = lane), - (transitionEventType = JSCompiler_temp))); + if (JSCompiler_temp) { + if (0 > blockingUpdateTime) { + blockingUpdateTime = now(); + lane = resolveEventTimeStamp(); + JSCompiler_temp = resolveEventType(); + if ( + lane !== blockingEventTime || + JSCompiler_temp !== blockingEventType + ) + blockingEventIsRepeat = !1; + blockingEventTime = lane; + blockingEventType = JSCompiler_temp; + } + } else if ( + 0 !== (lane & 4194176) && + 0 > transitionUpdateTime && + ((transitionUpdateTime = now()), 0 > transitionStartTime) + ) { + lane = resolveEventTimeStamp(); + JSCompiler_temp = resolveEventType(); + if ( + lane !== transitionEventTime || + JSCompiler_temp !== transitionEventType + ) + transitionEventIsRepeat = !1; + transitionEventTime = lane; + transitionEventType = JSCompiler_temp; + } } function pushNestedEffectDurations() { var prevEffectDuration = profilerEffectDuration; @@ -4535,2984 +4564,2997 @@ return thenable; } function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if (rejectedReason === SuspenseException) + 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 pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - 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) { - console.error( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key + function retainCache(cache) { + cache.controller.signal.aborted && + console.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 && + console.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 && + (-1 < transitionUpdateTime || (transitionStartTime = -1.1), + null !== currentEntangledListeners) + ) { + null !== currentEntangledActionThenable && + (currentEntangledActionThenable.status = "fulfilled"); + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = 0; + currentEntangledActionThenable = null; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); + } + } + function chainThenableValue(thenable, result) { + var listeners = [], + thenableWithOverride = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + listeners.push(resolve); + } + }; + thenable.then( + function () { + thenableWithOverride.status = "fulfilled"; + thenableWithOverride.value = result; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); + }, + function (error) { + thenableWithOverride.status = "rejected"; + thenableWithOverride.reason = error; + for (error = 0; error < listeners.length; error++) + (0, listeners[error])(void 0); + } + ); + return thenableWithOverride; + } + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + } + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); + } + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); + } + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; + } + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + } + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber( + currentlyRenderingFiber$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; + } + console.error( + "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 ); - break; } } } - function unwrapThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - return trackUsedThenable(thenableState$1, thenable, index); + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || + console.error( + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps + ); } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), + console.error( + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); } - 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); + function throwInvalidHookError() { 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." + "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 warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? console.error( - "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 - ) - : console.error( - "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 areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + console.error( + "%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 && + console.error( + "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 warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? console.error( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : console.error( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + 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), + console.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." )); - } - 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), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { + setIsStrictModeForDevtools(!0); + try { + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } finally { + setIsStrictModeForDevtools(!1); + } } - 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 + 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) && + console.error( + "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), + console.error( + "`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." ); - 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; + 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; } - 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; + 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); } - 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), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + return workInProgressHook; + } + 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); } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + 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; + 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++ ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + console.error( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size ); - if ("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; + 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); } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (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; + } 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 && + console.error( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + ); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = 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 - ); - } + 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 ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane ) { - 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) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - 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; + 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); + } 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$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; } - 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 () { - console.error( - "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; + 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)" + ); + 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 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 + return [newState, dispatch]; + } + 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." ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (console.error( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (console.error( + "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." ); - 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 + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; + } + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var 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." ); - 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; + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes + 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) ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - newChildren !== newChildrenIterable || - (0 === returnFiber.tag && - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(returnFiber.type) && - "[object AsyncGenerator]" === - Object.prototype.toString.call(newChildren)) || - (didWarnAboutGenerators || - console.error( - "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0)); - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes + 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); } - 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; + 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 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); } - 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 - ); - 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; + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; + } + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind( + null, + currentlyRenderingFiber$1, + queue + ); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$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(); + 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), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + console.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." + )); } - 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; + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$3) { + onActionError(actionQueue, node, error$3); + } + } + 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 || + console.error( + "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); } - 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), - (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; + 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$1; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; - ) { - 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; + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; + 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; } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - console.error( - "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 || - (console.error( - "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; + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - 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); + isMatching && (initialStateProp = ssrFormState[0]); } - 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), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; + 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 { - thenableIndexCounter$1 = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState$1 = null; - return firstChildFiber; + var state = useThenable(currentStateHook); } catch (x) { - if (x === SuspenseException) 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; - 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]; - fiber._debugTask = debugInfo[i].debugTask; - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; + 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 pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); + 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 popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber$1.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; } - 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 createEffectInstance() { + return { destroy: void 0, resource: void 0 }; } - 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 mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber + 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 popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); - } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - state.data === SUSPENSE_FALLBACK_START_DATA) - ) - 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 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 createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 + 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 useEffectEventImpl(payload) { + currentlyRenderingFiber$1.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); + } + } + function mountEvent(callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." + ); + return ref.impl.apply(void 0, arguments); }; } - function retainCache(cache) { - cache.controller.signal.aborted && - console.warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; + function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." + ); + return ref.impl.apply(void 0, arguments); + }; } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - console.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 mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); } - 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); - } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); }; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; - } - function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - (-1 < transitionUpdateTime || (transitionStartTime = -1.1), - 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); + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || + console.error( + "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; } - }; - thenable.then( - function () { - thenableWithOverride.status = "fulfilled"; - thenableWithOverride.value = result; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); - }, - function (error) { - thenableWithOverride.status = "rejected"; - thenableWithOverride.reason = error; - for (error = 0; error < listeners.length; error++) - (0, listeners[error])(void 0); - } - ); - return thenableWithOverride; - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; - } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); - } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; - } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; - if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) - ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$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; - } - console.error( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } - } } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && console.error( - "%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 + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); - } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - console.error( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); - } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + 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 areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - console.error( - "%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 && + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && console.error( - "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(", ") + "]" + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); } - function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes - ) { - 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), - console.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." - )); - 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) { + 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 { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState - }) - : (workInProgress.dependencies._debugThenableState = thenableState); - 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) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter = 0; - thenableState = 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), - console.error( - "`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." - ))); + hook.memoizedState = [nextValue, deps]; + return nextValue; } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); - thenableIndexCounter = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); + function 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); } - 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; + } + hook.memoizedState = [prevState, deps]; + return prevState; } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); } - 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 updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); } - 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 = localIdCounter = 0; - thenableState = null; + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); } - 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 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 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 useThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - thenable = trackUsedThenable(thenableState, 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 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 useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.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 && - console.error( - "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 + 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 ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + 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), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + console.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 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 + 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); + } ); - return [hook.memoizedState, reducer]; } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); + 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 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)" + function requestFormReset$1(formFiber) { + null === ReactSharedInternals.T && + console.error( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - 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 && - console.error( - "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$1.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$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 === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber$1, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); + 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) { - 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() || - (console.error( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (console.error( - "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; - pushEffect( - HasEffect | Passive, - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - { destroy: void 0 }, - null - ); - return nextSnapshot; + 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 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) || - (console.error( - "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; - pushEffect( - HasEffect | Passive, - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - { destroy: void 0 }, - 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 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 mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber$1 + )); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; + function refreshCache(fiber, seedKey, seedValue) { + 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 && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; } } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function dispatchReducerAction( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p0 + ) { + "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && + console.error( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); + action = { + lane: JSCompiler_OptimizeArgumentsArray_p0, + 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 && + (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), + scheduleUpdateOnFiber( + action, + fiber, + JSCompiler_OptimizeArgumentsArray_p0 + ), + entangleTransitionUpdate( + action, + queue, + JSCompiler_OptimizeArgumentsArray_p0 + ))); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); + function dispatchSetState( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 + ) { + "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && + console.error( + "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 + ) && startUpdateTimerByLane(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 { - initialStateInitializer(); + 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 { - setIsStrictModeForDevtools(!1); + ReactSharedInternals.H = prevDispatcher; } } + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; + return !1; } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action + ) { + null === ReactSharedInternals.T && + 0 === currentEntangledLane && + console.error( + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - 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); + 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."); + console.error("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber$1 || + (null !== alternate && alternate === currentlyRenderingFiber$1) ); } - 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 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 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 entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } } - 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) { - onActionError(actionQueue, node, error); - } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - console.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$3) { - onActionError(actionQueue, node, error$3); - } + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); + 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) { + console.error( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey + ); }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "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); + key + ); + break; + } + } } - 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 unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); } - 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 coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + 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 actionStateReducer(oldState, newState) { - return newState; + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? console.error( + "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 + ) + : console.error( + "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 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]); + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? console.error( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : console.error( + "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); } } - 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]; - currentStateHook = - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ? useThenable(currentStateHook) - : currentStateHook; - var actionQueueHook = updateWorkInProgressHook(), - actionQueue = actionQueueHook.queue, - dispatch = actionQueue.dispatch; - action !== actionQueueHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushEffect( - HasEffect | Passive, - actionStateActionEffect.bind(null, actionQueue, action), - { destroy: void 0 }, - null - )); - return [currentStateHook, 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 pushEffect(tag, create, inst, deps) { - tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; - create = currentlyRenderingFiber$1.updateQueue; - null === create && - ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create)); - inst = create.lastEffect; - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag)); - return tag; - } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushEffect( - HasEffect | hookFlags, - create, - { destroy: void 0 }, - void 0 === deps ? null : 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 = pushEffect(hookFlags, create, inst, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushEffect( - HasEffect | hookFlags, - create, - inst, - 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 useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } - } - function mountEvent(callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - 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); - }; + 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; } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - console.error( - "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 && - console.error( - "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$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && - console.error( - "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 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); - } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; } - 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); - } + 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; } - 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 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), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; - } - function 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 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); + 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), + (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), + (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) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (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) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) { + 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) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + console.error( + "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + 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 reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + newChildren !== newChildrenIterable || + (0 === returnFiber.tag && + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(returnFiber.type) && + "[object AsyncGenerator]" === + Object.prototype.toString.call(newChildren)) || + (didWarnAboutGenerators || + console.error( + "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0)); + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + 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 + ); + 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), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); + } + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes + ); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + } + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + console.error( + "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 || + (console.error( + "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[ASYNC_ITERATOR]) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + 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 ( - 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) + ("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), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - console.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" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); } - } - 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); - } - ); - } - 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 && - console.error( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." - ); - 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, seedValue) { - 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 && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; + 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) 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; + 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]; + fiber._debugTask = debugInfo[i].debugTask; + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && - console.error( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." - ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - 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 && - (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), - scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && - console.error( - "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 - ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1); + 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 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; + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) ) { - 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) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); } - 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 && - console.error( - "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."); - console.error("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); + } else reuseSuspenseHandlerOnStack(fiber); } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber ); } - 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 popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); } - 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 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 || + state.data === SUSPENSE_FALLBACK_START_DATA) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } + return null; } function warnOnInvalidCallback(callback) { if (null !== callback && "function" !== typeof callback) { @@ -8937,33 +8979,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2309; - var JSCompiler_object_inline_stack_2308 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2337; + var JSCompiler_object_inline_stack_2336 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2306 = !1; + var JSCompiler_object_inline_message_2334 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2309 = didSuspend) || - (JSCompiler_object_inline_componentStack_2309 = + (JSCompiler_object_inline_componentStack_2337 = didSuspend) || + (JSCompiler_object_inline_componentStack_2337 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2309 && - ((JSCompiler_object_inline_message_2306 = !0), + JSCompiler_object_inline_componentStack_2337 && + ((JSCompiler_object_inline_message_2334 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2309 = + JSCompiler_object_inline_componentStack_2337 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2306 + JSCompiler_object_inline_message_2334 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2307 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2335 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2307)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2335)) { c: { - var instance = JSCompiler_object_inline_digest_2307; + var instance = JSCompiler_object_inline_digest_2335; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9004,19 +9046,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2307 + JSCompiler_object_inline_digest_2335 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2307 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2335 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2307 && - ((JSCompiler_object_inline_digest_2307 = - JSCompiler_object_inline_digest_2307.dehydrated), - null !== JSCompiler_object_inline_digest_2307) + null !== JSCompiler_object_inline_digest_2335 && + ((JSCompiler_object_inline_digest_2335 = + JSCompiler_object_inline_digest_2335.dehydrated), + null !== JSCompiler_object_inline_digest_2335) ) return ( - JSCompiler_object_inline_digest_2307.data === + JSCompiler_object_inline_digest_2335.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -9024,68 +9066,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2307 = - JSCompiler_object_inline_stack_2308.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2308.fallback; - if (JSCompiler_object_inline_message_2306) + JSCompiler_object_inline_digest_2335 = + JSCompiler_object_inline_stack_2336.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2336.fallback; + if (JSCompiler_object_inline_message_2334) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2308 = + (JSCompiler_object_inline_stack_2336 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2307, + JSCompiler_object_inline_digest_2335, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2306 = workInProgress.child), - (JSCompiler_object_inline_message_2306.memoizedState = + (JSCompiler_object_inline_message_2334 = workInProgress.child), + (JSCompiler_object_inline_message_2334.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2306.childLanes = + (JSCompiler_object_inline_message_2334.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2309, + JSCompiler_object_inline_componentStack_2337, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2308 + JSCompiler_object_inline_stack_2336 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2308.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2336.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2308 = + (JSCompiler_object_inline_stack_2336 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2307, + JSCompiler_object_inline_digest_2335, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2306 = workInProgress.child), - (JSCompiler_object_inline_message_2306.memoizedState = + (JSCompiler_object_inline_message_2334 = workInProgress.child), + (JSCompiler_object_inline_message_2334.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2306.childLanes = + (JSCompiler_object_inline_message_2334.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2309, + JSCompiler_object_inline_componentStack_2337, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2308 + JSCompiler_object_inline_stack_2336 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2307 + JSCompiler_object_inline_digest_2335 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2307 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2307) + ((JSCompiler_object_inline_digest_2335 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2335) ) { if (didSuspend) workInProgress.flags & 256 @@ -9102,95 +9144,95 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2306 = - JSCompiler_object_inline_stack_2308.fallback), - (JSCompiler_object_inline_digest_2307 = workInProgress.mode), - (JSCompiler_object_inline_stack_2308 = + (JSCompiler_object_inline_message_2334 = + JSCompiler_object_inline_stack_2336.fallback), + (JSCompiler_object_inline_digest_2335 = workInProgress.mode), + (JSCompiler_object_inline_stack_2336 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2308.children + children: JSCompiler_object_inline_stack_2336.children }, - JSCompiler_object_inline_digest_2307 + JSCompiler_object_inline_digest_2335 )), - (JSCompiler_object_inline_message_2306 = + (JSCompiler_object_inline_message_2334 = createFiberFromFragment( - JSCompiler_object_inline_message_2306, - JSCompiler_object_inline_digest_2307, + JSCompiler_object_inline_message_2334, + JSCompiler_object_inline_digest_2335, renderLanes, null )), - (JSCompiler_object_inline_message_2306.flags |= 2), - (JSCompiler_object_inline_stack_2308.return = workInProgress), - (JSCompiler_object_inline_message_2306.return = workInProgress), - (JSCompiler_object_inline_stack_2308.sibling = - JSCompiler_object_inline_message_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2308), + (JSCompiler_object_inline_message_2334.flags |= 2), + (JSCompiler_object_inline_stack_2336.return = workInProgress), + (JSCompiler_object_inline_message_2334.return = workInProgress), + (JSCompiler_object_inline_stack_2336.sibling = + JSCompiler_object_inline_message_2334), + (workInProgress.child = JSCompiler_object_inline_stack_2336), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2308 = workInProgress.child), - (JSCompiler_object_inline_stack_2308.memoizedState = + (JSCompiler_object_inline_stack_2336 = workInProgress.child), + (JSCompiler_object_inline_stack_2336.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2308.childLanes = + (JSCompiler_object_inline_stack_2336.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2309, + JSCompiler_object_inline_componentStack_2337, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2306)); + (workInProgress = JSCompiler_object_inline_message_2334)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2307.data === + JSCompiler_object_inline_digest_2335.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2309 = - JSCompiler_object_inline_digest_2307.nextSibling && - JSCompiler_object_inline_digest_2307.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2309) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2309.dgst; - var message = JSCompiler_object_inline_componentStack_2309.msg; - instance = JSCompiler_object_inline_componentStack_2309.stck; + JSCompiler_object_inline_componentStack_2337 = + JSCompiler_object_inline_digest_2335.nextSibling && + JSCompiler_object_inline_digest_2335.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2337) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2337.dgst; + var message = JSCompiler_object_inline_componentStack_2337.msg; + instance = JSCompiler_object_inline_componentStack_2337.stck; var componentStack = - JSCompiler_object_inline_componentStack_2309.cstck; + JSCompiler_object_inline_componentStack_2337.cstck; } - JSCompiler_object_inline_message_2306 = message; - JSCompiler_object_inline_digest_2307 = JSCompiler_temp; - JSCompiler_object_inline_stack_2308 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2309 = + JSCompiler_object_inline_message_2334 = message; + JSCompiler_object_inline_digest_2335 = JSCompiler_temp; + JSCompiler_object_inline_stack_2336 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2337 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2307 && - ((JSCompiler_object_inline_componentStack_2309 = - JSCompiler_object_inline_message_2306 - ? Error(JSCompiler_object_inline_message_2306) + "POSTPONE" !== JSCompiler_object_inline_digest_2335 && + ((JSCompiler_object_inline_componentStack_2337 = + JSCompiler_object_inline_message_2334 + ? Error(JSCompiler_object_inline_message_2334) : 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_2309.stack = - JSCompiler_object_inline_stack_2308 || ""), - (JSCompiler_object_inline_componentStack_2309.digest = - JSCompiler_object_inline_digest_2307), - (JSCompiler_object_inline_stack_2308 = + (JSCompiler_object_inline_componentStack_2337.stack = + JSCompiler_object_inline_stack_2336 || ""), + (JSCompiler_object_inline_componentStack_2337.digest = + JSCompiler_object_inline_digest_2335), + (JSCompiler_object_inline_stack_2336 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2306 = { - value: JSCompiler_object_inline_componentStack_2309, + (JSCompiler_object_inline_message_2334 = { + value: JSCompiler_object_inline_componentStack_2337, source: null, - stack: JSCompiler_object_inline_stack_2308 + stack: JSCompiler_object_inline_stack_2336 }), - "string" === typeof JSCompiler_object_inline_stack_2308 && + "string" === typeof JSCompiler_object_inline_stack_2336 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2309, - JSCompiler_object_inline_message_2306 + JSCompiler_object_inline_componentStack_2337, + JSCompiler_object_inline_message_2334 ), - queueHydrationError(JSCompiler_object_inline_message_2306)); + queueHydrationError(JSCompiler_object_inline_message_2334)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9204,25 +9246,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2309 = + (JSCompiler_object_inline_componentStack_2337 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2309) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2337) ) { - JSCompiler_object_inline_componentStack_2309 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2309) { - JSCompiler_object_inline_stack_2308 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2308 & 42)) - JSCompiler_object_inline_stack_2308 = 1; + JSCompiler_object_inline_componentStack_2337 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2337) { + JSCompiler_object_inline_stack_2336 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2336 & 42)) + JSCompiler_object_inline_stack_2336 = 1; else - switch (JSCompiler_object_inline_stack_2308) { + switch (JSCompiler_object_inline_stack_2336) { case 2: - JSCompiler_object_inline_stack_2308 = 1; + JSCompiler_object_inline_stack_2336 = 1; break; case 8: - JSCompiler_object_inline_stack_2308 = 4; + JSCompiler_object_inline_stack_2336 = 4; break; case 32: - JSCompiler_object_inline_stack_2308 = 16; + JSCompiler_object_inline_stack_2336 = 16; break; case 128: case 256: @@ -9243,40 +9285,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2308 = 64; + JSCompiler_object_inline_stack_2336 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2308 = 134217728; + JSCompiler_object_inline_stack_2336 = 134217728; break; default: - JSCompiler_object_inline_stack_2308 = 0; + JSCompiler_object_inline_stack_2336 = 0; } - JSCompiler_object_inline_stack_2308 = + JSCompiler_object_inline_stack_2336 = 0 !== - (JSCompiler_object_inline_stack_2308 & - (JSCompiler_object_inline_componentStack_2309.suspendedLanes | + (JSCompiler_object_inline_stack_2336 & + (JSCompiler_object_inline_componentStack_2337.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2308; + : JSCompiler_object_inline_stack_2336; if ( - 0 !== JSCompiler_object_inline_stack_2308 && - JSCompiler_object_inline_stack_2308 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2336 && + JSCompiler_object_inline_stack_2336 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2308), + ((prevState.retryLane = JSCompiler_object_inline_stack_2336), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2308 + JSCompiler_object_inline_stack_2336 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2309, + JSCompiler_object_inline_componentStack_2337, current, - JSCompiler_object_inline_stack_2308 + JSCompiler_object_inline_stack_2336 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2307.data === + JSCompiler_object_inline_digest_2335.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9284,7 +9326,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2307.data === + JSCompiler_object_inline_digest_2335.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9292,12 +9334,12 @@ null, current )), - (JSCompiler_object_inline_digest_2307._reactRetry = + (JSCompiler_object_inline_digest_2335._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2307.nextSibling + JSCompiler_object_inline_digest_2335.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9315,54 +9357,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2308.children + JSCompiler_object_inline_stack_2336.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2306) + if (JSCompiler_object_inline_message_2334) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2306 = - JSCompiler_object_inline_stack_2308.fallback), - (JSCompiler_object_inline_digest_2307 = workInProgress.mode), + (JSCompiler_object_inline_message_2334 = + JSCompiler_object_inline_stack_2336.fallback), + (JSCompiler_object_inline_digest_2335 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2308 = createWorkInProgress( + (JSCompiler_object_inline_stack_2336 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2308.children + children: JSCompiler_object_inline_stack_2336.children } )), - (JSCompiler_object_inline_stack_2308.subtreeFlags = + (JSCompiler_object_inline_stack_2336.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2306 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2334 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2306 + JSCompiler_object_inline_message_2334 )) - : ((JSCompiler_object_inline_message_2306 = createFiberFromFragment( - JSCompiler_object_inline_message_2306, - JSCompiler_object_inline_digest_2307, + : ((JSCompiler_object_inline_message_2334 = createFiberFromFragment( + JSCompiler_object_inline_message_2334, + JSCompiler_object_inline_digest_2335, renderLanes, null )), - (JSCompiler_object_inline_message_2306.flags |= 2)), - (JSCompiler_object_inline_message_2306.return = workInProgress), - (JSCompiler_object_inline_stack_2308.return = workInProgress), - (JSCompiler_object_inline_stack_2308.sibling = - JSCompiler_object_inline_message_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2308), - (JSCompiler_object_inline_stack_2308 = - JSCompiler_object_inline_message_2306), - (JSCompiler_object_inline_message_2306 = workInProgress.child), - (JSCompiler_object_inline_digest_2307 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2307 - ? (JSCompiler_object_inline_digest_2307 = + (JSCompiler_object_inline_message_2334.flags |= 2)), + (JSCompiler_object_inline_message_2334.return = workInProgress), + (JSCompiler_object_inline_stack_2336.return = workInProgress), + (JSCompiler_object_inline_stack_2336.sibling = + JSCompiler_object_inline_message_2334), + (workInProgress.child = JSCompiler_object_inline_stack_2336), + (JSCompiler_object_inline_stack_2336 = + JSCompiler_object_inline_message_2334), + (JSCompiler_object_inline_message_2334 = workInProgress.child), + (JSCompiler_object_inline_digest_2335 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2335 + ? (JSCompiler_object_inline_digest_2335 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2307.cachePool), + JSCompiler_object_inline_digest_2335.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9370,38 +9412,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2307 = { + (JSCompiler_object_inline_digest_2335 = { baseLanes: - JSCompiler_object_inline_digest_2307.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2335.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2306.memoizedState = - JSCompiler_object_inline_digest_2307), - (JSCompiler_object_inline_message_2306.childLanes = + (JSCompiler_object_inline_message_2334.memoizedState = + JSCompiler_object_inline_digest_2335), + (JSCompiler_object_inline_message_2334.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2309, + JSCompiler_object_inline_componentStack_2337, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2308 + JSCompiler_object_inline_stack_2336 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2308.children + children: JSCompiler_object_inline_stack_2336.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2309 = + ((JSCompiler_object_inline_componentStack_2337 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2309 + null === JSCompiler_object_inline_componentStack_2337 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2309.push(current)); + : JSCompiler_object_inline_componentStack_2337.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -14632,7 +14674,8 @@ isFlushingPassiveEffects && (didScheduleUpdateDuringPassiveEffects = !0); if ( (root === workInProgressRoot && - workInProgressSuspendedReason === SuspendedOnData) || + (workInProgressSuspendedReason === SuspendedOnData || + workInProgressSuspendedReason === SuspendedOnAction)) || null !== root.cancelPendingCommit ) prepareFreshStack(root, 0), @@ -14690,40 +14733,82 @@ function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var shouldTimeSlice = - (!forceSync && - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes)) || - checkIfRootIsPrerendering(root, lanes), - exitStatus = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes, !0), - renderWasConcurrent = shouldTimeSlice; + if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { + var yieldEndTime = now$1(); + switch (yieldReason) { + case SuspendedOnImmediate: + case SuspendedOnData: + var startTime = yieldStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = yieldEndTime), + performance.measure("Suspended", reusableComponentOptions)); + break; + case SuspendedOnAction: + startTime = yieldStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = yieldEndTime), + performance.measure("Action", reusableComponentOptions)); + break; + default: + if (((startTime = yieldStartTime), supportsUserTiming)) { + var yieldDuration = yieldEndTime - startTime; + 1 > yieldDuration || + ((reusableComponentDevToolDetails.color = + 5 > yieldDuration + ? "primary-light" + : 10 > yieldDuration + ? "primary" + : 100 > yieldDuration + ? "primary-dark" + : "error"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = yieldEndTime), + performance.measure("Blocked", reusableComponentOptions)); + } + } + } + yieldDuration = (forceSync = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + checkIfRootIsPrerendering(root, lanes)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + var renderWasConcurrent = forceSync; do { - if (exitStatus === RootInProgress) { + if (yieldDuration === RootInProgress) { workInProgressRootIsPrerendering && - !shouldTimeSlice && + !forceSync && markRootSuspended(root, lanes, 0, !1); + lanes = workInProgressSuspendedReason; + yieldStartTime = now(); + yieldReason = lanes; break; - } else if (exitStatus === RootDidNotComplete) - finalizeRender(lanes, now$1()), - markRootSuspended( - root, - lanes, - 0, - !workInProgressRootDidSkipSuspendedSiblings - ); - else { - forceSync = root.current.alternate; + } else { + startTime = now$1(); + yieldEndTime = root.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) + !isRenderConsistentWithExternalStores(yieldEndTime) ) { - exitStatus = renderRootSync(root, lanes, !1); + setCurrentTrackFromLanes(lanes); + yieldEndTime = renderStartTime; + yieldDuration = startTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "error"), + (reusableLaneOptions.start = yieldEndTime), + (reusableLaneOptions.end = yieldDuration), + performance.measure("Teared Render", reusableLaneOptions)); + finalizeRender(lanes, startTime); + yieldDuration = renderRootSync(root, lanes, !1); renderWasConcurrent = !1; continue; } - if (exitStatus === RootErrored) { + if (yieldDuration === RootErrored) { renderWasConcurrent = lanes; if (root.errorRecoveryDisabledLanes & renderWasConcurrent) var errorRetryLanes = 0; @@ -14736,69 +14821,79 @@ ? 536870912 : 0); if (0 !== errorRetryLanes) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase(renderStartTime, startTime); + finalizeRender(lanes, startTime); lanes = errorRetryLanes; a: { - exitStatus = root; + startTime = root; + yieldDuration = renderWasConcurrent; var errorRetryLanes$jscomp$0 = errorRetryLanes; - errorRetryLanes = workInProgressRootConcurrentErrors; - var wasRootDehydrated = - exitStatus.current.memoizedState.isDehydrated; - wasRootDehydrated && + renderWasConcurrent = workInProgressRootConcurrentErrors; + (errorRetryLanes = + startTime.current.memoizedState.isDehydrated) && (prepareFreshStack( - exitStatus, + startTime, errorRetryLanes$jscomp$0 ).flags |= 256); errorRetryLanes$jscomp$0 = renderRootSync( - exitStatus, + startTime, errorRetryLanes$jscomp$0, !1 ); if (errorRetryLanes$jscomp$0 !== RootErrored) { if ( workInProgressRootDidAttachPingListener && - !wasRootDehydrated + !errorRetryLanes ) { - exitStatus.errorRecoveryDisabledLanes |= - renderWasConcurrent; - workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent; - exitStatus = RootSuspendedWithDelay; + startTime.errorRecoveryDisabledLanes |= yieldDuration; + workInProgressRootInterleavedUpdatedLanes |= yieldDuration; + yieldDuration = RootSuspendedWithDelay; break a; } - exitStatus = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorRetryLanes; - null !== exitStatus && queueRecoverableErrors(exitStatus); + startTime = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = renderWasConcurrent; + null !== startTime && queueRecoverableErrors(startTime); } - exitStatus = errorRetryLanes$jscomp$0; + yieldDuration = errorRetryLanes$jscomp$0; } renderWasConcurrent = !1; - if (exitStatus !== RootErrored) continue; + if (yieldDuration !== RootErrored) continue; + else startTime = now$1(); } } - if (exitStatus === RootFatalErrored) { + if (yieldDuration === RootFatalErrored) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase(renderStartTime, startTime); + finalizeRender(lanes, startTime); prepareFreshStack(root, 0); markRootSuspended(root, lanes, 0, !0); break; } a: { - shouldTimeSlice = root; - renderWasConcurrent = now$1(); - switch (exitStatus) { + forceSync = root; + switch (yieldDuration) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - finalizeRender(lanes, now$1()); - markRootSuspended( - shouldTimeSlice, - lanes, - workInProgressDeferredLane, - !workInProgressRootDidSkipSuspendedSiblings - ); - break a; - } - break; + if ((lanes & 4194176) !== lanes) break; + case RootSuspendedAtTheShell: + setCurrentTrackFromLanes(lanes); + logSuspendedRenderPhase(renderStartTime, startTime); + finalizeRender(lanes, startTime); + yieldEndTime = lanes; + 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) + ? (blockingSuspendedTime = startTime) + : 0 !== (yieldEndTime & 4194176) && + (transitionSuspendedTime = startTime); + markRootSuspended( + forceSync, + lanes, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; case RootErrored: workInProgressRootRecoverableErrors = null; break; @@ -14808,42 +14903,43 @@ default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; + forceSync.finishedWork = yieldEndTime; + forceSync.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, + yieldDuration, IMMEDIATE_COMMIT, renderStartTime, - renderWasConcurrent + startTime ); else { if ( (lanes & 62914560) === lanes && - ((exitStatus = + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - shouldTimeSlice, + forceSync, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; - shouldTimeSlice.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(forceSync, 0)) break a; + forceSync.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - shouldTimeSlice, forceSync, + yieldEndTime, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, @@ -14852,17 +14948,18 @@ workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, + yieldDuration, THROTTLED_COMMIT, renderStartTime, - renderWasConcurrent + startTime ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - shouldTimeSlice, forceSync, + yieldEndTime, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, @@ -14871,9 +14968,10 @@ workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, + yieldDuration, IMMEDIATE_COMMIT, renderStartTime, - renderWasConcurrent + startTime ); } } @@ -14901,6 +14999,7 @@ updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, + exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime @@ -14923,6 +15022,7 @@ spawnedLane, updatedLanes, suspendedRetryLanes, + exitStatus, SUSPENDED_COMMIT, completedRenderStartTime, completedRenderEndTime @@ -14944,6 +15044,7 @@ spawnedLane, updatedLanes, suspendedRetryLanes, + exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime @@ -15017,8 +15118,8 @@ (interruptedWork = workInProgress), resetContextDependencies(), resetHooksOnUnwind(interruptedWork), - (thenableState$1 = null), - (thenableIndexCounter$1 = 0), + (thenableState = null), + (thenableIndexCounter = 0), (interruptedWork = workInProgress); for (; null !== interruptedWork; ) unwindInterruptedWork(interruptedWork.alternate, interruptedWork), @@ -15032,47 +15133,82 @@ 0 !== (lanes & 4194176) && (transitionClampTime = finalizationTime); } function prepareFreshStack(root, lanes) { + supportsUserTiming && + (performance.mark("Blocking Track", blockingLaneMarker), + performance.mark("Transition Track", transitionLaneMarker), + performance.mark("Suspense Track", suspenseLaneMarker), + performance.mark("Idle Track", idleLaneMarker)); + var previousRenderStartTime = renderStartTime; renderStartTime = now(); - finalizeRender(workInProgressRootRenderLanes, renderStartTime); + if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) { + setCurrentTrackFromLanes(workInProgressRootRenderLanes); + if ( + workInProgressRootExitStatus === RootSuspended || + workInProgressRootExitStatus === RootSuspendedWithDelay + ) + logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + else { + var endTime = renderStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "primary-dark"), + (reusableLaneOptions.start = previousRenderStartTime), + (reusableLaneOptions.end = endTime), + performance.measure("Interrupted Render", reusableLaneOptions)); + } + finalizeRender(workInProgressRootRenderLanes, renderStartTime); + } if (0 !== (lanes & 3) || 0 !== (lanes & 60)) { - var updateTime = - 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime - ? blockingClampTime - : blockingUpdateTime, - eventTime = - 0 <= blockingEventTime && blockingEventTime < blockingClampTime - ? blockingClampTime - : blockingEventTime, - eventType = blockingEventType, + previousRenderStartTime = + 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime + ? blockingClampTime + : blockingUpdateTime; + endTime = + 0 <= blockingEventTime && blockingEventTime < blockingClampTime + ? blockingClampTime + : blockingEventTime; + 0 <= blockingSuspendedTime && + (setCurrentTrackFromLanes(lanes), + logSuspendedWithDelayPhase( + blockingSuspendedTime, + 0 <= endTime + ? endTime + : 0 <= previousRenderStartTime + ? previousRenderStartTime + : renderStartTime + )); + var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, renderStartTime$jscomp$0 = renderStartTime; supportsUserTiming && ((reusableLaneDevToolDetails.track = "Blocking"), - 0 < eventTime && + 0 < endTime && null !== eventType && ((reusableLaneDevToolDetails.color = eventIsRepeat ? "secondary-light" : "warning"), - (reusableLaneOptions.start = eventTime), + (reusableLaneOptions.start = endTime), (reusableLaneOptions.end = - 0 < updateTime ? updateTime : renderStartTime$jscomp$0), + 0 < previousRenderStartTime + ? previousRenderStartTime + : renderStartTime$jscomp$0), performance.measure( eventIsRepeat ? "" : "Event: " + eventType, reusableLaneOptions )), - 0 < updateTime && + 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = "primary-light"), - (reusableLaneOptions.start = updateTime), + (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); - blockingUpdateTime = -1.1; + blockingSuspendedTime = blockingUpdateTime = -1.1; + blockingEventIsRepeat = !0; } if (0 !== (lanes & 4194176)) { - updateTime = + previousRenderStartTime = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime : transitionStartTime; - eventTime = + endTime = 0 <= transitionUpdateTime && transitionUpdateTime < transitionClampTime ? transitionClampTime @@ -15081,6 +15217,16 @@ 0 <= transitionEventTime && transitionEventTime < transitionClampTime ? transitionClampTime : transitionEventTime; + 0 <= transitionSuspendedTime && + (setCurrentTrackFromLanes(lanes), + logSuspendedWithDelayPhase( + transitionSuspendedTime, + 0 <= eventType + ? eventType + : 0 <= endTime + ? endTime + : renderStartTime + )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; var renderStartTime$jscomp$1 = renderStartTime; @@ -15093,38 +15239,47 @@ : "warning"), (reusableLaneOptions.start = eventType), (reusableLaneOptions.end = - 0 < updateTime - ? updateTime - : 0 < eventTime - ? eventTime + 0 < previousRenderStartTime + ? previousRenderStartTime + : 0 < endTime + ? endTime : renderStartTime$jscomp$1), performance.measure( renderStartTime$jscomp$0 ? "" : "Event: " + eventIsRepeat, reusableLaneOptions )), - 0 < updateTime && + 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = updateTime), + (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = - 0 < eventTime ? eventTime : renderStartTime$jscomp$1), + 0 < endTime ? endTime : renderStartTime$jscomp$1), performance.measure("Action", reusableLaneOptions)), - 0 < eventTime && + 0 < endTime && ((reusableLaneDevToolDetails.color = "primary-light"), - (reusableLaneOptions.start = eventTime), + (reusableLaneOptions.start = endTime), (reusableLaneOptions.end = renderStartTime$jscomp$1), performance.measure("Blocked", reusableLaneOptions))); - transitionUpdateTime = transitionStartTime = -1.1; + transitionSuspendedTime = + transitionUpdateTime = + transitionStartTime = + -1.1; + transitionEventIsRepeat = !0; } root.finishedWork = null; root.finishedLanes = 0; - updateTime = root.timeoutHandle; - updateTime !== noTimeout && - ((root.timeoutHandle = noTimeout), cancelTimeout(updateTime)); - updateTime = root.cancelPendingCommit; - null !== updateTime && ((root.cancelPendingCommit = null), updateTime()); + previousRenderStartTime = root.timeoutHandle; + previousRenderStartTime !== noTimeout && + ((root.timeoutHandle = noTimeout), + cancelTimeout(previousRenderStartTime)); + previousRenderStartTime = root.cancelPendingCommit; + null !== previousRenderStartTime && + ((root.cancelPendingCommit = null), previousRenderStartTime()); resetWorkInProgressStack(); workInProgressRoot = root; - workInProgress = updateTime = createWorkInProgress(root.current, null); + workInProgress = previousRenderStartTime = createWorkInProgress( + root.current, + null + ); workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; @@ -15142,17 +15297,17 @@ null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 !== (lanes & 8) && (lanes |= lanes & 32); - eventTime = root.entangledLanes; - if (0 !== eventTime) - for (root = root.entanglements, eventTime &= lanes; 0 < eventTime; ) - (eventType = 31 - clz32(eventTime)), + endTime = root.entangledLanes; + if (0 !== endTime) + for (root = root.entanglements, endTime &= lanes; 0 < endTime; ) + (eventType = 31 - clz32(endTime)), (eventIsRepeat = 1 << eventType), (lanes |= root[eventType]), - (eventTime &= ~eventIsRepeat); + (endTime &= ~eventIsRepeat); entangledRenderLanes = lanes; finishQueueingConcurrentUpdates(); ReactStrictModeWarnings.discardPendingWarnings(); - return updateTime; + return previousRenderStartTime; } function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; @@ -15160,7 +15315,8 @@ ReactSharedInternals.getCurrentStack = null; isRendering = !1; current = null; - thrownValue === SuspenseException + thrownValue === SuspenseException || + thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException @@ -15249,10 +15405,11 @@ switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - memoizedUpdaters = RootDidNotComplete; + memoizedUpdaters = RootSuspendedAtTheShell; break a; case SuspendedOnImmediate: case SuspendedOnData: + case SuspendedOnAction: case SuspendedOnDeprecatedThrowPromise: null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; @@ -15341,6 +15498,7 @@ ); break; case SuspendedOnData: + case SuspendedOnAction: if (isThenableResolved(memoizedUpdaters)) { workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; @@ -15348,8 +15506,9 @@ break; } lanes = function () { - workInProgressSuspendedReason === SuspendedOnData && - workInProgressRoot === root && + (workInProgressSuspendedReason !== SuspendedOnData && + workInProgressSuspendedReason !== SuspendedOnAction) || + workInProgressRoot !== root || (workInProgressSuspendedReason = SuspendedAndReadyToContinue); ensureRootIsScheduled(root); @@ -15426,7 +15585,7 @@ break; case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + workInProgressRootExitStatus = RootSuspendedAtTheShell; break a; default: throw Error( @@ -15530,8 +15689,8 @@ ) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); - thenableState$1 = null; - thenableIndexCounter$1 = 0; + thenableState = null; + thenableIndexCounter = 0; var returnFiber = unitOfWork.return; try { if ( @@ -15571,6 +15730,7 @@ else if ( ((workInProgressRootDidSkipSuspendedSiblings = root = !0), suspendedReason === SuspendedOnData || + suspendedReason === SuspendedOnAction || suspendedReason === SuspendedOnImmediate || suspendedReason === SuspendedOnDeprecatedThrowPromise) ) @@ -15646,7 +15806,7 @@ } workInProgress = unitOfWork = next; } while (null !== unitOfWork); - workInProgressRootExitStatus = RootDidNotComplete; + workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } function commitRoot( @@ -15657,6 +15817,7 @@ spawnedLane, updatedLanes, suspendedRetryLanes, + exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime @@ -15675,6 +15836,7 @@ spawnedLane, updatedLanes, suspendedRetryLanes, + exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime @@ -15693,6 +15855,7 @@ spawnedLane, updatedLanes, suspendedRetryLanes, + exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime @@ -15705,10 +15868,13 @@ throw Error("Should not already be working."); var finishedWork = root.finishedWork; didIncludeRenderPhaseUpdate = root.finishedLanes; - reusableLaneDevToolDetails.track = getGroupNameOfHighestPriorityLane( - didIncludeRenderPhaseUpdate - ); - logRenderPhase(completedRenderStartTime, completedRenderEndTime); + setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); + exitStatus === RootErrored + ? logErroredRenderPhase( + completedRenderStartTime, + completedRenderEndTime + ) + : logRenderPhase(completedRenderStartTime, completedRenderEndTime); if (null === finishedWork) return null; 0 === didIncludeRenderPhaseUpdate && console.error( @@ -15723,12 +15889,12 @@ root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - completedRenderStartTime = finishedWork.lanes | finishedWork.childLanes; - completedRenderStartTime |= concurrentlyUpdatedLanes; + exitStatus = finishedWork.lanes | finishedWork.childLanes; + exitStatus |= concurrentlyUpdatedLanes; markRootFinished( root, didIncludeRenderPhaseUpdate, - completedRenderStartTime, + exitStatus, spawnedLane, updatedLanes, suspendedRetryLanes @@ -15741,7 +15907,7 @@ 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), + (pendingPassiveEffectsRemainingLanes = exitStatus), (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { @@ -15789,12 +15955,11 @@ ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, completedRenderStartTime), + : (releaseRootPooledCache(root, exitStatus), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - completedRenderStartTime = root.pendingLanes; - 0 === completedRenderStartTime && - (legacyErrorBoundariesThatAlreadyFailed = null); + exitStatus = root.pendingLanes; + 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); suspendedCommitReason || commitDoubleInvokeEffectsInDEV(root); onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); @@ -15808,24 +15973,23 @@ completedRenderEndTime++ ) (finishedWork = recoverableErrors[completedRenderEndTime]), - (completedRenderStartTime = makeErrorInfo(finishedWork.stack)), + (exitStatus = makeErrorInfo(finishedWork.stack)), runWithFiberInDEV( finishedWork.source, renderPriorityLevel, finishedWork.value, - completedRenderStartTime + exitStatus ); 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - completedRenderStartTime = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && - 0 !== (completedRenderStartTime & 42) + exitStatus = root.pendingLanes; + 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, now$1()); + finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -15877,8 +16041,7 @@ throw Error( "Cannot flush passive effects while already rendering." ); - reusableLaneDevToolDetails.track = - getGroupNameOfHighestPriorityLane(lanes); + setCurrentTrackFromLanes(lanes); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; var passiveEffectStartTime = 0; @@ -16035,6 +16198,12 @@ null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; root.warmLanes &= ~pingedLanes; + 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 60) + ? 0 > blockingUpdateTime && + (blockingClampTime = blockingUpdateTime = now()) + : 0 !== (pingedLanes & 4194176) && + 0 > transitionUpdateTime && + (transitionClampTime = transitionUpdateTime = now()); isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && console.error( @@ -16319,7 +16488,8 @@ if ( 0 === suspendedLanes || (root === currentTime && - workInProgressSuspendedReason === SuspendedOnData) || + (workInProgressSuspendedReason === SuspendedOnData || + workInProgressSuspendedReason === SuspendedOnAction)) || null !== root.cancelPendingCommit ) return ( @@ -20300,7 +20470,7 @@ ) { outsideHostContainerContext && console.error( - 'Cannot render a