From 82b1485fab64f7cfd538d79e9d562f562a6c6c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 2 Dec 2026 06:05:47 -0800 Subject: [PATCH 1/3] Keep Fabric internals out of the public API snapshot (#60475) Summary: ## Context The public `findNodeHandle` export is a direct alias of `ReactFabric.findNodeHandle`. Its inferred `typeof` declaration pulls the whole private Fabric interface into the generated API snapshot, so internal renderer changes appear as changes to the public React Native API. ## Changes Give the alias a self-contained projection of its existing method signature and regenerate the API snapshot without the private Fabric object and its supporting declarations. The projection preserves the type generator's existing method-level nullable-to-undefined convention; a standalone function annotation would otherwise change the generated public nullability. Keep the runtime alias unchanged and preserve the public call signature. Changelog: [Internal] Reviewed By: javache Differential Revision: D135632950 --- .../ReactNative/RendererImplementation.js | 6 +- packages/react-native/ReactNativeApi.d.ts | 70 +++---------------- 2 files changed, 13 insertions(+), 63 deletions(-) diff --git a/packages/react-native/Libraries/ReactNative/RendererImplementation.js b/packages/react-native/Libraries/ReactNative/RendererImplementation.js index cd4a835d7af3..936c268d29f5 100644 --- a/packages/react-native/Libraries/ReactNative/RendererImplementation.js +++ b/packages/react-native/Libraries/ReactNative/RendererImplementation.js @@ -45,7 +45,11 @@ export function renderElement({ export const dispatchCommand = ReactFabric.dispatchCommand; export const findHostInstance_DEPRECATED = ReactFabric.findHostInstance_DEPRECATED; -export const findNodeHandle = ReactFabric.findNodeHandle; +export const findNodeHandle: { + findNodeHandle( + componentOrHandle: ?(React.ElementRef | number), + ): ?number, +}['findNodeHandle'] = ReactFabric.findNodeHandle; export const sendAccessibilityEvent = ReactFabric.sendAccessibilityEvent; export const isChildPublicInstance = ReactFabric.isChildPublicInstance; export const getNodeFromInternalInstanceHandle = diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 735254dac1c8..912917abde8f 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -59,7 +59,6 @@ declare const $$index: { get VirtualizedSectionList(): AnyVirtualizedSectionList } declare const $$NativeDeviceInfo: typeof NativeModule_default -declare const $$ReactFabric: typeof ReactFabric_default declare const $$resolveAssetSource: typeof resolveAssetSource_default declare const $$ScrollViewContext: typeof ScrollViewContext_default declare const absoluteFill: AbsoluteFillStyle @@ -228,7 +227,11 @@ declare const eventImpl: ( argMapping: ReadonlyArray, config: EventConfig, ) => (...args: Array) => void -declare const findNodeHandle: typeof $$ReactFabric.findNodeHandle +declare const findNodeHandle: { + findNodeHandle( + componentOrHandle: (number | React.ComponentRef) | undefined, + ): number | undefined +}["findNodeHandle"] declare const flatten: typeof $$flattenStyle declare const forkEvent: typeof $$AnimatedImplementation.forkEvent declare const hairlineWidth: number @@ -343,7 +346,6 @@ declare const RCTNetworking_default: { withCredentials: boolean, ): void } -declare let ReactFabric_default: ReactFabricType declare const registerCallableModule: typeof registerCallableModule_default declare const registerCallableModule_default: RegisterCallableModule declare const requireNativeComponent: typeof requireNativeComponent_default @@ -921,7 +923,6 @@ declare type $$AnimatedImplementation = typeof $$AnimatedImplementation declare type $$flattenStyle = typeof $$flattenStyle declare type $$index = typeof $$index declare type $$NativeDeviceInfo = typeof $$NativeDeviceInfo -declare type $$ReactFabric = typeof $$ReactFabric declare type $$resolveAssetSource = typeof $$resolveAssetSource declare type $$ScrollViewContext = typeof $$ScrollViewContext declare class AbortSignal extends EventTarget_default { @@ -3351,9 +3352,6 @@ declare interface NativeUIEvent { readonly detail: number } declare type Networking = typeof Networking -declare type Node = symbol & { - __Node__: string -} declare class NodeList_default implements Iterable, ArrayLike_2 { [index: number]: T readonly length: number @@ -3959,36 +3957,6 @@ declare type RCTNetworkingEventDefinitions = { ] readonly didSendNetworkData: [[number, number, number]] } -declare type ReactFabricType = { - dispatchCommand( - handle: HostInstance, - command: string, - args: Array, - ): void - findHostInstance_DEPRECATED( - componentOrHandle: (number | React.ComponentRef) | undefined, - ): HostInstance | undefined - findNodeHandle( - componentOrHandle: (number | React.ComponentRef) | undefined, - ): number | undefined - getNodeFromInternalInstanceHandle( - internalInstanceHandle: InternalInstanceHandle, - ): Node | undefined - getPublicInstanceFromInternalInstanceHandle( - internalInstanceHandle: InternalInstanceHandle, - ): HostInstance | null | PublicTextInstance - getPublicInstanceFromRootTag(rootTag: number): null | PublicRootInstance - isChildPublicInstance(parent: HostInstance, child: HostInstance): boolean - render( - element: React.JSX.Element, - containerTag: number, - callback: (() => void) | undefined, - concurrentRoot: boolean | undefined, - options: RenderRootOptions | undefined, - ): React.ComponentRef | undefined - sendAccessibilityEvent(handle: HostInstance, eventType: string): void - unmountComponentAtNode(containerTag: number): void -} declare class ReactNativeDocument_default extends ReadOnlyNode_default { get childElementCount(): number get children(): HTMLCollection_default @@ -4175,28 +4143,6 @@ declare type Registry = { runnables: Runnables sections: ReadonlyArray } -declare type RenderRootOptions = { - onCaughtError?: ( - error: unknown, - errorInfo: { - readonly componentStack?: string - readonly errorBoundary?: React.Component - }, - ) => void - onDefaultTransitionIndicator?: () => (() => void) | void - onRecoverableError?: ( - error: unknown, - errorInfo: { - readonly componentStack?: string - }, - ) => void - onUncaughtError?: ( - error: unknown, - errorInfo: { - readonly componentStack?: string - }, - ) => void -} declare type RequestBody = | ArrayBuffer | ArrayBufferView @@ -5908,7 +5854,7 @@ export { AlertOptions, // 8a116d2a AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 633f77ed + Animated, // 5569381c AnimatedFlatList, // f32979ff AnimatedImage, // 08521177 AnimatedScrollView, // 1b410f55 @@ -6204,7 +6150,7 @@ export { WrapperComponentProvider, // 6ce47ba4 codegenNativeCommands, // 322f3f4e codegenNativeComponent, // 162426af - findNodeHandle, // 93f80214 + findNodeHandle, // fcaaf831 processColor, // 6e877698 registerCallableModule, // 55bda579 requireNativeComponent, // 27104937 From cc39adf6c444a84e23ecc78163d5e17a5d23128b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 2 Dec 2026 06:05:47 -0800 Subject: [PATCH 2/3] Add flushSync to the Fabric renderer (#38475) Summary: This just adds the definition of flushSync to the generated types, but the actual implementation will land in a different PR shortly. Changelog: [internal] Reviewed By: javache Differential Revision: D135611937 --- .../react-native/Libraries/Renderer/shims/ReactNativeTypes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js index cf4aac63d4b4..95abfe4192e4 100644 --- a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js @@ -7,7 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<> + * @generated SignedSource<> */ import type { @@ -163,6 +163,7 @@ export type ReactFabricType = { options: ?RenderRootOptions, ): ?React.ElementRef, unmountComponentAtNode(containerTag: number): void, + readonly flushSync: ((fn: () => R) => R) & ((fn: void) => void), getNodeFromInternalInstanceHandle( internalInstanceHandle: InternalInstanceHandle, ): ?Node, From 2bd4a4b052008e109cba2d941706e2e383885fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 2 Dec 2026 06:05:47 -0800 Subject: [PATCH 3/3] Sync OSS Fabric renderer (#60470) Summary: ## Context The Fabric source now includes `flushSync`, but the generated OSS renderer bundles must be refreshed before the new export is available to React Native. ## Changes Sync `ReactFabric-dev.js`, `ReactFabric-prod.js`, and `ReactFabric-profiling.js` from React commit `7d301100cea02e3232f92f180fb6853191d0d16d`, using the stable-channel `RN_OSS_DEV`, `RN_OSS_PROD`, and `RN_OSS_PROFILING` build outputs. Apply the standard generated header and SignedSource signatures. Leave the renderer revision, dependencies, shims, and internal bundles unchanged. ## Major renderer changes Compared with the previous OSS bundles from React revision `dc9aed364252a34966f4f2c4a98272317fdddb60`, this refresh includes more than the new `flushSync` export: - Remove the legacy event-dispatching pipeline, including its synthetic-event pooling, event-plugin registry, responder plugin, and touch-history implementation. Native events use the modern dispatching pipeline maintained in React Native instead. - Remove legacy-root reconciliation and the `disableLegacyMode` flag. Fabric's `render` entry point now requires a concurrent root and rejects the unsupported legacy-root API. - Add `flushSync` to all three OSS Fabric exports, including transition/priority restoration and flushing pending synchronous work when the callback throws. The large generated diff includes these substantive deletions as well as the resulting function reordering and temporary-variable renumbering by Closure Compiler; it is not a `flushSync`-only change. ## Released React compatibility Verified the shared-internals contract against the unmodified public npm packages `react@19.3.0` (the pinned version) and `react@19.3.1` (the current released latest), with released `scheduler@0.28.0`. The OSS bundles obtain shared internals from `React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`; no internal React build, replacement internals object, or special shared-internals global was supplied. Every shared-internals field accessed by each bundle exists in the corresponding released React development or production build, including `H`, `A`, `T`, `S`, and the required development-only fields. All six released-React/renderer combinations passed runtime checks for hook dispatch, context, IDs, synchronous state commits, `flushSync` return values and throw-path flushing, transition opt-out/restoration, async `startTransition`, async `useActionState`, and unmounting. The development combinations also passed released `React.act` checks for `actQueue`, `asyncTransitions`, and `thrownErrors`; development and profiling combinations exercised profiler callbacks. React and Scheduler were not mocked or patched; only the native Fabric bridge was mocked, so these checks verify the JavaScript shared-internals contract rather than full native integration. Changelog: [Internal] Reviewed By: javache, christophpurrer Differential Revision: D135614630 --- .../implementations/ReactFabric-dev.js | 32529 ++++++++-------- .../implementations/ReactFabric-prod.js | 7639 ++-- .../implementations/ReactFabric-profiling.js | 24044 ++++++------ 3 files changed, 30150 insertions(+), 34062 deletions(-) diff --git a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js index ffa8c39b136d..cd1f2bf31bcb 100644 --- a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +++ b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<002013d87e381e4dc255c509357549a6>> * * This file was sync'd from the facebook/react repository. */ @@ -15,46 +15,6 @@ "use strict"; __DEV__ && (function () { - function commitMount() { - throw Error( - "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue." - ); - } - function traverseOwnerTreeUp(hierarchy, instance) { - hierarchy.unshift(instance); - instance = instance._debugOwner; - null != instance && - "number" === typeof instance.tag && - traverseOwnerTreeUp(hierarchy, instance); - } - function getHostProps(fiber) { - return (fiber = findCurrentHostFiber(fiber)) - ? fiber.memoizedProps || emptyObject - : emptyObject; - } - function createHierarchy(fiberHierarchy) { - return fiberHierarchy.map(function (fiber) { - return { - name: getComponentNameFromType(fiber.type), - getInspectorData: function () { - return { - props: getHostProps(fiber), - measure: function (callback) { - var hostFiber = findCurrentHostFiber(fiber); - (hostFiber = - null != hostFiber && - null !== hostFiber.stateNode && - hostFiber.stateNode.node) && - reactPrivateInterface.fabricUIManager.measure( - hostFiber, - callback - ); - } - }; - } - }; - }); - } function findHook(fiber, id) { for (fiber = fiber.memoizedState; null !== fiber && 0 < id; ) (fiber = fiber.next), id--; @@ -119,8 +79,7 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (0 === root.tag && flushPendingEffects(), - updateContainerImpl(root.current, 2, element, root, null, null), + (updateContainerImpl(root.current, 2, element, root, null, null), flushSyncWork()); } function scheduleRefresh(root, update) { @@ -157,359 +116,211 @@ __DEV__ && }); return array.sort().join(", "); } + function commitMount() { + throw Error( + "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue." + ); + } + function traverseOwnerTreeUp(hierarchy, instance) { + hierarchy.unshift(instance); + instance = instance._debugOwner; + null != instance && + "number" === typeof instance.tag && + traverseOwnerTreeUp(hierarchy, instance); + } + function getHostProps(fiber) { + return (fiber = findCurrentHostFiber(fiber)) + ? fiber.memoizedProps || emptyObject + : emptyObject; + } + function createHierarchy(fiberHierarchy) { + return fiberHierarchy.map(function (fiber) { + return { + name: getComponentNameFromType(fiber.type), + getInspectorData: function () { + return { + props: getHostProps(fiber), + measure: function (callback) { + var hostFiber = findCurrentHostFiber(fiber); + (hostFiber = + null != hostFiber && + null !== hostFiber.stateNode && + hostFiber.stateNode.node) && + reactPrivateInterface.fabricUIManager.measure( + hostFiber, + callback + ); + } + }; + } + }; + }); + } function batchedUpdatesImpl(fn, bookkeeping) { return fn(bookkeeping); } - function currentTimeStamp() { - currentTimeStamp = - "object" === typeof performance && - null !== performance && - "function" === typeof performance.now - ? function () { - return performance.now(); + function getNearestMountedFiber(fiber) { + for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) + (node = nextNode), + 0 !== (node.flags & 4098) && (fiber = node.return), + (nextNode = node.return); + for (; node.return; ) node = node.return; + return 3 === node.tag ? fiber : null; + } + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error("Unable to find node on an unmounted component."); + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) + throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, _child = parentA.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; } - : function () { - return Date.now(); - }; - return currentTimeStamp(); + if (_child === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + for (_child = parentB.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) + throw Error( + "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." + ); + } + } + if (a.alternate !== b) + throw Error( + "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." + ); + } + if (3 !== a.tag) + throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); + function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; + } + function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; } - disabledDepth++; + return null; } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); + function traverseVisibleInstancesAndTextInstances( + child, + searchWithinHosts, + fn, + a, + b, + c + ) { + for (; null !== child; ) { + if ( + ((5 === child.tag || 27 === child.tag || 6 === child.tag) && + fn(child, a, b, c)) || + ((22 !== child.tag || null === child.memoizedState) && + (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && + traverseVisibleInstancesAndTextInstances( + child.child, + searchWithinHosts, + fn, + a, + b, + c + )) + ) + return !0; + child = child.sibling; } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); + return !1; } - function formatOwnerStack(error) { - var prevPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - error = error.stack; - Error.prepareStackTrace = prevPrepareStackTrace; - error.startsWith("Error: react-stack-top-frame\n") && - (error = error.slice(29)); - prevPrepareStackTrace = error.indexOf("\n"); - -1 !== prevPrepareStackTrace && - (error = error.slice(prevPrepareStackTrace + 1)); - prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame"); - -1 !== prevPrepareStackTrace && - (prevPrepareStackTrace = error.lastIndexOf( - "\n", - prevPrepareStackTrace - )); - if (-1 !== prevPrepareStackTrace) - error = error.slice(0, prevPrepareStackTrace); - else return ""; - return error; - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; + function getFragmentParentInstanceOrContainerFiber(fiber) { + for (fiber = fiber.return; null !== fiber; ) { + if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) + return fiber; + fiber = fiber.return; + } + return null; } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = null; - disableLogs(); - try { - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { - throw Error(); - } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x$1) { - control = x$1; - } - Fake = !1; - try { - var prevProps = Object.getOwnPropertyDescriptor( - fn.prototype, - "props" - ); - Object.defineProperty(fn.prototype, "props", { - configurable: !0, - set: function () { - throw Error(); - } - }); - Fake = !0; - new fn(); - } finally { - Fake && - (void 0 !== prevProps - ? Object.defineProperty( - fn.prototype, - "props", - prevProps - ) - : delete fn.prototype.props); - } - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); - } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; - } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } - ); - var _RunInRootFrame$Deter = - RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - if (sampleStack && controlStack) { - var sampleLines = sampleStack.split("\n"), - controlLines = controlStack.split("\n"); - for ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- + function findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child, + state + ) { + for (; null !== child; ) { + if (child === self) state.foundSelf = !0; + else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { + if (state.foundSelf) return (result[1] = child), !0; + result[0] = child; + } else if ( + (22 !== child.tag || null === child.memoizedState) && + findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child.child, + state ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternals.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + ) + return !0; + child = child.sibling; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeFiber(fiber, childFiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return describeBuiltInComponentFrame(fiber.type); - case 16: - return describeBuiltInComponentFrame("Lazy"); - case 13: - return fiber.child !== childFiber && null !== childFiber - ? describeBuiltInComponentFrame("Suspense Fallback") - : describeBuiltInComponentFrame("Suspense"); - case 19: - return describeBuiltInComponentFrame("SuspenseList"); - case 0: - case 15: - return describeNativeComponentFrame(fiber.type, !1); - case 11: - return describeNativeComponentFrame(fiber.type.render, !1); - case 1: - return describeNativeComponentFrame(fiber.type, !0); - case 31: - return describeBuiltInComponentFrame("Activity"); - case 30: - return describeBuiltInComponentFrame("ViewTransition"); - default: - return ""; - } - } - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = "", - previous = null; - do { - info += describeFiber(workInProgress, previous); - var debugInfo = workInProgress._debugInfo; - if (debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) { - var entry = debugInfo[i]; - if ("string" === typeof entry.name) { - var JSCompiler_temp_const = info; - a: { - var name = entry.name, - env = entry.env, - location = entry.debugLocation; - if (null != location) { - var childStack = formatOwnerStack(location), - idx = childStack.lastIndexOf("\n"), - lastLine = - -1 === idx ? childStack : childStack.slice(idx + 1); - if (-1 !== lastLine.indexOf(name)) { - var JSCompiler_inline_result = "\n" + lastLine; - break a; - } - } - JSCompiler_inline_result = describeBuiltInComponentFrame( - name + (env ? " [" + env + "]" : "") - ); - } - info = JSCompiler_temp_const + JSCompiler_inline_result; - } - } - previous = workInProgress; - workInProgress = workInProgress.return; - } while (workInProgress); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - function describeFunctionComponentFrameWithoutLineNumber(fn) { - return (fn = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(fn) - : ""; + return !1; } function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) @@ -631,8 +442,6 @@ __DEV__ && return "TracingMarker"; case 30: return "ViewTransition"; - case 17: - case 28: case 1: case 0: case 14: @@ -651,741 +460,71 @@ __DEV__ && } return null; } - function getCurrentFiberStackInDev() { - if (null === current) return ""; - var workInProgress = current; - try { - var info = ""; - 6 === workInProgress.tag && (workInProgress = workInProgress.return); - switch (workInProgress.tag) { - case 26: - case 27: - case 5: - info += describeBuiltInComponentFrame(workInProgress.type); - break; - case 13: - info += describeBuiltInComponentFrame("Suspense"); - break; - case 19: - info += describeBuiltInComponentFrame("SuspenseList"); - break; - case 31: - info += describeBuiltInComponentFrame("Activity"); - break; - case 30: - info += describeBuiltInComponentFrame("ViewTransition"); - break; - case 0: - case 15: - case 1: - workInProgress._debugOwner || - "" !== info || - (info += describeFunctionComponentFrameWithoutLineNumber( - workInProgress.type - )); - break; - case 11: - workInProgress._debugOwner || - "" !== info || - (info += describeFunctionComponentFrameWithoutLineNumber( - workInProgress.type.render - )); - } - for (; workInProgress; ) - if ("number" === typeof workInProgress.tag) { - var fiber = workInProgress; - workInProgress = fiber._debugOwner; - var debugStack = fiber._debugStack; - if (workInProgress && debugStack) { - var formattedStack = formatOwnerStack(debugStack); - "" !== formattedStack && (info += "\n" + formattedStack); - } - } else if (null != workInProgress.debugStack) { - var ownerStack = workInProgress.debugStack; - (workInProgress = workInProgress.owner) && - ownerStack && - (info += "\n" + formatOwnerStack(ownerStack)); - } else break; - var JSCompiler_inline_result = info; - } catch (x) { - JSCompiler_inline_result = - "\nError generating stack: " + x.message + "\n" + x.stack; - } - return JSCompiler_inline_result; - } - function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { - var previousFiber = current; - setCurrentFiber(fiber); + function batchedUpdates$1(fn, bookkeeping) { + if (isInsideEventHandler) return fn(bookkeeping); + isInsideEventHandler = !0; try { - return null !== fiber && fiber._debugTask - ? fiber._debugTask.run( - callback.bind(null, arg0, arg1, arg2, arg3, arg4) - ) - : callback(arg0, arg1, arg2, arg3, arg4); + return batchedUpdatesImpl(fn, bookkeeping); } finally { - setCurrentFiber(previousFiber); - } - throw Error( - "runWithFiberInDEV should never be called in production. This is a bug in React." - ); - } - function setCurrentFiber(fiber) { - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; - } - function validateEventDispatches(event) { - var dispatchListeners = event._dispatchListeners, - dispatchInstances = event._dispatchInstances; - dispatchListeners = (event = isArrayImpl(dispatchListeners)) - ? dispatchListeners.length - : dispatchListeners - ? 1 - : 0; - var instancesIsArr = isArrayImpl(dispatchInstances); - dispatchInstances = instancesIsArr - ? dispatchInstances.length - : dispatchInstances - ? 1 - : 0; - (instancesIsArr === event && dispatchInstances === dispatchListeners) || - console.error("EventPluginUtils: Invalid `event`."); - } - function executeDispatch(event, listener, inst) { - event.currentTarget = getNodeFromInstance$1(inst); - inst = global.event; - global.event = event; - try { - listener(event); - } catch (error) { - hasError || ((hasError = !0), (caughtError = error)); - } - global.event = inst; - event.currentTarget = null; - } - function executeDirectDispatch(event) { - validateEventDispatches(event); - var dispatchListener = event._dispatchListeners, - dispatchInstance = event._dispatchInstances; - if (isArrayImpl(dispatchListener)) throw Error("Invalid `event`."); - event.currentTarget = dispatchListener - ? getNodeFromInstance$1(dispatchInstance) - : null; - dispatchListener = dispatchListener ? dispatchListener(event) : null; - event.currentTarget = null; - event._dispatchListeners = null; - event._dispatchInstances = null; - return dispatchListener; - } - function functionThatReturnsTrue() { - return !0; - } - function functionThatReturnsFalse() { - return !1; - } - function SyntheticEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget - ) { - delete this.nativeEvent; - delete this.preventDefault; - delete this.stopPropagation; - delete this.isDefaultPrevented; - delete this.isPropagationStopped; - this.dispatchConfig = dispatchConfig; - this._targetInst = targetInst; - this.nativeEvent = nativeEvent; - this._dispatchInstances = this._dispatchListeners = null; - dispatchConfig = this.constructor.Interface; - for (var propName in dispatchConfig) - dispatchConfig.hasOwnProperty(propName) && - (delete this[propName], - (targetInst = dispatchConfig[propName]) - ? (this[propName] = targetInst(nativeEvent)) - : "target" === propName - ? (this.target = nativeEventTarget) - : (this[propName] = nativeEvent[propName])); - this.isDefaultPrevented = ( - null != nativeEvent.defaultPrevented - ? nativeEvent.defaultPrevented - : !1 === nativeEvent.returnValue - ) - ? functionThatReturnsTrue - : functionThatReturnsFalse; - this.isPropagationStopped = functionThatReturnsFalse; - return this; - } - function getPooledWarningPropertyDefinition(propName, getVal) { - function warn(action, result) { - console.error( - "This synthetic event is reused for performance reasons. If you're seeing this, you're %s `%s` on a released/nullified synthetic event. %s. If you must keep the original synthetic event around, use event.persist(). See https://react.dev/link/event-pooling for more information.", - action, - propName, - result - ); - } - var isFunction = "function" === typeof getVal; - return { - configurable: !0, - set: function (val) { - warn( - isFunction ? "setting the method" : "setting the property", - "This is effectively a no-op" - ); - return val; - }, - get: function () { - warn( - isFunction ? "accessing the method" : "accessing the property", - isFunction ? "This is a no-op function" : "This is set to null" - ); - return getVal; - } - }; - } - function createOrGetPooledEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeInst - ) { - if (this.eventPool.length) { - var instance = this.eventPool.pop(); - this.call( - instance, - dispatchConfig, - targetInst, - nativeEvent, - nativeInst - ); - return instance; + isInsideEventHandler = !1; } - return new this(dispatchConfig, targetInst, nativeEvent, nativeInst); - } - function releasePooledEvent(event) { - if (!(event instanceof this)) - throw Error( - "Trying to release an event instance into a pool of a different type." - ); - event.destructor(); - 10 > this.eventPool.length && this.eventPool.push(event); - } - function addEventPoolingTo(EventConstructor) { - EventConstructor.getPooled = createOrGetPooledEvent; - EventConstructor.eventPool = []; - EventConstructor.release = releasePooledEvent; - } - function isStartish(topLevelType) { - return "topTouchStart" === topLevelType; } - function isMoveish(topLevelType) { - return "topTouchMove" === topLevelType; - } - function timestampForTouch(touch) { - return touch.timeStamp || touch.timestamp; - } - function getTouchIdentifier(_ref) { - _ref = _ref.identifier; - if (null == _ref) throw Error("Touch object is missing identifier."); - 20 < _ref && - console.error( - "Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.", - _ref, - 20 + function dispatchEvent(target, topLevelType, nativeEventParam) { + var nativeEvent = + null != nativeEventParam && "object" === typeof nativeEventParam + ? nativeEventParam + : {}, + eventTarget = null; + null != target && + ((target = target.stateNode), + null != target && (eventTarget = getPublicInstance(target))); + batchedUpdates$1(function () { + var event = { eventName: topLevelType, nativeEvent: nativeEvent }; + reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); + reactPrivateInterface.RawEventEmitter.emit("*", event); + reactPrivateInterface.dispatchNativeEvent( + eventTarget, + topLevelType, + nativeEvent ); - return _ref; - } - function recordTouchStart(touch) { - var identifier = getTouchIdentifier(touch), - touchRecord = touchBank[identifier]; - touchRecord - ? ((touchRecord.touchActive = !0), - (touchRecord.startPageX = touch.pageX), - (touchRecord.startPageY = touch.pageY), - (touchRecord.startTimeStamp = timestampForTouch(touch)), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchRecord.previousPageX = touch.pageX), - (touchRecord.previousPageY = touch.pageY), - (touchRecord.previousTimeStamp = timestampForTouch(touch))) - : ((touchRecord = { - touchActive: !0, - startPageX: touch.pageX, - startPageY: touch.pageY, - startTimeStamp: timestampForTouch(touch), - currentPageX: touch.pageX, - currentPageY: touch.pageY, - currentTimeStamp: timestampForTouch(touch), - previousPageX: touch.pageX, - previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) - }), - (touchBank[identifier] = touchRecord)); - touchHistory.mostRecentTimeStamp = timestampForTouch(touch); - } - function recordTouchMove(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord - ? ((touchRecord.touchActive = !0), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))) - : console.warn( - "Cannot record touch move without a touch start.\nTouch Move: %s\nTouch Bank: %s", - printTouch(touch), - printTouchBank() - ); - } - function recordTouchEnd(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord - ? ((touchRecord.touchActive = !1), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))) - : console.warn( - "Cannot record touch end without a touch start.\nTouch End: %s\nTouch Bank: %s", - printTouch(touch), - printTouchBank() - ); - } - function printTouch(touch) { - return JSON.stringify({ - identifier: touch.identifier, - pageX: touch.pageX, - pageY: touch.pageY, - timestamp: timestampForTouch(touch) }); } - function printTouchBank() { - var printed = JSON.stringify(touchBank.slice(0, 20)); - 20 < touchBank.length && - (printed += " (original size: " + touchBank.length + ")"); - return printed; - } - function accumulate(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - return null == current - ? next - : isArrayImpl(current) - ? current.concat(next) - : isArrayImpl(next) - ? [current].concat(next) - : [current, next]; - } - function accumulateInto(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - if (null == current) return next; - if (isArrayImpl(current)) { - if (isArrayImpl(next)) - return current.push.apply(current, next), current; - current.push(next); - return current; - } - return isArrayImpl(next) ? [current].concat(next) : [current, next]; - } - function forEachAccumulated(arr, cb, scope) { - Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); - } - function changeResponder(nextResponderInst, blockHostResponder) { - var oldResponderInst = responderInst; - responderInst = nextResponderInst; - if (null !== ResponderEventPlugin.GlobalResponderHandler) - ResponderEventPlugin.GlobalResponderHandler.onChange( - oldResponderInst, - nextResponderInst, - blockHostResponder - ); - } - function getParent$1(inst) { - do inst = inst.return; - while (inst && 5 !== inst.tag); - return inst ? inst : null; - } - function traverseTwoPhase$1(inst, fn, arg) { - for (var path = []; inst; ) path.push(inst), (inst = getParent$1(inst)); - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); - } - function getListener$1(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." + function injectInternals(internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) return !0; + if (!hook.supportsFiber) + return ( + console.error( + "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" + ), + !0 ); - return inst; - } - function accumulateDirectionalDispatches$1(inst, phase, event) { - inst || console.error("Dispatching inst must not be null"); - if ( - (phase = getListener$1( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); - } - function accumulateDirectDispatchesSingle$1(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener$1( - inst, - event.dispatchConfig.registrationName - ); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } + try { + (rendererID = hook.inject(internals)), (injectedHook = hook); + } catch (err) { + console.error("React instrumentation encountered an error: %o.", err); } + return hook.checkDCE ? !0 : !1; } - function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst; - targetInst = targetInst ? getParent$1(targetInst) : null; - traverseTwoPhase$1( - targetInst, - accumulateDirectionalDispatches$1, - event - ); - } + function setIsStrictModeForDevtools(newIsStrictMode) { + "function" === typeof log$1 && + unstable_setDisableYieldValue(newIsStrictMode); + if (injectedHook && "function" === typeof injectedHook.setStrictMode) + try { + injectedHook.setStrictMode(rendererID, newIsStrictMode); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %o", + err + )); + } } - function accumulateTwoPhaseDispatchesSingle$1(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase$1( - event._targetInst, - accumulateDirectionalDispatches$1, - event - ); - } - function recomputePluginOrdering() { - if (eventPluginOrder) - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName], - pluginIndex = eventPluginOrder.indexOf(pluginName); - if (-1 >= pluginIndex) - throw Error( - "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + - (pluginName + "`.") - ); - if (!plugins[pluginIndex]) { - if (!pluginModule.extractEvents) - throw Error( - "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + - (pluginName + "` does not.") - ); - plugins[pluginIndex] = pluginModule; - pluginIndex = pluginModule.eventTypes; - for (var eventName in pluginIndex) { - var JSCompiler_inline_result = void 0; - var dispatchConfig = pluginIndex[eventName], - pluginModule$jscomp$0 = pluginModule, - eventName$jscomp$0 = eventName; - if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0)) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + - (eventName$jscomp$0 + "`.") - ); - eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig; - if ( - (eventName$jscomp$0 = dispatchConfig.phasedRegistrationNames) - ) { - for (JSCompiler_inline_result in eventName$jscomp$0) - eventName$jscomp$0.hasOwnProperty(JSCompiler_inline_result) && - publishRegistrationName( - eventName$jscomp$0[JSCompiler_inline_result], - pluginModule$jscomp$0 - ); - JSCompiler_inline_result = !0; - } else - dispatchConfig.registrationName - ? (publishRegistrationName( - dispatchConfig.registrationName, - pluginModule$jscomp$0 - ), - (JSCompiler_inline_result = !0)) - : (JSCompiler_inline_result = !1); - if (!JSCompiler_inline_result) - throw Error( - "EventPluginRegistry: Failed to publish event `" + - eventName + - "` for plugin `" + - pluginName + - "`." - ); - } - } - } - } - function publishRegistrationName(registrationName, pluginModule) { - if (registrationNameModules[registrationName]) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + - (registrationName + "`.") - ); - registrationNameModules[registrationName] = pluginModule; - registrationName.toLowerCase(); - } - function getListener(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." - ); - return inst; - } - function accumulateDirectionalDispatches(inst, phase, event) { - inst || console.error("Dispatching inst must not be null"); - if ( - (phase = getListener( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); - } - function traverseTwoPhase(inst, fn, arg, skipBubbling) { - for (var path = []; inst; ) { - path.push(inst); - do inst = inst.return; - while (inst && 5 !== inst.tag); - inst = inst ? inst : null; - } - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - if (skipBubbling) fn(path[0], "bubbled", arg); - else - for (inst = 0; inst < path.length; inst++) - fn(path[inst], "bubbled", arg); - } - function accumulateTwoPhaseDispatchesSingle(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - event._targetInst, - accumulateDirectionalDispatches, - event, - !1 - ); - } - function accumulateDirectDispatchesSingle(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener( - inst, - event.dispatchConfig.registrationName - ); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } - } - } - function batchedUpdates$1(fn, bookkeeping) { - if (isInsideEventHandler) return fn(bookkeeping); - isInsideEventHandler = !0; - try { - return batchedUpdatesImpl(fn, bookkeeping); - } finally { - isInsideEventHandler = !1; - } - } - function executeDispatchesAndReleaseTopLevel(e) { - if (e) { - var dispatchListeners = e._dispatchListeners, - dispatchInstances = e._dispatchInstances; - validateEventDispatches(e); - if (isArrayImpl(dispatchListeners)) - for ( - var i = 0; - i < dispatchListeners.length && !e.isPropagationStopped(); - i++ - ) { - var listener = dispatchListeners[i], - instance = dispatchInstances[i]; - null !== instance - ? runWithFiberInDEV( - instance, - executeDispatch, - e, - listener, - instance - ) - : executeDispatch(e, listener, instance); - } - else - dispatchListeners && - (null !== dispatchInstances - ? runWithFiberInDEV( - dispatchInstances, - executeDispatch, - e, - dispatchListeners, - dispatchInstances - ) - : executeDispatch(e, dispatchListeners, dispatchInstances)); - e._dispatchListeners = null; - e._dispatchInstances = null; - e.isPersistent() || e.constructor.release(e); - } - } - function dispatchEvent(target, topLevelType, nativeEventParam) { - var nativeEvent = - null != nativeEventParam && "object" === typeof nativeEventParam - ? nativeEventParam - : {}, - eventTarget = null; - null != target && - ((nativeEventParam = target.stateNode), - null != nativeEventParam && - (eventTarget = getPublicInstance(nativeEventParam))); - batchedUpdates$1(function () { - var event = { eventName: topLevelType, nativeEvent: nativeEvent }; - reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); - reactPrivateInterface.RawEventEmitter.emit("*", event); - null == _enableNativeEventTargetEventDispatching && - ((event = - null != reactPrivateInterface.ReactNativeFeatureFlags - ? reactPrivateInterface.ReactNativeFeatureFlags - .enableNativeEventTargetEventDispatching - : null), - (_enableNativeEventTargetEventDispatching = - "function" === typeof event && event())); - if (_enableNativeEventTargetEventDispatching) - reactPrivateInterface.dispatchNativeEvent( - eventTarget, - topLevelType, - nativeEvent - ); - else { - event = eventTarget; - for ( - var events = null, legacyPlugins = plugins, i = 0; - i < legacyPlugins.length; - i++ - ) { - var possiblePlugin = legacyPlugins[i]; - possiblePlugin && - (possiblePlugin = possiblePlugin.extractEvents( - topLevelType, - target, - nativeEvent, - event - )) && - (events = accumulateInto(events, possiblePlugin)); - } - event = events; - null !== event && (eventQueue = accumulateInto(eventQueue, event)); - event = eventQueue; - eventQueue = null; - if (event) { - forEachAccumulated(event, executeDispatchesAndReleaseTopLevel); - if (eventQueue) - throw Error( - "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." - ); - if (hasError) - throw ( - ((event = caughtError), - (hasError = !1), - (caughtError = null), - event) - ); - } - } - }); - } - function injectInternals(internals) { - if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; - var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; - if (hook.isDisabled) return !0; - if (!hook.supportsFiber) - return ( - console.error( - "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" - ), - !0 - ); - try { - (rendererID = hook.inject(internals)), (injectedHook = hook); - } catch (err) { - console.error("React instrumentation encountered an error: %o.", err); - } - return hook.checkDCE ? !0 : !1; - } - function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$1 && - unstable_setDisableYieldValue(newIsStrictMode); - if (injectedHook && "function" === typeof injectedHook.setStrictMode) - try { - injectedHook.setStrictMode(rendererID, newIsStrictMode); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %o", - err - )); - } - } - function clz32Fallback(x) { - x >>>= 0; - return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; + function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -1726,12111 +865,10847 @@ __DEV__ && : ContinuousEventPriority : DiscreteEventPriority; } - function getNearestMountedFiber(fiber) { - for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) - (node = nextNode), - 0 !== (node.flags & 4098) && (fiber = node.return), - (nextNode = node.return); - for (; node.return; ) node = node.return; - return 3 === node.tag ? fiber : null; - } - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); - } - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); - } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); + function disabledLog() {} + function disableLogs() { + if (0 === disabledDepth) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: !0, + enumerable: !0, + value: disabledLog, + writable: !0 + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; - } - function findCurrentHostFiber(parent) { - parent = findCurrentFiberUsingSlowPath(parent); - return null !== parent ? findCurrentHostFiberImpl(parent) : null; + disabledDepth++; } - function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; + function reenableLogs() { + disabledDepth--; + if (0 === disabledDepth) { + var props = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: assign({}, props, { value: prevLog }), + info: assign({}, props, { value: prevInfo }), + warn: assign({}, props, { value: prevWarn }), + error: assign({}, props, { value: prevError }), + group: assign({}, props, { value: prevGroup }), + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), + groupEnd: assign({}, props, { value: prevGroupEnd }) + }); } - return null; + 0 > disabledDepth && + console.error( + "disabledDepth fell below zero. This is a bug in React. Please file an issue." + ); } - function traverseVisibleInstancesAndTextInstances( - child, - searchWithinHosts, - fn, - a, - b, - c - ) { - for (; null !== child; ) { - if ( - ((5 === child.tag || 27 === child.tag || 6 === child.tag) && - fn(child, a, b, c)) || - ((22 !== child.tag || null === child.memoizedState) && - (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && - traverseVisibleInstancesAndTextInstances( - child.child, - searchWithinHosts, - fn, - a, - b, - c - )) - ) - return !0; - child = child.sibling; - } - return !1; + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; } - function getFragmentParentInstanceOrContainerFiber(fiber) { - for (fiber = fiber.return; null !== fiber; ) { - if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) - return fiber; - fiber = fiber.return; - } - return null; + function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; + } + return "\n" + prefix + name + suffix; } - function findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child, - state - ) { - for (; null !== child; ) { - if (child === self) state.foundSelf = !0; - else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { - if (state.foundSelf) return (result[1] = child), !0; - result[0] = child; - } else if ( - (22 !== child.tag || null === child.memoizedState) && - findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child.child, - state + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + var frame = componentFrameCache.get(fn); + if (void 0 !== frame) return frame; + reentry = !0; + frame = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var previousDispatcher = null; + previousDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = null; + disableLogs(); + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + Fake = !1; + try { + var prevProps = Object.getOwnPropertyDescriptor( + fn.prototype, + "props" + ); + Object.defineProperty(fn.prototype, "props", { + configurable: !0, + set: function () { + throw Error(); + } + }); + Fake = !0; + new fn(); + } finally { + Fake && + (void 0 !== prevProps + ? Object.defineProperty( + fn.prototype, + "props", + prevProps + ) + : delete fn.prototype.props); + } + } + } else { + try { + throw Error(); + } catch (x$2) { + control = x$2; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); + } + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; + } + return [null, null]; + } + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + ) - ) - return !0; - child = child.sibling; + namePropDescriptor++; + for ( + ; + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); + + ) + _RunInRootFrame$Deter++; + if ( + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length + ) + for ( + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; + + ) + _RunInRootFrame$Deter--; + for ( + ; + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- + ) + if ( + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] + ) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { + do + if ( + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) + ) { + var _frame = + "\n" + + sampleLines[namePropDescriptor].replace( + " at new ", + " at " + ); + fn.displayName && + _frame.includes("") && + (_frame = _frame.replace("", fn.displayName)); + "function" === typeof fn && + componentFrameCache.set(fn, _frame); + return _frame; + } + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); + } + break; + } + } + } finally { + (reentry = !1), + (ReactSharedInternals.H = previousDispatcher), + reenableLogs(), + (Error.prepareStackTrace = frame); } - return !1; - } - function createCursor(defaultValue) { - return { current: defaultValue }; - } - function pop(cursor, fiber) { - 0 > index$jscomp$0 - ? console.error("Unexpected pop.") - : (fiber !== fiberStack[index$jscomp$0] && - console.error("Unexpected Fiber popped."), - (cursor.current = valueStack[index$jscomp$0]), - (valueStack[index$jscomp$0] = null), - (fiberStack[index$jscomp$0] = null), - index$jscomp$0--); - } - function push(cursor, value, fiber) { - index$jscomp$0++; - valueStack[index$jscomp$0] = cursor.current; - fiberStack[index$jscomp$0] = fiber; - cursor.current = value; - } - function getViewTransitionName(props, instance) { - if (null != props.name && "auto" !== props.name) return props.name; - if (null !== instance.autoName) return instance.autoName; - props = pendingEffectsRoot.identifierPrefix; - var globalClientId = globalClientIdCounter$1++; - props = "_" + props + "t_" + globalClientId.toString(32) + "_"; - return (instance.autoName = props); + sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(sampleLines) + : ""; + "function" === typeof fn && componentFrameCache.set(fn, sampleLines); + return sampleLines; } - function getClassNameByType(classByType) { - if (null == classByType || "string" === typeof classByType) - return classByType; - var className = null, - activeTypes = pendingTransitionTypes; - if (null !== activeTypes) - for (var i = 0; i < activeTypes.length; i++) { - var match = classByType[activeTypes[i]]; - if (null != match) { - if ("none" === match) return "none"; - className = null == className ? match : className + (" " + match); - } - } - return null == className ? classByType.default : className; + function describeFiber(fiber, childFiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return fiber.child !== childFiber && null !== childFiber + ? describeBuiltInComponentFrame("Suspense Fallback") + : describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return describeNativeComponentFrame(fiber.type, !1); + case 11: + return describeNativeComponentFrame(fiber.type.render, !1); + case 1: + return describeNativeComponentFrame(fiber.type, !0); + case 31: + return describeBuiltInComponentFrame("Activity"); + case 30: + return describeBuiltInComponentFrame("ViewTransition"); + default: + return ""; + } } - function getViewTransitionClassName(defaultClass, eventClass) { - defaultClass = getClassNameByType(defaultClass); - eventClass = getClassNameByType(eventClass); - return null == eventClass - ? "auto" === defaultClass - ? null - : defaultClass - : "auto" === eventClass - ? null - : eventClass; + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = "", + previous = null; + do { + info += describeFiber(workInProgress, previous); + var debugInfo = workInProgress._debugInfo; + if (debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) { + var entry = debugInfo[i]; + if ("string" === typeof entry.name) { + var JSCompiler_temp_const = info; + a: { + var name = entry.name, + env = entry.env, + location = entry.debugLocation; + if (null != location) { + var childStack = formatOwnerStack(location), + idx = childStack.lastIndexOf("\n"), + lastLine = + -1 === idx ? childStack : childStack.slice(idx + 1); + if (-1 !== lastLine.indexOf(name)) { + var JSCompiler_inline_result = "\n" + lastLine; + break a; + } + } + JSCompiler_inline_result = describeBuiltInComponentFrame( + name + (env ? " [" + env + "]" : "") + ); + } + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } + previous = workInProgress; + workInProgress = workInProgress.return; + } while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } } - function is(x, y) { - return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; } - function getArrayKind(array) { - for (var kind = 0, i = 0; i < array.length && 100 > i; i++) { - var value = array[i]; - if ("object" === typeof value && null !== value) - if ( - isArrayImpl(value) && - 2 === value.length && - "string" === typeof value[0] - ) { - if (0 !== kind && 3 !== kind) return 1; - kind = 3; - } else return 1; - else { - if ( - "function" === typeof value || - ("string" === typeof value && 50 < value.length) || - (0 !== kind && 2 !== kind) || - "bigint" === typeof value - ) - return 1; - kind = 2; + function getCurrentFiberStackInDev() { + if (null === current) return ""; + var workInProgress = current; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 31: + info += describeBuiltInComponentFrame("Activity"); + break; + case 30: + info += describeBuiltInComponentFrame("ViewTransition"); + break; + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + if (workInProgress && debugStack) { + var formattedStack = formatOwnerStack(debugStack); + "" !== formattedStack && (info += "\n" + formattedStack); + } + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = + "\nError generating stack: " + x.message + "\n" + x.stack; } - return kind; + return JSCompiler_inline_result; } - function addObjectToProperties(object, properties, indent, prefix) { - if (!ArrayBuffer.isView(object)) { - var addedProperties = 0, - key; - for (key in object) - if ( - hasOwnProperty.call(object, key) && - "_" !== key[0] && - (addedProperties++, - addValueToProperties(key, object[key], properties, indent, prefix), - 100 <= addedProperties) - ) { - properties.push([ - prefix + - "\u00a0\u00a0".repeat(indent) + - "Only 100 properties are shown. React will not log more properties of this object.", - "" - ]); - break; - } + function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { + var previousFiber = current; + setCurrentFiber(fiber); + try { + return null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); + } finally { + setCurrentFiber(previousFiber); } + throw Error( + "runWithFiberInDEV should never be called in production. This is a bug in React." + ); } - function readReactElementTypeof(value) { - return "$$typeof" in value && hasOwnProperty.call(value, "$$typeof") - ? value.$$typeof - : void 0; + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; } - function addValueToProperties( - propertyName, - value, - properties, - indent, - prefix - ) { - switch (typeof value) { - case "object": - if (null === value) { - value = "null"; - break; - } else { - if (readReactElementTypeof(value) === REACT_ELEMENT_TYPE) { - var typeName = getComponentNameFromType(value.type) || "\u2026", - key = value.key; - value = value.props; - var propsKeys = Object.keys(value), - propsLength = propsKeys.length; - if (null == key && 0 === propsLength) { - value = "<" + typeName + " />"; - break; - } - if ( - 3 > indent || - (1 === propsLength && - "children" === propsKeys[0] && - null == key) - ) { - value = "<" + typeName + " \u2026 />"; - break; - } - properties.push([ - prefix + "\u00a0\u00a0".repeat(indent) + propertyName, - "<" + typeName - ]); - null !== key && - addValueToProperties( - "key", - key, - properties, - indent + 1, - prefix - ); - propertyName = !1; - key = 0; - for (var propKey in value) - if ( - (key++, - "children" === propKey - ? null != value.children && - (!isArrayImpl(value.children) || - 0 < value.children.length) && - (propertyName = !0) - : hasOwnProperty.call(value, propKey) && - "_" !== propKey[0] && - addValueToProperties( - propKey, - value[propKey], - properties, - indent + 1, - prefix - ), - 100 <= key) - ) - break; - properties.push([ - "", - propertyName ? ">\u2026" : "/>" - ]); - return; - } - typeName = Object.prototype.toString.call(value); - typeName = typeName.slice(8, typeName.length - 1); - if (ArrayBuffer.isView(value)) { - value = value.length; - value = - "number" === typeof value - ? typeName + "(" + value + ")" - : typeName; - break; - } - if ("Array" === typeName) - if ( - ((propKey = 100 < value.length), - (key = getArrayKind(value)), - 2 === key || 0 === key) - ) { - value = JSON.stringify( - propKey ? value.slice(0, 100).concat("\u2026") : value - ); - break; - } else if (3 === key) { - properties.push([ - prefix + "\u00a0\u00a0".repeat(indent) + propertyName, - "" - ]); - for ( - propertyName = 0; - propertyName < value.length && 100 > propertyName; - propertyName++ - ) - (typeName = value[propertyName]), - addValueToProperties( - typeName[0], - typeName[1], - properties, - indent + 1, - prefix - ); - propKey && - addValueToProperties( - (100).toString(), - "\u2026", - properties, - indent + 1, - prefix - ); - return; - } - if ("Promise" === typeName) { - if ("fulfilled" === value.status) { - if ( - ((typeName = properties.length), - addValueToProperties( - propertyName, - value.value, - properties, - indent, - prefix - ), - properties.length > typeName) - ) { - properties = properties[typeName]; - properties[1] = - "Promise<" + (properties[1] || "Object") + ">"; - return; - } - } else if ( - "rejected" === value.status && - ((typeName = properties.length), - addValueToProperties( - propertyName, - value.reason, - properties, - indent, - prefix - ), - properties.length > typeName) - ) { - properties = properties[typeName]; - properties[1] = "Rejected Promise<" + properties[1] + ">"; - return; - } - properties.push([ - "\u00a0\u00a0".repeat(indent) + propertyName, - "Promise" - ]); - return; - } - "Object" === typeName && - (propKey = Object.getPrototypeOf(value)) && - "function" === typeof propKey.constructor && - (typeName = propKey.constructor.name); - properties.push([ - prefix + "\u00a0\u00a0".repeat(indent) + propertyName, - "Object" === typeName ? (3 > indent ? "" : "\u2026") : typeName - ]); - 3 > indent && - addObjectToProperties(value, properties, indent + 1, prefix); - return; - } - case "function": - value = value.name; - value = - "" === value || "string" !== typeof value - ? "() => {}" - : value + "() {}"; - break; - case "string": - value = - "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects." === - value - ? "\u2026" - : JSON.stringify( - 1024 <= value.length ? value.slice(0, 1023) + "\u2026" : value - ); - break; - case "undefined": - value = "undefined"; - break; - case "boolean": - value = value ? "true" : "false"; - break; - default: - value = String(value); - } - properties.push([ - prefix + "\u00a0\u00a0".repeat(indent) + propertyName, - value - ]); + function getNodeFromInternalInstanceHandle(internalInstanceHandle) { + return ( + internalInstanceHandle && + internalInstanceHandle.stateNode && + internalInstanceHandle.stateNode.node + ); } - function addObjectDiffToProperties(prev, next, properties, indent) { - var isDeeplyEqual = !0, - prevPropertiesChecked = 0; - for (key in prev) { - if (100 < prevPropertiesChecked) { - properties.push([ - "Previous object has more than 100 properties. React will not attempt to diff objects with too many properties.", - "" - ]); - isDeeplyEqual = !1; - break; - } - key in next || - (properties.push([ - "-\u00a0" + "\u00a0\u00a0".repeat(indent) + key, - "\u2026" - ]), - (isDeeplyEqual = !1)); - prevPropertiesChecked++; - } - prevPropertiesChecked = 0; - for (var _key in next) { - if (100 < prevPropertiesChecked) { - properties.push([ - "Next object has more than 100 properties. React will not attempt to diff objects with too many properties.", - "" - ]); - isDeeplyEqual = !1; - break; - } - if (_key in prev) { - var key = prev[_key]; - var nextValue = next[_key]; - if (key !== nextValue) { - if (0 === indent && "children" === _key) { - isDeeplyEqual = "\u00a0\u00a0".repeat(indent) + _key; - properties.push( - ["-\u00a0" + isDeeplyEqual, "\u2026"], - ["+\u00a0" + isDeeplyEqual, "\u2026"] - ); - isDeeplyEqual = !1; - continue; - } - if (!(3 <= indent)) - if ( - "object" === typeof key && - "object" === typeof nextValue && - null !== key && - null !== nextValue && - readReactElementTypeof(key) === - readReactElementTypeof(nextValue) - ) - if (readReactElementTypeof(nextValue) === REACT_ELEMENT_TYPE) { - if ( - key.type === nextValue.type && - key.key === nextValue.key - ) { - key = getComponentNameFromType(nextValue.type) || "\u2026"; - isDeeplyEqual = "\u00a0\u00a0".repeat(indent) + _key; - key = "<" + key + " \u2026 />"; - properties.push( - ["-\u00a0" + isDeeplyEqual, key], - ["+\u00a0" + isDeeplyEqual, key] - ); - isDeeplyEqual = !1; - continue; - } - } else { - var prevKind = Object.prototype.toString.call(key), - nextKind = Object.prototype.toString.call(nextValue); - if ( - prevKind === nextKind && - ("[object Object]" === nextKind || - "[object Array]" === nextKind) - ) { - prevKind = [ - "\u2007\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, - "[object Array]" === nextKind ? "Array" : "" - ]; - properties.push(prevKind); - nextKind = properties.length; - addObjectDiffToProperties( - key, - nextValue, - properties, - indent + 1 - ) - ? nextKind === properties.length && - (prevKind[1] = - "Referentially unequal but deeply equal objects. Consider memoization.") - : (isDeeplyEqual = !1); - continue; - } - } - else if ( - "function" === typeof key && - "function" === typeof nextValue && - key.name === nextValue.name && - key.length === nextValue.length && - ((prevKind = Function.prototype.toString.call(key)), - (nextKind = Function.prototype.toString.call(nextValue)), - prevKind === nextKind) - ) { - key = - "" === nextValue.name ? "() => {}" : nextValue.name + "() {}"; - properties.push([ - "\u2007\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, - key + - " Referentially unequal function closure. Consider memoization." - ]); - continue; - } - addValueToProperties(_key, key, properties, indent, "-\u00a0"); - addValueToProperties( - _key, - nextValue, - properties, - indent, - "+\u00a0" - ); - isDeeplyEqual = !1; - } - } else - properties.push([ - "+\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, - "\u2026" - ]), - (isDeeplyEqual = !1); - prevPropertiesChecked++; - } - return isDeeplyEqual; + function shim$1() { + throw Error( + "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." + ); } - function setCurrentTrackFromLanes(lanes) { - currentTrack = - lanes & 63 - ? "Blocking" - : lanes & 64 - ? "Gesture" - : lanes & 4194176 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; + function shim() { + throw Error( + "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." + ); } - function logComponentTrigger(fiber, startTime, endTime, trigger) { - supportsUserTiming && - ((reusableComponentOptions.start = startTime), - (reusableComponentOptions.end = endTime), - (reusableComponentDevToolDetails.color = "warning"), - (reusableComponentDevToolDetails.tooltipText = trigger), - (reusableComponentDevToolDetails.properties = null), - (fiber = fiber._debugTask) - ? fiber.run( - performance.measure.bind( - performance, - trigger, - reusableComponentOptions - ) - ) - : performance.measure(trigger, reusableComponentOptions), - performance.clearMeasures(trigger)); + function ViewTransitionPseudoElement(pseudo, name) { + this._pseudo = pseudo; + this._name = name; } - function logComponentReappeared(fiber, startTime, endTime) { - logComponentTrigger(fiber, startTime, endTime, "Reconnect"); + function measureClonedInstance() { + console.warn("measureClonedInstance is not implemented"); + return { + rect: { x: 0, y: 0, width: 0, height: 0 }, + abs: !1, + clip: !1, + view: !0 + }; } - function logComponentRender( - fiber, - startTime, - endTime, - wasHydrated, - committedLanes - ) { - var name = getComponentNameFromFiber(fiber); - if (null !== name && supportsUserTiming) { - var alternate = fiber.alternate, - selfTime = fiber.actualDuration; - if (null === alternate || alternate.child !== fiber.child) - for (var child = fiber.child; null !== child; child = child.sibling) - selfTime -= child.actualDuration; - selfTime = - 0.5 > selfTime - ? wasHydrated - ? "tertiary-light" - : "primary-light" - : 10 > selfTime - ? wasHydrated - ? "tertiary" - : "primary" - : 100 > selfTime - ? wasHydrated - ? "tertiary-dark" - : "primary-dark" - : "error"; - var props = fiber.memoizedProps; - wasHydrated = fiber._debugTask; - null !== props && - null !== alternate && - alternate.memoizedProps !== props - ? ((child = [reusableChangedPropsEntry]), - (props = addObjectDiffToProperties( - alternate.memoizedProps, - props, - child, - 0 - )), - 1 < child.length - ? (props && - !alreadyWarnedForDeepEquality && - 0 === (alternate.lanes & committedLanes) && - 100 < fiber.actualDuration - ? ((alreadyWarnedForDeepEquality = !0), - (child[0] = reusableDeeplyEqualPropsEntry), - (reusableComponentDevToolDetails.color = "warning"), - (reusableComponentDevToolDetails.tooltipText = - "This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.")) - : ((reusableComponentDevToolDetails.color = selfTime), - (reusableComponentDevToolDetails.tooltipText = name)), - (reusableComponentDevToolDetails.properties = child), - (reusableComponentOptions.start = startTime), - (reusableComponentOptions.end = endTime), - (fiber = "\u200b" + name), - null != wasHydrated - ? wasHydrated.run( - performance.measure.bind( - performance, - fiber, - reusableComponentOptions - ) - ) - : performance.measure(fiber, reusableComponentOptions), - performance.clearMeasures(fiber)) - : null != wasHydrated - ? wasHydrated.run( - console.timeStamp.bind( - console, - name, - startTime, - endTime, - "Components \u269b", - void 0, - selfTime - ) - ) - : console.timeStamp( - name, - startTime, - endTime, - "Components \u269b", - void 0, - selfTime - )) - : null != wasHydrated - ? wasHydrated.run( - console.timeStamp.bind( - console, - name, - startTime, - endTime, - "Components \u269b", - void 0, - selfTime - ) - ) - : console.timeStamp( - name, - startTime, - endTime, - "Components \u269b", - void 0, - selfTime - ); - } + function createViewTransitionInstance(name) { + var tag = allocateTag(); + fabricCreateViewTransitionInstance(name, tag); + return { + name: name, + old: new ViewTransitionPseudoElement("old", name), + new: new ViewTransitionPseudoElement("new", name) + }; } - function logComponentErrored(fiber, startTime, endTime, errors) { - if (supportsUserTiming) { - var name = getComponentNameFromFiber(fiber); - if (null !== name) { - for ( - var debugTask = null, properties = [], i = 0; - i < errors.length; - i++ - ) { - var capturedValue = errors[i]; - null == debugTask && - null !== capturedValue.source && - (debugTask = capturedValue.source._debugTask); - capturedValue = capturedValue.value; - properties.push([ - "Error", - "object" === typeof capturedValue && - null !== capturedValue && - "string" === typeof capturedValue.message - ? String(capturedValue.message) - : String(capturedValue) - ]); - } - null !== fiber.key && - addValueToProperties("key", fiber.key, properties, 0, ""); - null !== fiber.memoizedProps && - addObjectToProperties(fiber.memoizedProps, properties, 0, ""); - null == debugTask && (debugTask = fiber._debugTask); - fiber = { - start: startTime, - end: endTime, - detail: { - devtools: { - color: "error", - track: "Components \u269b", - tooltipText: - 13 === fiber.tag - ? "Hydration failed" - : "Error boundary caught an error", - properties: properties - } - } - }; - name = "\u200b" + name; - debugTask - ? debugTask.run(performance.measure.bind(performance, name, fiber)) - : performance.measure(name, fiber); - performance.clearMeasures(name); + function startViewTransition( + suspendedState, + rootContainer, + transitionTypes, + mutationCallback, + layoutCallback, + afterMutationCallback, + spawnedWorkCallback, + passiveCallback + ) { + suspendedState = fabricStartViewTransition(function () { + mutationCallback(); + layoutCallback(); + afterMutationCallback(); + }); + if (null == suspendedState) + return ( + console.warn( + "startViewTransition didn't kick off transition in Fabric, the ViewTransition ReactNativeFeatureFlag might not be enabled." + ), + mutationCallback(), + layoutCallback(), + spawnedWorkCallback(), + null + ); + suspendedState.ready.then(function () { + spawnedWorkCallback(); + fabricStartViewTransitionReadyFinished(); + }); + suspendedState.finished.finally(function () { + passiveCallback(); + }); + return suspendedState; + } + function allocateTag() { + var tag = nextReactTag; + nextReactTag += 2; + return tag; + } + function createTextInstance( + text, + rootContainerInstance, + hostContext, + internalInstanceHandle + ) { + hostContext.isInAParentText || + console.error( + "Text strings must be rendered within a component." + ); + hostContext = allocateTag(); + return { + node: createNode( + hostContext, + "RCTRawText", + rootContainerInstance.containerTag, + { text: text }, + internalInstanceHandle + ) + }; + } + function getPublicInstance(instance) { + if (null != instance.canonical) { + if (null == instance.canonical.publicInstance) { + var $jscomp$nullish$tmp0; + instance.canonical.publicInstance = + reactPrivateInterface.createPublicInstance( + instance.canonical.nativeTag, + instance.canonical.viewConfig, + instance.canonical.internalInstanceHandle, + null != + ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) + ? $jscomp$nullish$tmp0 + : null + ); + instance.canonical.publicRootInstance = null; } + return instance.canonical.publicInstance; } + return null != instance.containerInfo + ? instance.containerInfo.publicInstance + : null; } - function logComponentEffect(fiber, startTime, endTime, selfTime, errors) { - if (null !== errors) { - if (supportsUserTiming) { - var name = getComponentNameFromFiber(fiber); - if (null !== name) { - selfTime = []; - for (var i = 0; i < errors.length; i++) { - var error = errors[i].value; - selfTime.push([ - "Error", - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error) - ]); - } - null !== fiber.key && - addValueToProperties("key", fiber.key, selfTime, 0, ""); - null !== fiber.memoizedProps && - addObjectToProperties(fiber.memoizedProps, selfTime, 0, ""); - startTime = { - start: startTime, - end: endTime, - detail: { - devtools: { - color: "error", - track: "Components \u269b", - tooltipText: "A lifecycle or effect errored", - properties: selfTime - } - } - }; - fiber = fiber._debugTask; - endTime = "\u200b" + name; - fiber - ? fiber.run( - performance.measure.bind(performance, endTime, startTime) - ) - : performance.measure(endTime, startTime); - performance.clearMeasures(endTime); - } + function getPublicInstanceFromHostFiber(fiber) { + fiber = getPublicInstance(fiber.stateNode); + if (null === fiber) + throw Error("Expected to find a host node. This is a bug in React."); + return fiber; + } + function resolveUpdatePriority() { + if (0 !== currentUpdatePriority) return currentUpdatePriority; + var currentEventPriority = fabricGetCurrentEventPriority + ? fabricGetCurrentEventPriority() + : null; + if (null != currentEventPriority) + switch (currentEventPriority) { + case FabricDiscretePriority: + return DiscreteEventPriority; + case FabricContinuousPriority: + return ContinuousEventPriority; + case FabricIdlePriority: + return IdleEventPriority; } - } else - (name = getComponentNameFromFiber(fiber)), - null !== name && - supportsUserTiming && - ((errors = - 1 > selfTime - ? "secondary-light" - : 100 > selfTime - ? "secondary" - : 500 > selfTime - ? "secondary-dark" - : "error"), - (fiber = fiber._debugTask) - ? fiber.run( - console.timeStamp.bind( - console, - name, - startTime, - endTime, - "Components \u269b", - void 0, - errors - ) - ) - : console.timeStamp( - name, - startTime, - endTime, - "Components \u269b", - void 0, - errors - )); + return DefaultEventPriority; } - function logSuspendedRenderPhase(startTime, endTime, lanes, debugTask) { - !supportsUserTiming || - endTime <= startTime || - ((lanes = - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), - debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - "Prewarm", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - lanes - ) - ) - : console.timeStamp( - "Prewarm", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - lanes - )); + function resolveEventType() { + var event = global.event; + event && event !== schedulerEvent + ? event.type + ? (event = event.type) + : ((event = event.dispatchConfig), + (event = + null == event || null == event.phasedRegistrationNames + ? null + : (event = + event.phasedRegistrationNames.bubbled || + event.phasedRegistrationNames.captured) + ? event.startsWith("on") + ? event.slice(2).toLowerCase() + : event.toLowerCase() + : null)) + : (event = null); + return event; } - function logSuspendedWithDelayPhase(startTime, endTime, lanes, debugTask) { - !supportsUserTiming || - endTime <= startTime || - ((lanes = - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), - debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - "Suspended", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - lanes - ) - ) - : console.timeStamp( - "Suspended", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - lanes - )); + function resolveEventTimeStamp() { + var event = global.event; + return event && event !== schedulerEvent ? event.timeStamp : -1.1; } - function logErroredRenderPhase(startTime, endTime, lanes, debugTask) { - !supportsUserTiming || - endTime <= startTime || - (debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - "Errored", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "error" - ) - ) - : console.timeStamp( - "Errored", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "error" - )); + function cloneHiddenInstance(instance) { + var node = instance.node, + updatePayload = reactPrivateInterface.createAttributePayload( + { style: { display: "none" } }, + instance.canonical.viewConfig.validAttributes + ); + return { + node: cloneNodeWithNewProps(node, updatePayload), + canonical: instance.canonical + }; } - function logSuspendedCommitPhase(startTime, endTime, reason, debugTask) { - !supportsUserTiming || - endTime <= startTime || - (debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - reason, - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "secondary-light" - ) - ) - : console.timeStamp( - reason, - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "secondary-light" - )); + function replaceContainerChildren(container, newChildren) { + completeRoot$1(container.containerTag, newChildren); } - function logCommitErrored(startTime, endTime, errors, passive, debugTask) { - if (supportsUserTiming && !(endTime <= startTime)) { - for (var properties = [], i = 0; i < errors.length; i++) { - var error = errors[i].value; - properties.push([ - "Error", - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error) - ]); - } - startTime = { - start: startTime, - end: endTime, - detail: { - devtools: { - color: "error", - track: currentTrack, - trackGroup: "Scheduler \u269b", - tooltipText: passive - ? "Remaining Effects Errored" - : "Commit Errored", - properties: properties - } - } - }; - debugTask - ? debugTask.run( - performance.measure.bind(performance, "Errored", startTime) - ) - : performance.measure("Errored", startTime); - performance.clearMeasures("Errored"); - } + function FragmentInstance(fragmentFiber) { + this._fragmentFiber = fragmentFiber; + this._observers = null; } - function logCommitPhase( - startTime, - endTime, - errors, - abortedViewTransition, - debugTask - ) { - null !== errors - ? logCommitErrored(startTime, endTime, errors, !1, debugTask) - : !supportsUserTiming || - endTime <= startTime || - (debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - abortedViewTransition - ? "Commit Interrupted View Transition" - : "Commit", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - abortedViewTransition ? "error" : "secondary-dark" - ) - ) - : console.timeStamp( - abortedViewTransition - ? "Commit Interrupted View Transition" - : "Commit", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - abortedViewTransition ? "error" : "secondary-dark" - )); + function observeChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.observe(child); + return !1; } - function logAnimatingPhase(startTime, endTime, debugTask) { - !supportsUserTiming || - endTime <= startTime || - (debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - "Animating", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "secondary-dark" - ) - ) - : console.timeStamp( - "Animating", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "secondary-dark" - )); + function unobserveChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.unobserve(child); + return !1; } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; + function collectChildren(child, collection) { + collection.push(child); + return !1; } - function requiredContext(c) { - null === c && - console.error( - "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." - ); - return c; + function collectClientRects(child, rects) { + child = getPublicInstanceFromHostFiber(child); + rects.push(child.getBoundingClientRect()); + return !1; } - function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance, fiber); - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, null, fiber); - nextRootInstance = { isInAParentText: !1 }; - pop(contextStackCursor, fiber); - push(contextStackCursor, nextRootInstance, fiber); + function addFragmentHandleToFiber(child, fragmentInstance) { + child = getPublicInstanceFromHostFiber(child); + null != child && addFragmentHandleToInstance(child, fragmentInstance); + return !1; } - function popHostContainer(fiber) { - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); + function addFragmentHandleToInstance(instance, fragmentInstance) { + null == instance.reactFragments && (instance.reactFragments = new Set()); + instance.reactFragments.add(fragmentInstance); } - function pushHostContext(fiber) { - var stateHook = fiber.memoizedState; - null !== stateHook && - ((HostTransitionContext._currentValue2 = stateHook.memoizedState), - push(hostTransitionProviderCursor, fiber, fiber)); - stateHook = requiredContext(contextStackCursor.current); - var nextContext = fiber.type; - nextContext = - "AndroidTextInput" === nextContext || - "RCTMultilineTextInputView" === nextContext || - "RCTSelectableText" === nextContext || - "RCTSinglelineTextInputView" === nextContext || - "RCTText" === nextContext || - "RCTVirtualText" === nextContext; - nextContext = - stateHook.isInAParentText !== nextContext - ? { isInAParentText: nextContext } - : stateHook; - stateHook !== nextContext && - (push(contextFiberStackCursor, fiber, fiber), - push(contextStackCursor, nextContext, fiber)); + function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { + if (null != childInstance.canonical) { + var publicInstance = getPublicInstance(childInstance); + if (null !== fragmentInstance._observers) { + if (null == publicInstance) + throw Error( + "Expected to find a host node. This is a bug in React." + ); + fragmentInstance._observers.forEach(function (observer) { + observer.observe(publicInstance); + }); + } + addFragmentHandleToInstance(publicInstance, fragmentInstance); + } } - function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor, fiber), - (HostTransitionContext._currentValue2 = NotPendingTransition)); + function createCursor(defaultValue) { + return { current: defaultValue }; } - function findNotableNode(node, indent) { - return void 0 === node.serverProps && - 0 === node.serverTail.length && - 1 === node.children.length && - 3 < node.distanceFromLeaf && - node.distanceFromLeaf > 15 - indent - ? findNotableNode(node.children[0], indent) - : node; + function pop(cursor, fiber) { + 0 > index$jscomp$0 + ? console.error("Unexpected pop.") + : (fiber !== fiberStack[index$jscomp$0] && + console.error("Unexpected Fiber popped."), + (cursor.current = valueStack[index$jscomp$0]), + (valueStack[index$jscomp$0] = null), + (fiberStack[index$jscomp$0] = null), + index$jscomp$0--); } - function indentation(indent) { - return " " + " ".repeat(indent); + function push(cursor, value, fiber) { + index$jscomp$0++; + valueStack[index$jscomp$0] = cursor.current; + fiberStack[index$jscomp$0] = fiber; + cursor.current = value; } - function added(indent) { - return "+ " + " ".repeat(indent); + function getViewTransitionName(props, instance) { + if (null != props.name && "auto" !== props.name) return props.name; + if (null !== instance.autoName) return instance.autoName; + props = pendingEffectsRoot.identifierPrefix; + var globalClientId = globalClientIdCounter$1++; + props = "_" + props + "t_" + globalClientId.toString(32) + "_"; + return (instance.autoName = props); } - function removed(indent) { - return "- " + " ".repeat(indent); + function getClassNameByType(classByType) { + if (null == classByType || "string" === typeof classByType) + return classByType; + var className = null, + activeTypes = pendingTransitionTypes; + if (null !== activeTypes) + for (var i = 0; i < activeTypes.length; i++) { + var match = classByType[activeTypes[i]]; + if (null != match) { + if ("none" === match) return "none"; + className = null == className ? match : className + (" " + match); + } + } + return null == className ? classByType.default : className; } - function describeFiberType(fiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return fiber.type; - case 16: - return "Lazy"; - case 31: - return "Activity"; - case 13: - return "Suspense"; - case 19: - return "SuspenseList"; - case 0: - case 15: - return (fiber = fiber.type), fiber.displayName || fiber.name || null; - case 11: - return ( - (fiber = fiber.type.render), fiber.displayName || fiber.name || null - ); - case 1: - return (fiber = fiber.type), fiber.displayName || fiber.name || null; - default: - return null; - } + function getViewTransitionClassName(defaultClass, eventClass) { + defaultClass = getClassNameByType(defaultClass); + eventClass = getClassNameByType(eventClass); + return null == eventClass + ? "auto" === defaultClass + ? null + : defaultClass + : "auto" === eventClass + ? null + : eventClass; } - function describeTextNode(content, maxLength) { - return needsEscaping.test(content) - ? ((content = JSON.stringify(content)), - content.length > maxLength - 2 - ? 8 > maxLength - ? '{"..."}' - : "{" + content.slice(0, maxLength - 7) + '..."}' - : "{" + content + "}") - : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + function noop() {} + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } - function describeTextDiff(clientText, serverProps, indent) { - var maxLength = 120 - 2 * indent; - if (null === serverProps) - return added(indent) + describeTextNode(clientText, maxLength) + "\n"; - if ("string" === typeof serverProps) { - for ( - var firstDiff = 0; - firstDiff < serverProps.length && - firstDiff < clientText.length && - serverProps.charCodeAt(firstDiff) === - clientText.charCodeAt(firstDiff); - firstDiff++ - ); - firstDiff > maxLength - 8 && - 10 < firstDiff && - ((clientText = "..." + clientText.slice(firstDiff - 8)), - (serverProps = "..." + serverProps.slice(firstDiff - 8))); - return ( - added(indent) + - describeTextNode(clientText, maxLength) + - "\n" + - removed(indent) + - describeTextNode(serverProps, maxLength) + - "\n" - ); + function getArrayKind(array) { + for (var kind = 0, i = 0; i < array.length && 100 > i; i++) { + var value = array[i]; + if ("object" === typeof value && null !== value) + if ( + isArrayImpl(value) && + 2 === value.length && + "string" === typeof value[0] + ) { + if (0 !== kind && 3 !== kind) return 1; + kind = 3; + } else return 1; + else { + if ( + "function" === typeof value || + ("string" === typeof value && 50 < value.length) || + (0 !== kind && 2 !== kind) || + "bigint" === typeof value + ) + return 1; + kind = 2; + } } - return ( - indentation(indent) + describeTextNode(clientText, maxLength) + "\n" - ); - } - function objectName(object) { - return Object.prototype.toString - .call(object) - .replace(/^\[object (.*)\]$/, function (m, p0) { - return p0; - }); + return kind; } - function describeValue(value, maxLength) { - switch (typeof value) { - case "string": - return ( - (value = JSON.stringify(value)), - value.length > maxLength - ? 5 > maxLength - ? '"..."' - : value.slice(0, maxLength - 4) + '..."' - : value - ); - case "object": - if (null === value) return "null"; - if (isArrayImpl(value)) return "[...]"; - if (value.$$typeof === REACT_ELEMENT_TYPE) - return (maxLength = getComponentNameFromType(value.type)) - ? "<" + maxLength + ">" - : "<...>"; - var name = objectName(value); - if ("Object" === name) { - name = ""; - maxLength -= 2; - for (var propName in value) - if (value.hasOwnProperty(propName)) { - var jsonPropName = JSON.stringify(propName); - jsonPropName !== '"' + propName + '"' && - (propName = jsonPropName); - maxLength -= propName.length - 2; - jsonPropName = describeValue( - value[propName], - 15 > maxLength ? maxLength : 15 - ); - maxLength -= jsonPropName.length; - if (0 > maxLength) { - name += "" === name ? "..." : ", ..."; - break; - } - name += - ("" === name ? "" : ",") + propName + ":" + jsonPropName; - } - return "{" + name + "}"; + function addObjectToProperties(object, properties, indent, prefix) { + if (!ArrayBuffer.isView(object)) { + var addedProperties = 0, + key; + for (key in object) + if ( + hasOwnProperty.call(object, key) && + "_" !== key[0] && + (addedProperties++, + addValueToProperties(key, object[key], properties, indent, prefix), + 100 <= addedProperties) + ) { + properties.push([ + prefix + + "\u00a0\u00a0".repeat(indent) + + "Only 100 properties are shown. React will not log more properties of this object.", + "" + ]); + break; } - return name; - case "function": - return (maxLength = value.displayName || value.name) - ? "function " + maxLength - : "function"; - default: - return String(value); } } - function describePropValue(value, maxLength) { - return "string" !== typeof value || needsEscaping.test(value) - ? "{" + describeValue(value, maxLength - 2) + "}" - : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; - } - function describeExpandedElement(type, props, rowPrefix) { - var remainingRowLength = 120 - rowPrefix.length - type.length, - properties = [], - propName; - for (propName in props) - if (props.hasOwnProperty(propName) && "children" !== propName) { - var propValue = describePropValue( - props[propName], - 120 - rowPrefix.length - propName.length - 1 - ); - remainingRowLength -= propName.length + propValue.length + 2; - properties.push(propName + "=" + propValue); - } - return 0 === properties.length - ? rowPrefix + "<" + type + ">\n" - : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; - } - function describePropertiesDiff(clientObject, serverObject, indent) { - var properties = "", - remainingServerProperties = assign({}, serverObject), - propName; - for (propName in clientObject) - if (clientObject.hasOwnProperty(propName)) { - delete remainingServerProperties[propName]; - var maxLength = 120 - 2 * indent - propName.length - 2, - clientPropValue = describeValue(clientObject[propName], maxLength); - serverObject.hasOwnProperty(propName) - ? ((maxLength = describeValue(serverObject[propName], maxLength)), - (properties += - added(indent) + propName + ": " + clientPropValue + "\n"), - (properties += - removed(indent) + propName + ": " + maxLength + "\n")) - : (properties += - added(indent) + propName + ": " + clientPropValue + "\n"); - } - for (var _propName in remainingServerProperties) - remainingServerProperties.hasOwnProperty(_propName) && - ((clientObject = describeValue( - remainingServerProperties[_propName], - 120 - 2 * indent - _propName.length - 2 - )), - (properties += - removed(indent) + _propName + ": " + clientObject + "\n")); - return properties; - } - function describeElementDiff(type, clientProps, serverProps, indent) { - var content = "", - serverPropNames = new Map(); - for (propName$jscomp$0 in serverProps) - serverProps.hasOwnProperty(propName$jscomp$0) && - serverPropNames.set( - propName$jscomp$0.toLowerCase(), - propName$jscomp$0 - ); - if (1 === serverPropNames.size && serverPropNames.has("children")) - content += describeExpandedElement( - type, - clientProps, - indentation(indent) - ); - else { - for (var _propName2 in clientProps) - if ( - clientProps.hasOwnProperty(_propName2) && - "children" !== _propName2 - ) { - var maxLength$jscomp$0 = - 120 - 2 * (indent + 1) - _propName2.length - 1, - serverPropName = serverPropNames.get(_propName2.toLowerCase()); - if (void 0 !== serverPropName) { - serverPropNames.delete(_propName2.toLowerCase()); - var propName$jscomp$0 = clientProps[_propName2]; - serverPropName = serverProps[serverPropName]; - var clientPropValue = describePropValue( - propName$jscomp$0, - maxLength$jscomp$0 - ); - maxLength$jscomp$0 = describePropValue( - serverPropName, - maxLength$jscomp$0 - ); - "object" === typeof propName$jscomp$0 && - null !== propName$jscomp$0 && - "object" === typeof serverPropName && - null !== serverPropName && - "Object" === objectName(propName$jscomp$0) && - "Object" === objectName(serverPropName) && - (2 < Object.keys(propName$jscomp$0).length || - 2 < Object.keys(serverPropName).length || - -1 < clientPropValue.indexOf("...") || - -1 < maxLength$jscomp$0.indexOf("...")) - ? (content += - indentation(indent + 1) + - _propName2 + - "={{\n" + - describePropertiesDiff( - propName$jscomp$0, - serverPropName, - indent + 2 - ) + - indentation(indent + 1) + - "}}\n") - : ((content += - added(indent + 1) + - _propName2 + - "=" + - clientPropValue + - "\n"), - (content += - removed(indent + 1) + - _propName2 + - "=" + - maxLength$jscomp$0 + - "\n")); - } else - content += - indentation(indent + 1) + - _propName2 + - "=" + - describePropValue(clientProps[_propName2], maxLength$jscomp$0) + - "\n"; - } - serverPropNames.forEach(function (propName) { - if ("children" !== propName) { - var maxLength = 120 - 2 * (indent + 1) - propName.length - 1; - content += - removed(indent + 1) + - propName + - "=" + - describePropValue(serverProps[propName], maxLength) + - "\n"; - } - }); - content = - "" === content - ? indentation(indent) + "<" + type + ">\n" - : indentation(indent) + - "<" + - type + - "\n" + - content + - indentation(indent) + - ">\n"; - } - type = serverProps.children; - clientProps = clientProps.children; - if ( - "string" === typeof type || - "number" === typeof type || - "bigint" === typeof type - ) { - serverPropNames = ""; - if ( - "string" === typeof clientProps || - "number" === typeof clientProps || - "bigint" === typeof clientProps - ) - serverPropNames = "" + clientProps; - content += describeTextDiff(serverPropNames, "" + type, indent + 1); - } else if ( - "string" === typeof clientProps || - "number" === typeof clientProps || - "bigint" === typeof clientProps - ) - content = - null == type - ? content + describeTextDiff("" + clientProps, null, indent + 1) - : content + describeTextDiff("" + clientProps, void 0, indent + 1); - return content; - } - function describeSiblingFiber(fiber, indent) { - var type = describeFiberType(fiber); - if (null === type) { - type = ""; - for (fiber = fiber.child; fiber; ) - (type += describeSiblingFiber(fiber, indent)), - (fiber = fiber.sibling); - return type; - } - return indentation(indent) + "<" + type + ">\n"; + function readReactElementTypeof(value) { + return "$$typeof" in value && hasOwnProperty.call(value, "$$typeof") + ? value.$$typeof + : void 0; } - function describeNode(node, indent) { - var skipToNode = findNotableNode(node, indent); - if ( - skipToNode !== node && - (1 !== node.children.length || node.children[0] !== skipToNode) - ) - return ( - indentation(indent) + "...\n" + describeNode(skipToNode, indent + 1) - ); - skipToNode = ""; - var debugInfo = node.fiber._debugInfo; - if (debugInfo) - for (var i = 0; i < debugInfo.length; i++) { - var serverComponentName = debugInfo[i].name; - "string" === typeof serverComponentName && - ((skipToNode += - indentation(indent) + "<" + serverComponentName + ">\n"), - indent++); - } - debugInfo = ""; - i = node.fiber.pendingProps; - if (6 === node.fiber.tag) - (debugInfo = describeTextDiff(i, node.serverProps, indent)), indent++; - else if ( - ((serverComponentName = describeFiberType(node.fiber)), - null !== serverComponentName) - ) - if (void 0 === node.serverProps) { - debugInfo = indent; - var maxLength = 120 - 2 * debugInfo - serverComponentName.length - 2, - content = ""; - for (propName in i) - if (i.hasOwnProperty(propName) && "children" !== propName) { - var propValue = describePropValue(i[propName], 15); - maxLength -= propName.length + propValue.length + 2; - if (0 > maxLength) { - content += " ..."; + function addValueToProperties( + propertyName, + value, + properties, + indent, + prefix + ) { + switch (typeof value) { + case "object": + if (null === value) { + value = "null"; + break; + } else { + if (readReactElementTypeof(value) === REACT_ELEMENT_TYPE) { + var typeName = getComponentNameFromType(value.type) || "\u2026", + key = value.key; + value = value.props; + var propsKeys = Object.keys(value), + propsLength = propsKeys.length; + if (null == key && 0 === propsLength) { + value = "<" + typeName + " />"; break; } - content += " " + propName + "=" + propValue; - } - debugInfo = - indentation(debugInfo) + - "<" + - serverComponentName + - content + - ">\n"; - indent++; - } else - null === node.serverProps - ? ((debugInfo = describeExpandedElement( - serverComponentName, - i, - added(indent) - )), - indent++) - : "string" === typeof node.serverProps - ? console.error( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent - )), - indent++); - var propName = ""; - i = node.fiber.child; - for ( - serverComponentName = 0; - i && serverComponentName < node.children.length; - - ) - (maxLength = node.children[serverComponentName]), - maxLength.fiber === i - ? ((propName += describeNode(maxLength, indent)), - serverComponentName++) - : (propName += describeSiblingFiber(i, indent)), - (i = i.sibling); - i && - 0 < node.children.length && - (propName += indentation(indent) + "...\n"); - i = node.serverTail; - null === node.serverProps && indent--; - for (node = 0; node < i.length; node++) - (serverComponentName = i[node]), - (propName = - "string" === typeof serverComponentName - ? propName + - (removed(indent) + - describeTextNode(serverComponentName, 120 - 2 * indent) + - "\n") - : propName + - describeExpandedElement( - serverComponentName.type, - serverComponentName.props, - removed(indent) - )); - return skipToNode + debugInfo + propName; - } - function upgradeHydrationErrorsToRecoverable() { - var queuedErrors = hydrationErrors; - null !== queuedErrors && - (null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = queuedErrors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - queuedErrors - ), - (hydrationErrors = null)); - return queuedErrors; - } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - if (null !== diffRoot) { - hydrationDiffRootDEV = null; - try { - var diff = "\n\n" + describeNode(diffRoot, 0); - } catch (x) { - diff = ""; - } - for (; 0 < diffRoot.children.length; ) diffRoot = diffRoot.children[0]; - runWithFiberInDEV(diffRoot.fiber, function () { - console.error( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diff - ); - }); - } - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber$1 = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2, providerFiber); - context._currentValue2 = nextValue; - push(renderer2CursorDEV, context._currentRenderer2, providerFiber); - void 0 !== context._currentRenderer2 && - null !== context._currentRenderer2 && - context._currentRenderer2 !== rendererSigil && - console.error( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer2 = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue2 = valueCursor.current; - var currentRenderer2 = renderer2CursorDEV.current; - pop(renderer2CursorDEV, providerFiber); - context._currentRenderer2 = currentRenderer2; - pop(valueCursor, providerFiber); - } - function scheduleContextWorkOnParentPath( - parent, - renderLanes, - propagationRoot - ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - console.error( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; + if ( + 3 > indent || + (1 === propsLength && + "children" === propsKeys[0] && + null == key) + ) { + value = "<" + typeName + " \u2026 />"; + break; } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else - 13 === fiber.tag && - null !== fiber.memoizedState && - null === fiber.memoizedState.dehydrated - ? ((fiber.lanes |= renderLanes), - (nextFiber = fiber.alternate), - null !== nextFiber && (nextFiber.lanes |= renderLanes), - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ), - (nextFiber = fiber.child), - (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) - : (nextFiber = fiber.child); - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; + properties.push([ + prefix + "\u00a0\u00a0".repeat(indent) + propertyName, + "<" + typeName + ]); + null !== key && + addValueToProperties( + "key", + key, + properties, + indent + 1, + prefix + ); + propertyName = !1; + key = 0; + for (var propKey in value) + if ( + (key++, + "children" === propKey + ? null != value.children && + (!isArrayImpl(value.children) || + 0 < value.children.length) && + (propertyName = !0) + : hasOwnProperty.call(value, propKey) && + "_" !== propKey[0] && + addValueToProperties( + propKey, + value[propKey], + properties, + indent + 1, + prefix + ), + 100 <= key) + ) + break; + properties.push([ + "", + propertyName ? ">\u2026" : "/>" + ]); + return; + } + typeName = Object.prototype.toString.call(value); + typeName = typeName.slice(8, typeName.length - 1); + if (ArrayBuffer.isView(value)) { + value = value.length; + value = + "number" === typeof value + ? typeName + "(" + value + ")" + : typeName; break; } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + if ("Array" === typeName) + if ( + ((propKey = 100 < value.length), + (key = getArrayKind(value)), + 2 === key || 0 === key) + ) { + value = JSON.stringify( + propKey ? value.slice(0, 100).concat("\u2026") : value + ); + break; + } else if (3 === key) { + properties.push([ + prefix + "\u00a0\u00a0".repeat(indent) + propertyName, + "" + ]); + for ( + propertyName = 0; + propertyName < value.length && 100 > propertyName; + propertyName++ + ) + (typeName = value[propertyName]), + addValueToProperties( + typeName[0], + typeName[1], + properties, + indent + 1, + prefix + ); + propKey && + addValueToProperties( + (100).toString(), + "\u2026", + properties, + indent + 1, + prefix + ); + return; + } + if ("Promise" === typeName) { + if ("fulfilled" === value.status) { + if ( + ((typeName = properties.length), + addValueToProperties( + propertyName, + value.value, + properties, + indent, + prefix + ), + properties.length > typeName) + ) { + properties = properties[typeName]; + properties[1] = + "Promise<" + (properties[1] || "Object") + ">"; + return; + } + } else if ( + "rejected" === value.status && + ((typeName = properties.length), + addValueToProperties( + propertyName, + value.reason, + properties, + indent, + prefix + ), + properties.length > typeName) + ) { + properties = properties[typeName]; + properties[1] = "Rejected Promise<" + properties[1] + ">"; + return; + } + properties.push([ + "\u00a0\u00a0".repeat(indent) + propertyName, + "Promise" + ]); + return; } - nextFiber = nextFiber.return; + "Object" === typeName && + (propKey = Object.getPrototypeOf(value)) && + "function" === typeof propKey.constructor && + (typeName = propKey.constructor.name); + properties.push([ + prefix + "\u00a0\u00a0".repeat(indent) + propertyName, + "Object" === typeName ? (3 > indent ? "" : "\u2026") : typeName + ]); + 3 > indent && + addObjectToProperties(value, properties, indent + 1, prefix); + return; } - fiber = nextFiber; + case "function": + value = value.name; + value = + "" === value || "string" !== typeof value + ? "() => {}" + : value + "() {}"; + break; + case "string": + value = + "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects." === + value + ? "\u2026" + : JSON.stringify( + 1024 <= value.length ? value.slice(0, 1023) + "\u2026" : value + ); + break; + case "undefined": + value = "undefined"; + break; + case "boolean": + value = value ? "true" : "false"; + break; + default: + value = String(value); } + properties.push([ + prefix + "\u00a0\u00a0".repeat(indent) + propertyName, + value + ]); } - function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree - ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + function addObjectDiffToProperties(prev, next, properties, indent) { + var isDeeplyEqual = !0, + prevPropertiesChecked = 0; + for (key in prev) { + if (100 < prevPropertiesChecked) { + properties.push([ + "Previous object has more than 100 properties. React will not attempt to diff objects with too many properties.", + "" + ]); + isDeeplyEqual = !1; + break; } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - return null !== current; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; + key in next || + (properties.push([ + "-\u00a0" + "\u00a0\u00a0".repeat(indent) + key, + "\u2026" + ]), + (isDeeplyEqual = !1)); + prevPropertiesChecked++; } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber$1 = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - console.error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber$1, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - 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 queueTransitionTypes(root, transitionTypes) { - if (0 !== (root.pendingLanes & 4194048)) { - var queued = root.transitionTypes; - null === queued && (queued = root.transitionTypes = []); - for (root = 0; root < transitionTypes.length; root++) { - var transitionType = transitionTypes[root]; - -1 === queued.indexOf(transitionType) && queued.push(transitionType); + prevPropertiesChecked = 0; + for (var _key in next) { + if (100 < prevPropertiesChecked) { + properties.push([ + "Next object has more than 100 properties. React will not attempt to diff objects with too many properties.", + "" + ]); + isDeeplyEqual = !1; + break; } + if (_key in prev) { + var key = prev[_key]; + var nextValue = next[_key]; + if (key !== nextValue) { + if (0 === indent && "children" === _key) { + isDeeplyEqual = "\u00a0\u00a0".repeat(indent) + _key; + properties.push( + ["-\u00a0" + isDeeplyEqual, "\u2026"], + ["+\u00a0" + isDeeplyEqual, "\u2026"] + ); + isDeeplyEqual = !1; + continue; + } + if (!(3 <= indent)) + if ( + "object" === typeof key && + "object" === typeof nextValue && + null !== key && + null !== nextValue && + readReactElementTypeof(key) === + readReactElementTypeof(nextValue) + ) + if (readReactElementTypeof(nextValue) === REACT_ELEMENT_TYPE) { + if ( + key.type === nextValue.type && + key.key === nextValue.key + ) { + key = getComponentNameFromType(nextValue.type) || "\u2026"; + isDeeplyEqual = "\u00a0\u00a0".repeat(indent) + _key; + key = "<" + key + " \u2026 />"; + properties.push( + ["-\u00a0" + isDeeplyEqual, key], + ["+\u00a0" + isDeeplyEqual, key] + ); + isDeeplyEqual = !1; + continue; + } + } else { + var prevKind = Object.prototype.toString.call(key), + nextKind = Object.prototype.toString.call(nextValue); + if ( + prevKind === nextKind && + ("[object Object]" === nextKind || + "[object Array]" === nextKind) + ) { + prevKind = [ + "\u2007\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, + "[object Array]" === nextKind ? "Array" : "" + ]; + properties.push(prevKind); + nextKind = properties.length; + addObjectDiffToProperties( + key, + nextValue, + properties, + indent + 1 + ) + ? nextKind === properties.length && + (prevKind[1] = + "Referentially unequal but deeply equal objects. Consider memoization.") + : (isDeeplyEqual = !1); + continue; + } + } + else if ( + "function" === typeof key && + "function" === typeof nextValue && + key.name === nextValue.name && + key.length === nextValue.length && + ((prevKind = Function.prototype.toString.call(key)), + (nextKind = Function.prototype.toString.call(nextValue)), + prevKind === nextKind) + ) { + key = + "" === nextValue.name ? "() => {}" : nextValue.name + "() {}"; + properties.push([ + "\u2007\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, + key + + " Referentially unequal function closure. Consider memoization." + ]); + continue; + } + addValueToProperties(_key, key, properties, indent, "-\u00a0"); + addValueToProperties( + _key, + nextValue, + properties, + indent, + "+\u00a0" + ); + isDeeplyEqual = !1; + } + } else + properties.push([ + "+\u00a0" + "\u00a0\u00a0".repeat(indent) + _key, + "\u2026" + ]), + (isDeeplyEqual = !1); + prevPropertiesChecked++; } + return isDeeplyEqual; } - function claimQueuedTransitionTypes(root) { - var claimed = root.transitionTypes; - root.transitionTypes = null; - return claimed; - } - function startUpdateTimerByLane(lane, method, fiber) { - if (0 !== (lane & 127)) - 0 > blockingUpdateTime && - ((blockingUpdateTime = now()), - (blockingUpdateTask = createTask(method)), - (blockingUpdateMethodName = method), - null != fiber && - (blockingUpdateComponentName = getComponentNameFromFiber(fiber)), - (executionContext & (RenderContext | CommitContext)) !== NoContext && - ((componentEffectSpawnedUpdate = !0), (blockingUpdateType = 1)), - (lane = resolveEventTimeStamp()), - (method = resolveEventType()), - lane !== blockingEventRepeatTime || method !== blockingEventType - ? (blockingEventRepeatTime = -1.1) - : null !== method && (blockingUpdateType = 1), - (blockingEventTime = lane), - (blockingEventType = method)); - else if ( - 0 !== (lane & 4194048) && - 0 > transitionUpdateTime && - ((transitionUpdateTime = now()), - (transitionUpdateTask = createTask(method)), - (transitionUpdateMethodName = method), - null != fiber && - (transitionUpdateComponentName = getComponentNameFromFiber(fiber)), - 0 > transitionStartTime) - ) { - lane = resolveEventTimeStamp(); - method = resolveEventType(); - if ( - lane !== transitionEventRepeatTime || - method !== transitionEventType - ) - transitionEventRepeatTime = -1.1; - transitionEventTime = lane; - transitionEventType = method; - } - } - function pushNestedEffectDurations() { - var prevEffectDuration = profilerEffectDuration; - profilerEffectDuration = 0; - return prevEffectDuration; - } - function popNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration = prevEffectDuration; - return elapsedTime; - } - function bubbleNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration += prevEffectDuration; - return elapsedTime; - } - function resetComponentEffectTimers() { - componentEffectEndTime = componentEffectStartTime = -1.1; - } - function pushComponentEffectStart() { - var prevEffectStart = componentEffectStartTime; - componentEffectStartTime = -1.1; - return prevEffectStart; - } - function popComponentEffectStart(prevEffectStart) { - 0 <= prevEffectStart && (componentEffectStartTime = prevEffectStart); - } - function pushComponentEffectDuration() { - var prevEffectDuration = componentEffectDuration; - componentEffectDuration = -0; - return prevEffectDuration; - } - function popComponentEffectDuration(prevEffectDuration) { - 0 <= prevEffectDuration && (componentEffectDuration = prevEffectDuration); - } - function pushComponentEffectErrors() { - var prevErrors = componentEffectErrors; - componentEffectErrors = null; - return prevErrors; - } - function pushComponentEffectDidSpawnUpdate() { - var prev = componentEffectSpawnedUpdate; - componentEffectSpawnedUpdate = !1; - return prev; + function setCurrentTrackFromLanes(lanes) { + currentTrack = + lanes & 63 + ? "Blocking" + : lanes & 64 + ? "Gesture" + : lanes & 4194176 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + function logComponentTrigger(fiber, startTime, endTime, trigger) { + supportsUserTiming && + ((reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + (reusableComponentDevToolDetails.color = "warning"), + (reusableComponentDevToolDetails.tooltipText = trigger), + (reusableComponentDevToolDetails.properties = null), + (fiber = fiber._debugTask) + ? fiber.run( + performance.measure.bind( + performance, + trigger, + reusableComponentOptions + ) + ) + : performance.measure(trigger, reusableComponentOptions), + performance.clearMeasures(trigger)); } - function stopProfilerTimerIfRunningAndRecordDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - fiber.selfBaseDuration = elapsedTime; - profilerStartTime = -1; - } + function logComponentReappeared(fiber, startTime, endTime) { + logComponentTrigger(fiber, startTime, endTime, "Reconnect"); } - function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - profilerStartTime = -1; + function logComponentRender( + fiber, + startTime, + endTime, + wasHydrated, + committedLanes + ) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var alternate = fiber.alternate, + selfTime = fiber.actualDuration; + if (null === alternate || alternate.child !== fiber.child) + for (var child = fiber.child; null !== child; child = child.sibling) + selfTime -= child.actualDuration; + selfTime = + 0.5 > selfTime + ? wasHydrated + ? "tertiary-light" + : "primary-light" + : 10 > selfTime + ? wasHydrated + ? "tertiary" + : "primary" + : 100 > selfTime + ? wasHydrated + ? "tertiary-dark" + : "primary-dark" + : "error"; + var props = fiber.memoizedProps; + wasHydrated = fiber._debugTask; + null !== props && + null !== alternate && + alternate.memoizedProps !== props + ? ((child = [reusableChangedPropsEntry]), + (props = addObjectDiffToProperties( + alternate.memoizedProps, + props, + child, + 0 + )), + 1 < child.length + ? (props && + !alreadyWarnedForDeepEquality && + 0 === (alternate.lanes & committedLanes) && + 100 < fiber.actualDuration + ? ((alreadyWarnedForDeepEquality = !0), + (child[0] = reusableDeeplyEqualPropsEntry), + (reusableComponentDevToolDetails.color = "warning"), + (reusableComponentDevToolDetails.tooltipText = + "This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.")) + : ((reusableComponentDevToolDetails.color = selfTime), + (reusableComponentDevToolDetails.tooltipText = name)), + (reusableComponentDevToolDetails.properties = child), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + (fiber = "\u200b" + name), + null != wasHydrated + ? wasHydrated.run( + performance.measure.bind( + performance, + fiber, + reusableComponentOptions + ) + ) + : performance.measure(fiber, reusableComponentOptions), + performance.clearMeasures(fiber)) + : null != wasHydrated + ? wasHydrated.run( + console.timeStamp.bind( + console, + name, + startTime, + endTime, + "Components \u269b", + void 0, + selfTime + ) + ) + : console.timeStamp( + name, + startTime, + endTime, + "Components \u269b", + void 0, + selfTime + )) + : null != wasHydrated + ? wasHydrated.run( + console.timeStamp.bind( + console, + name, + startTime, + endTime, + "Components \u269b", + void 0, + selfTime + ) + ) + : console.timeStamp( + name, + startTime, + endTime, + "Components \u269b", + void 0, + selfTime + ); } } - function recordEffectDuration() { - if (0 <= profilerStartTime) { - var endTime = now(), - elapsedTime = endTime - profilerStartTime; - profilerStartTime = -1; - profilerEffectDuration += elapsedTime; - componentEffectDuration += elapsedTime; - componentEffectEndTime = endTime; + function logComponentErrored(fiber, startTime, endTime, errors) { + if (supportsUserTiming) { + var name = getComponentNameFromFiber(fiber); + if (null !== name) { + for ( + var debugTask = null, properties = [], i = 0; + i < errors.length; + i++ + ) { + var capturedValue = errors[i]; + null == debugTask && + null !== capturedValue.source && + (debugTask = capturedValue.source._debugTask); + capturedValue = capturedValue.value; + properties.push([ + "Error", + "object" === typeof capturedValue && + null !== capturedValue && + "string" === typeof capturedValue.message + ? String(capturedValue.message) + : String(capturedValue) + ]); + } + null !== fiber.key && + addValueToProperties("key", fiber.key, properties, 0, ""); + null !== fiber.memoizedProps && + addObjectToProperties(fiber.memoizedProps, properties, 0, ""); + null == debugTask && (debugTask = fiber._debugTask); + fiber = { + start: startTime, + end: endTime, + detail: { + devtools: { + color: "error", + track: "Components \u269b", + tooltipText: + 13 === fiber.tag + ? "Hydration failed" + : "Error boundary caught an error", + properties: properties + } + } + }; + name = "\u200b" + name; + debugTask + ? debugTask.run(performance.measure.bind(performance, name, fiber)) + : performance.measure(name, fiber); + performance.clearMeasures(name); + } } } - function recordEffectError(errorInfo) { - null === componentEffectErrors && (componentEffectErrors = []); - componentEffectErrors.push(errorInfo); - null === commitErrors && (commitErrors = []); - commitErrors.push(errorInfo); - } - function startEffectTimer() { - profilerStartTime = now(); - 0 > componentEffectStartTime && - (componentEffectStartTime = profilerStartTime); - } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); - } - function noop() {} - function ensureRootIsScheduled(root) { - root !== lastScheduledRoot && - null === root.next && - (null === lastScheduledRoot - ? (firstScheduledRoot = lastScheduledRoot = root) - : (lastScheduledRoot = lastScheduledRoot.next = root)); - mightHavePendingSyncWork = !0; - null !== ReactSharedInternals.actQueue - ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) - : didScheduleMicrotask || - ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); - ReactSharedInternals.isBatchingLegacy && - 0 === root.tag && - (ReactSharedInternals.didScheduleLegacyUpdate = !0); - } - function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { - if (!isFlushingWork && mightHavePendingSyncWork) { - isFlushingWork = !0; - do { - var didPerformSomeWork = !1; - for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || 0 === root.tag) - if (0 !== syncTransitionLanes) { - var pendingLanes = root.pendingLanes; - if (0 === pendingLanes) var nextLanes = 0; - else { - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes; - nextLanes = - (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; - nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); - nextLanes = - nextLanes & 201326741 - ? (nextLanes & 201326741) | 1 - : nextLanes - ? nextLanes | 2 - : 0; + function logComponentEffect(fiber, startTime, endTime, selfTime, errors) { + if (null !== errors) { + if (supportsUserTiming) { + var name = getComponentNameFromFiber(fiber); + if (null !== name) { + selfTime = []; + for (var i = 0; i < errors.length; i++) { + var error = errors[i].value; + selfTime.push([ + "Error", + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error) + ]); + } + null !== fiber.key && + addValueToProperties("key", fiber.key, selfTime, 0, ""); + null !== fiber.memoizedProps && + addObjectToProperties(fiber.memoizedProps, selfTime, 0, ""); + startTime = { + start: startTime, + end: endTime, + detail: { + devtools: { + color: "error", + track: "Components \u269b", + tooltipText: "A lifecycle or effect errored", + properties: selfTime } - 0 !== nextLanes && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, nextLanes)); - } else - (nextLanes = workInProgressRootRenderLanes), - (nextLanes = getNextLanes( - root, - root === workInProgressRoot ? nextLanes : 0, - null !== root.cancelPendingCommit || - root.timeoutHandle !== noTimeout - )), - 0 === (nextLanes & 3) || - checkIfRootIsPrerendering(root, nextLanes) || - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, nextLanes)); - root = root.next; + } + }; + fiber = fiber._debugTask; + endTime = "\u200b" + name; + fiber + ? fiber.run( + performance.measure.bind(performance, endTime, startTime) + ) + : performance.measure(endTime, startTime); + performance.clearMeasures(endTime); } - } while (didPerformSomeWork); - isFlushingWork = !1; - } - } - function processRootScheduleInImmediateTask() { - schedulerEvent = global.event; - processRootScheduleInMicrotask(); - } - function processRootScheduleInMicrotask() { - mightHavePendingSyncWork = - didScheduleMicrotask_act = - didScheduleMicrotask = - !1; - for ( - var currentTime = now$1(), prev = null, root = firstScheduledRoot; - null !== root; - - ) { - var next = root.next, - nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); - 0 === nextLanes - ? ((root.next = null), - null === prev ? (firstScheduledRoot = next) : (prev.next = next), - null === next && (lastScheduledRoot = prev)) - : ((prev = root), - 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); - root = next; - } - (pendingEffectsStatus !== NO_PENDING_EFFECTS && - pendingEffectsStatus !== PENDING_PASSIVE_PHASE) || - flushSyncWorkAcrossRoots_impl(0, !1); - 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); - } - function scheduleTaskForRootDuringMicrotask(root, currentTime) { - for ( - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - expirationTimes = root.expirationTimes, - lanes = root.pendingLanes & -62914561; - 0 < lanes; - - ) { - var index = 31 - clz32(lanes), - lane = 1 << index, - expirationTime = expirationTimes[index]; - if (-1 === expirationTime) { - if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (root.expiredLanes |= lane); - lanes &= ~lane; - } - currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0, - null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout - ); - pingedLanes = root.callbackNode; - if ( - 0 === suspendedLanes || - (root === currentTime && - (workInProgressSuspendedReason === SuspendedOnData || - workInProgressSuspendedReason === SuspendedOnAction)) || - null !== root.cancelPendingCommit - ) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackNode = null), - (root.callbackPriority = 0) - ); - if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) - ) { - currentTime = suspendedLanes & -suspendedLanes; - if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; - } - null !== pingedLanes && cancelCallback(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; - } - function performWorkOnRootViaSchedulerTask(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; - schedulerEvent = global.event; - if ( - pendingEffectsStatus !== NO_PENDING_EFFECTS && - pendingEffectsStatus !== PENDING_PASSIVE_PHASE - ) - return (root.callbackNode = null), (root.callbackPriority = 0), null; - var originalCallbackNode = root.callbackNode; - pendingDelayedCommitReason === IMMEDIATE_COMMIT && - (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT); - if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) - return null; - var workInProgressRootRenderLanes$jscomp$0 = - workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot - ? workInProgressRootRenderLanes$jscomp$0 - : 0, - null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout - ); - if (0 === workInProgressRootRenderLanes$jscomp$0) return null; - performWorkOnRoot( - root, - workInProgressRootRenderLanes$jscomp$0, - didTimeout - ); - scheduleTaskForRootDuringMicrotask(root, now$1()); - return null != root.callbackNode && - root.callbackNode === originalCallbackNode - ? performWorkOnRootViaSchedulerTask.bind(null, root) - : null; + } else + (name = getComponentNameFromFiber(fiber)), + null !== name && + supportsUserTiming && + ((errors = + 1 > selfTime + ? "secondary-light" + : 100 > selfTime + ? "secondary" + : 500 > selfTime + ? "secondary-dark" + : "error"), + (fiber = fiber._debugTask) + ? fiber.run( + console.timeStamp.bind( + console, + name, + startTime, + endTime, + "Components \u269b", + void 0, + errors + ) + ) + : console.timeStamp( + name, + startTime, + endTime, + "Components \u269b", + void 0, + errors + )); } - function performSyncWorkOnRoot(root, lanes) { - if (flushPendingEffects()) return null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - performWorkOnRoot(root, lanes, !0); + function logSuspendedRenderPhase(startTime, endTime, lanes, debugTask) { + !supportsUserTiming || + endTime <= startTime || + ((lanes = + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), + debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + "Prewarm", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + lanes + ) + ) + : console.timeStamp( + "Prewarm", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + lanes + )); } - function cancelCallback(callbackNode) { - callbackNode !== fakeActCallbackNode$1 && - null !== callbackNode && - cancelCallback$1(callbackNode); + function logSuspendedWithDelayPhase(startTime, endTime, lanes, debugTask) { + !supportsUserTiming || + endTime <= startTime || + ((lanes = + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), + debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + "Suspended", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + lanes + ) + ) + : console.timeStamp( + "Suspended", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + lanes + )); } - function scheduleImmediateRootScheduleTask() { - null !== ReactSharedInternals.actQueue && - ReactSharedInternals.actQueue.push(function () { - processRootScheduleInMicrotask(); - return null; - }); - scheduleMicrotask(function () { - (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3( - ImmediatePriority, - processRootScheduleInImmediateTask + function logErroredRenderPhase(startTime, endTime, lanes, debugTask) { + !supportsUserTiming || + endTime <= startTime || + (debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + "Errored", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "error" + ) ) - : processRootScheduleInMicrotask(); - }); + : console.timeStamp( + "Errored", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "error" + )); } - function requestTransitionLane() { - if (0 === currentEventTransitionLane) { - var actionScopeLane = currentEntangledLane; - 0 === actionScopeLane && - ((actionScopeLane = nextTransitionUpdateLane), - (nextTransitionUpdateLane <<= 1), - 0 === (nextTransitionUpdateLane & 261888) && - (nextTransitionUpdateLane = 256)); - currentEventTransitionLane = actionScopeLane; - } - return currentEventTransitionLane; + function logSuspendedCommitPhase(startTime, endTime, reason, debugTask) { + !supportsUserTiming || + endTime <= startTime || + (debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + reason, + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + ) + ) + : console.timeStamp( + reason, + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + )); } - 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 logCommitErrored(startTime, endTime, errors, passive, debugTask) { + if (supportsUserTiming && !(endTime <= startTime)) { + for (var properties = [], i = 0; i < errors.length; i++) { + var error = errors[i].value; + properties.push([ + "Error", + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error) + ]); + } + startTime = { + start: startTime, + end: endTime, + detail: { + devtools: { + color: "error", + track: currentTrack, + trackGroup: "Scheduler \u269b", + tooltipText: passive + ? "Remaining Effects Errored" + : "Commit Errored", + properties: properties + } } }; + debugTask + ? debugTask.run( + performance.measure.bind(performance, "Errored", startTime) + ) + : performance.measure("Errored", startTime); + performance.clearMeasures("Errored"); } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; - } - function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - (-1 < transitionUpdateTime || (transitionStartTime = -1.1), - (entangledTransitionTypes = null), - null !== currentEntangledListeners) - ) { - null !== currentEntangledActionThenable && - (currentEntangledActionThenable.status = "fulfilled"); - var listeners = currentEntangledListeners; - currentEntangledListeners = null; - currentEntangledLane = 0; - currentEntangledActionThenable = null; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); - } - } - function chainThenableValue(thenable, result) { - var listeners = [], - thenableWithOverride = { - status: "pending", - value: null, - reason: null, - then: function (resolve) { - listeners.push(resolve); - } - }; - thenable.then( - function () { - thenableWithOverride.status = "fulfilled"; - thenableWithOverride.value = result; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); - }, - function (error) { - thenableWithOverride.status = "rejected"; - thenableWithOverride.reason = error; - for (error = 0; error < listeners.length; error++) - (0, listeners[error])(void 0); - } - ); - return thenableWithOverride; - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function logCommitPhase( + startTime, + endTime, + errors, + abortedViewTransition, + debugTask + ) { + null !== errors + ? logCommitErrored(startTime, endTime, errors, !1, debugTask) + : !supportsUserTiming || + endTime <= startTime || + (debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + abortedViewTransition + ? "Commit Interrupted View Transition" + : "Commit", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? "error" : "secondary-dark" + ) + ) + : console.timeStamp( + abortedViewTransition + ? "Commit Interrupted View Transition" + : "Commit", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? "error" : "secondary-dark" + )); } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + function logAnimatingPhase(startTime, endTime, debugTask) { + !supportsUserTiming || + endTime <= startTime || + (debugTask + ? debugTask.run( + console.timeStamp.bind( + console, + "Animating", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + ) + ) + : console.timeStamp( + "Animating", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + )); } - function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - return !0; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; + function requiredContext(c) { + null === c && + console.error( + "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." + ); + return c; } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; + function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance, fiber); + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, null, fiber); + nextRootInstance = { isInAParentText: !1 }; + pop(contextStackCursor, fiber); + push(contextStackCursor, nextRootInstance, fiber); } - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - console.error( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop, noop), - (thenable = index)); - if (void 0 === thenable._debugInfo && Object.isExtensible(thenable)) { - thenableState = performance.now(); - trackedThenables = thenable.displayName; - var ioInfo = { - name: - "string" === typeof trackedThenables ? trackedThenables : "Promise", - start: thenableState, - end: thenableState, - value: thenable - }; - thenable._debugInfo = [{ awaited: ioInfo }]; - "fulfilled" !== thenable.status && - "rejected" !== thenable.status && - ((thenableState = function () { - ioInfo.end = performance.now(); - }), - thenable.then(thenableState, thenableState)); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - thenableState = thenable.reason; - checkIfUseWrappedInAsyncCatch(thenableState); - if (void 0 === thenableState && !("reason" in thenable)) - throw Error( - "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." - ); - throw thenableState; - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; - } + function popHostContainer(fiber) { + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); } - function resolveLazy(lazyType) { - try { - return callLazyInitInDEV(lazyType); - } catch (x) { - if (null !== x && "object" === typeof x && "function" === typeof x.then) - throw ( - ((suspendedThenable = x), - (needsToResetSuspendedThenableDEV = !0), - SuspenseException) - ); - throw x; - } + function pushHostContext(fiber) { + var stateHook = fiber.memoizedState; + null !== stateHook && + ((HostTransitionContext._currentValue2 = stateHook.memoizedState), + push(hostTransitionProviderCursor, fiber, fiber)); + stateHook = requiredContext(contextStackCursor.current); + var nextContext = fiber.type; + nextContext = + "AndroidTextInput" === nextContext || + "RCTMultilineTextInputView" === nextContext || + "RCTSelectableText" === nextContext || + "RCTSinglelineTextInputView" === nextContext || + "RCTText" === nextContext || + "RCTVirtualText" === nextContext; + nextContext = + stateHook.isInAParentText !== nextContext + ? { isInAParentText: nextContext } + : stateHook; + stateHook !== nextContext && + (push(contextFiberStackCursor, fiber, fiber), + push(contextStackCursor, nextContext, fiber)); } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor, fiber), + (HostTransitionContext._currentValue2 = null)); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); + function findNotableNode(node, indent) { + return void 0 === node.serverProps && + 0 === node.serverTail.length && + 1 === node.children.length && + 3 < node.distanceFromLeaf && + node.distanceFromLeaf > 15 - indent + ? findNotableNode(node.children[0], indent) + : node; } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; + function indentation(indent) { + return " " + " ".repeat(indent); } - function getCurrentDebugTask() { - var debugInfo = currentDebugInfo; - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if (null != debugInfo[i].name) { - var debugTask = debugInfo[i].debugTask; - if (null != debugTask) return debugTask; - } - return null; + function added(indent) { + return "+ " + " ".repeat(indent); } - 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 && "ref" !== 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`, `ref`, and `children` props.", - erroredKey - ); - }, - key + function removed(indent) { + return "- " + " ".repeat(indent); + } + function describeFiberType(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return fiber.type; + case 16: + return "Lazy"; + case 31: + return "Activity"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 0: + case 15: + return (fiber = fiber.type), fiber.displayName || fiber.name || null; + case 11: + return ( + (fiber = fiber.type.render), fiber.displayName || fiber.name || null ); - break; - } + case 1: + return (fiber = fiber.type), fiber.displayName || fiber.name || null; + default: + return null; } } - function unwrapThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - return trackUsedThenable(thenableState$1, thenable, index); - } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + function describeTextNode(content, maxLength) { + return needsEscaping.test(content) + ? ((content = JSON.stringify(content)), + content.length > maxLength - 2 + ? 8 > maxLength + ? '{"..."}' + : "{" + content.slice(0, maxLength - 7) + '..."}' + : "{" + content + "}") + : content.length > maxLength + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } - function throwOnInvalidObjectTypeImpl(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.' + function describeTextDiff(clientText, serverProps, indent) { + var maxLength = 120 - 2 * indent; + if (null === serverProps) + return added(indent) + describeTextNode(clientText, maxLength) + "\n"; + if ("string" === typeof serverProps) { + for ( + var firstDiff = 0; + firstDiff < serverProps.length && + firstDiff < clientText.length && + serverProps.charCodeAt(firstDiff) === + clientText.charCodeAt(firstDiff); + firstDiff++ ); - 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." + firstDiff > maxLength - 8 && + 10 < firstDiff && + ((clientText = "..." + clientText.slice(firstDiff - 8)), + (serverProps = "..." + serverProps.slice(firstDiff - 8))); + return ( + added(indent) + + describeTextNode(clientText, maxLength) + + "\n" + + removed(indent) + + describeTextNode(serverProps, maxLength) + + "\n" + ); + } + return ( + indentation(indent) + describeTextNode(clientText, maxLength) + "\n" ); } - function throwOnInvalidObjectType(returnFiber, newChild) { - var debugTask = getCurrentDebugTask(); - null !== debugTask - ? debugTask.run( - throwOnInvalidObjectTypeImpl.bind(null, returnFiber, newChild) - ) - : throwOnInvalidObjectTypeImpl(returnFiber, newChild); - } - function warnOnFunctionTypeImpl(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 objectName(object) { + return Object.prototype.toString + .call(object) + .replace(/^\[object (.*)\]$/, function (m, p0) { + return p0; + }); } - function warnOnFunctionType(returnFiber, invalidChild) { - var debugTask = getCurrentDebugTask(); - null !== debugTask - ? debugTask.run( - warnOnFunctionTypeImpl.bind(null, returnFiber, invalidChild) - ) - : warnOnFunctionTypeImpl(returnFiber, invalidChild); + function describeValue(value, maxLength) { + switch (typeof value) { + case "string": + return ( + (value = JSON.stringify(value)), + value.length > maxLength + ? 5 > maxLength + ? '"..."' + : value.slice(0, maxLength - 4) + '..."' + : value + ); + case "object": + if (null === value) return "null"; + if (isArrayImpl(value)) return "[...]"; + if (value.$$typeof === REACT_ELEMENT_TYPE) + return (maxLength = getComponentNameFromType(value.type)) + ? "<" + maxLength + ">" + : "<...>"; + var name = objectName(value); + if ("Object" === name) { + name = ""; + maxLength -= 2; + for (var propName in value) + if (value.hasOwnProperty(propName)) { + var jsonPropName = JSON.stringify(propName); + jsonPropName !== '"' + propName + '"' && + (propName = jsonPropName); + maxLength -= propName.length - 2; + jsonPropName = describeValue( + value[propName], + 15 > maxLength ? maxLength : 15 + ); + maxLength -= jsonPropName.length; + if (0 > maxLength) { + name += "" === name ? "..." : ", ..."; + break; + } + name += + ("" === name ? "" : ",") + propName + ":" + jsonPropName; + } + return "{" + name + "}"; + } + return name; + case "function": + return (maxLength = value.displayName || value.name) + ? "function " + maxLength + : "function"; + default: + return String(value); + } } - function warnOnSymbolTypeImpl(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 describePropValue(value, maxLength) { + return "string" !== typeof value || needsEscaping.test(value) + ? "{" + describeValue(value, maxLength - 2) + "}" + : value.length > maxLength - 2 + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } - function warnOnSymbolType(returnFiber, invalidChild) { - var debugTask = getCurrentDebugTask(); - null !== debugTask - ? debugTask.run( - warnOnSymbolTypeImpl.bind(null, returnFiber, invalidChild) - ) - : warnOnSymbolTypeImpl(returnFiber, invalidChild); + function describeExpandedElement(type, props, rowPrefix) { + var remainingRowLength = 120 - rowPrefix.length - type.length, + properties = [], + propName; + for (propName in props) + if (props.hasOwnProperty(propName) && "children" !== propName) { + var propValue = describePropValue( + props[propName], + 120 - rowPrefix.length - propName.length - 1 + ); + remainingRowLength -= propName.length + propValue.length + 2; + properties.push(propName + "=" + propValue); + } + return 0 === properties.length + ? rowPrefix + "<" + type + ">\n" + : 0 < remainingRowLength + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } - 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 describePropertiesDiff(clientObject, serverObject, indent) { + var properties = "", + remainingServerProperties = assign({}, serverObject), + propName; + for (propName in clientObject) + if (clientObject.hasOwnProperty(propName)) { + delete remainingServerProperties[propName]; + var maxLength = 120 - 2 * indent - propName.length - 2, + clientPropValue = describeValue(clientObject[propName], maxLength); + serverObject.hasOwnProperty(propName) + ? ((maxLength = describeValue(serverObject[propName], maxLength)), + (properties += + added(indent) + propName + ": " + clientPropValue + "\n"), + (properties += + removed(indent) + propName + ": " + maxLength + "\n")) + : (properties += + added(indent) + propName + ": " + clientPropValue + "\n"); } - } - 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.index, currentFirstChild) - : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) - : newIndex + for (var _propName in remainingServerProperties) + remainingServerProperties.hasOwnProperty(_propName) && + ((clientObject = describeValue( + remainingServerProperties[_propName], + 120 - 2 * indent - _propName.length - 2 + )), + (properties += + removed(indent) + _propName + ": " + clientObject + "\n")); + return properties; + } + function describeElementDiff(type, clientProps, serverProps, indent) { + var content = "", + serverPropNames = new Map(); + for (propName$jscomp$0 in serverProps) + serverProps.hasOwnProperty(propName$jscomp$0) && + serverPropNames.set( + propName$jscomp$0.toLowerCase(), + propName$jscomp$0 ); - newFiber.flags |= 134217730; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 134217730); - 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 - ); - 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 - )), - coerceRef(current, element), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current - ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + if (1 === serverPropNames.size && serverPropNames.has("children")) + content += describeExpandedElement( + type, + clientProps, + indentation(indent) + ); + else { + for (var _propName2 in clientProps) + if ( + clientProps.hasOwnProperty(_propName2) && + "children" !== _propName2 + ) { + var maxLength$jscomp$0 = + 120 - 2 * (indent + 1) - _propName2.length - 1, + serverPropName = serverPropNames.get(_propName2.toLowerCase()); + if (void 0 !== serverPropName) { + serverPropNames.delete(_propName2.toLowerCase()); + var propName$jscomp$0 = clientProps[_propName2]; + serverPropName = serverProps[serverPropName]; + var clientPropValue = describePropValue( + propName$jscomp$0, + maxLength$jscomp$0 + ); + maxLength$jscomp$0 = describePropValue( + serverPropName, + maxLength$jscomp$0 + ); + "object" === typeof propName$jscomp$0 && + null !== propName$jscomp$0 && + "object" === typeof serverPropName && + null !== serverPropName && + "Object" === objectName(propName$jscomp$0) && + "Object" === objectName(serverPropName) && + (2 < Object.keys(propName$jscomp$0).length || + 2 < Object.keys(serverPropName).length || + -1 < clientPropValue.indexOf("...") || + -1 < maxLength$jscomp$0.indexOf("...")) + ? (content += + indentation(indent + 1) + + _propName2 + + "={{\n" + + describePropertiesDiff( + propName$jscomp$0, + serverPropName, + indent + 2 + ) + + indentation(indent + 1) + + "}}\n") + : ((content += + added(indent + 1) + + _propName2 + + "=" + + clientPropValue + + "\n"), + (content += + removed(indent + 1) + + _propName2 + + "=" + + maxLength$jscomp$0 + + "\n")); + } else + content += + indentation(indent + 1) + + _propName2 + + "=" + + describePropValue(clientProps[_propName2], maxLength$jscomp$0) + + "\n"; + } + serverPropNames.forEach(function (propName) { + if ("children" !== propName) { + var maxLength = 120 - 2 * (indent + 1) - propName.length - 1; + content += + removed(indent + 1) + + propName + + "=" + + describePropValue(serverProps[propName], maxLength) + + "\n"; + } + }); + content = + "" === content + ? indentation(indent) + "<" + type + ">\n" + : indentation(indent) + + "<" + + type + + "\n" + + content + + indentation(indent) + + ">\n"; } - function updatePortal(returnFiber, current, portal, lanes) { + type = serverProps.children; + clientProps = clientProps.children; + if ( + "string" === typeof type || + "number" === typeof type || + "bigint" === typeof type + ) { + serverPropNames = ""; if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation + "string" === typeof clientProps || + "number" === typeof clientProps || + "bigint" === typeof clientProps ) - 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; + serverPropNames = "" + clientProps; + content += describeTextDiff(serverPropNames, "" + type, indent + 1); + } else if ( + "string" === typeof clientProps || + "number" === typeof clientProps || + "bigint" === typeof clientProps + ) + content = + null == type + ? content + describeTextDiff("" + clientProps, null, indent + 1) + : content + describeTextDiff("" + clientProps, void 0, indent + 1); + return content; + } + function describeSiblingFiber(fiber, indent) { + var type = describeFiberType(fiber); + if (null === type) { + type = ""; + for (fiber = fiber.child; fiber; ) + (type += describeSiblingFiber(fiber, indent)), + (fiber = fiber.sibling); + return type; } - 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 = resolveLazy(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (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); + return indentation(indent) + "<" + type + ">\n"; + } + function describeNode(node, indent) { + var skipToNode = findNotableNode(node, indent); + if ( + skipToNode !== node && + (1 !== node.children.length || node.children[0] !== skipToNode) + ) + return ( + indentation(indent) + "...\n" + describeNode(skipToNode, indent + 1) + ); + skipToNode = ""; + var debugInfo = node.fiber._debugInfo; + if (debugInfo) + for (var i = 0; i < debugInfo.length; i++) { + var serverComponentName = debugInfo[i].name; + "string" === typeof serverComponentName && + ((skipToNode += + indentation(indent) + "<" + serverComponentName + ">\n"), + indent++); } - "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 = resolveLazy(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; - } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes + debugInfo = ""; + i = node.fiber.pendingProps; + if (6 === node.fiber.tag) + (debugInfo = describeTextDiff(i, node.serverProps, indent)), indent++; + else if ( + ((serverComponentName = describeFiberType(node.fiber)), + null !== serverComponentName) + ) + if (void 0 === node.serverProps) { + debugInfo = indent; + var maxLength = 120 - 2 * debugInfo - serverComponentName.length - 2, + content = ""; + for (propName in i) + if (i.hasOwnProperty(propName) && "children" !== propName) { + var propValue = describePropValue(i[propName], 15); + maxLength -= propName.length + propValue.length + 2; + if (0 > maxLength) { + content += " ..."; + break; + } + content += " " + propName + "=" + propValue; + } + debugInfo = + indentation(debugInfo) + + "<" + + serverComponentName + + content + + ">\n"; + indent++; + } else + null === node.serverProps + ? ((debugInfo = describeExpandedElement( + serverComponentName, + i, + added(indent) )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + indent++) + : "string" === typeof node.serverProps + ? console.error( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); + var propName = ""; + i = node.fiber.child; + for ( + serverComponentName = 0; + i && serverComponentName < node.children.length; + + ) + (maxLength = node.children[serverComponentName]), + maxLength.fiber === i + ? ((propName += describeNode(maxLength, indent)), + serverComponentName++) + : (propName += describeSiblingFiber(i, indent)), + (i = i.sibling); + i && + 0 < node.children.length && + (propName += indentation(indent) + "...\n"); + i = node.serverTail; + null === node.serverProps && indent--; + for (node = 0; node < i.length; node++) + (serverComponentName = i[node]), + (propName = + "string" === typeof serverComponentName + ? propName + + (removed(indent) + + describeTextNode(serverComponentName, 120 - 2 * indent) + + "\n") + : propName + + describeExpandedElement( + serverComponentName.type, + serverComponentName.props, + removed(indent) + )); + return skipToNode + debugInfo + propName; + } + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; + } + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + if (null !== diffRoot) { + hydrationDiffRootDEV = null; + try { + var diff = "\n\n" + describeNode(diffRoot, 0); + } catch (x) { + diff = ""; } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; + for (; 0 < diffRoot.children.length; ) diffRoot = diffRoot.children[0]; + runWithFiberInDEV(diffRoot.fiber, function () { + console.error( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diff + ); + }); } - 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 = resolveLazy(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; + } + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; + } + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2, providerFiber); + context._currentValue2 = nextValue; + push(renderer2CursorDEV, context._currentRenderer2, providerFiber); + void 0 !== context._currentRenderer2 && + null !== context._currentRenderer2 && + context._currentRenderer2 !== rendererSigil && + console.error( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + ); + context._currentRenderer2 = rendererSigil; + } + function popProvider(context, providerFiber) { + context._currentValue2 = valueCursor.current; + var currentRenderer2 = renderer2CursorDEV.current; + pop(renderer2CursorDEV, providerFiber); + context._currentRenderer2 = currentRenderer2; + pop(valueCursor, providerFiber); + } + function scheduleContextWorkOnParentPath( + parent, + renderLanes, + propagationRoot + ) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } + parent !== propagationRoot && + console.error( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." + ); + } + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - 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); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else + 13 === fiber.tag && + null !== fiber.memoizedState && + null === fiber.memoizedState.dehydrated + ? ((fiber.lanes |= renderLanes), + (nextFiber = fiber.alternate), + null !== nextFiber && (nextFiber.lanes |= renderLanes), + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + workInProgress + ), + (nextFiber = fiber.child), + (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) + : (nextFiber = fiber.child); + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; break; } - if (!knownKeys.has(key)) { - knownKeys.add(key); + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; 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 = resolveLazy(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); - } - return knownKeys; + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes + } + function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree + ) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + ) { - 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; + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current + ? current.push(context) + : (current = [context])); } - 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), 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)); - return resultingFirstChild; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - 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 && - ((newFiber = nextOldFiber.alternate), - null !== newFiber && - oldFiber.delete( - null === newFiber.key ? newIdx : newFiber.key - )), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - return resultingFirstChild; + parent = parent.return; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + return null !== current; + } + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + ) { - 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), 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)); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - ((step = nextOldFiber.alternate), - null !== step && - oldFiber.delete(null === step.key ? newIdx : step.key)), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - return resultingFirstChild; + return !0; + currentDependencies = currentDependencies.next; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - void 0 === newChild.props.ref && - (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 - ); - coerceRef(lanes, newChild); - 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 && - resolveLazy(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 - )), - coerceRef(lanes, newChild), - (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 = resolveLazy(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = newChild; - newChild = getIteratorFn(prevDebugInfo); - if ("function" !== typeof newChild) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - key = newChild.call(prevDebugInfo); - if (key === prevDebugInfo) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== Object.prototype.toString.call(key) - ) - 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 - prevDebugInfo.entries !== newChild || - didWarnAboutMaps || - (console.error( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - key, - lanes - ); - } - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) + return !1; + } + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); + } + function readContext(context) { + isDisallowedContextReadInDEV && + console.error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + return readContextForConsumer(currentlyRenderingFiber$1, context); + } + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); + } + function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter$1 = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState$1 = null; - return firstChildFiber; - } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - 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; - } + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 }; } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - console.error( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; + function 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 finishQueueingConcurrentUpdates() { - for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; - - ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + 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 queueTransitionTypes(root, transitionTypes) { + if (0 !== (root.pendingLanes & 4194048)) { + var queued = root.transitionTypes; + null === queued && (queued = root.transitionTypes = []); + for (root = 0; root < transitionTypes.length; root++) { + var transitionType = transitionTypes[root]; + -1 === queued.indexOf(transitionType) && queued.push(transitionType); } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); } } - function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); + function claimQueuedTransitionTypes(root) { + var claimed = root.transitionTypes; + root.transitionTypes = null; + return claimed; } - function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); + function startUpdateTimerByLane(lane, method, fiber) { + if (0 !== (lane & 127)) + 0 > blockingUpdateTime && + ((blockingUpdateTime = now()), + (blockingUpdateTask = createTask(method)), + (blockingUpdateMethodName = method), + null != fiber && + (blockingUpdateComponentName = getComponentNameFromFiber(fiber)), + (executionContext & (RenderContext | CommitContext)) !== NoContext && + ((componentEffectSpawnedUpdate = !0), (blockingUpdateType = 1)), + (lane = resolveEventTimeStamp()), + (method = resolveEventType()), + lane !== blockingEventRepeatTime || method !== blockingEventType + ? (blockingEventRepeatTime = -1.1) + : null !== method && (blockingUpdateType = 1), + (blockingEventTime = lane), + (blockingEventType = method)); + else if ( + 0 !== (lane & 4194048) && + 0 > transitionUpdateTime && + ((transitionUpdateTime = now()), + (transitionUpdateTask = createTask(method)), + (transitionUpdateMethodName = method), + null != fiber && + (transitionUpdateComponentName = getComponentNameFromFiber(fiber)), + 0 > transitionStartTime) + ) { + lane = resolveEventTimeStamp(); + method = resolveEventType(); + if ( + lane !== transitionEventRepeatTime || + method !== transitionEventType + ) + transitionEventRepeatTime = -1.1; + transitionEventTime = lane; + transitionEventType = method; + } } - function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); + function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; } - function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || - sourceFiber._visibility & OffscreenVisible || - (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - return 3 === sourceFiber.tag - ? ((parent = sourceFiber.stateNode), - isHidden && - null !== update && - ((isHidden = 31 - clz32(lane)), - (sourceFiber = parent.hiddenUpdates), - (alternate = sourceFiber[isHidden]), - null === alternate - ? (sourceFiber[isHidden] = [update]) - : alternate.push(update), - (update.lane = lane | 536870912)), - parent) - : null; + function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; } - function getRootForUpdatedFiber(sourceFiber) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) - throw ( - ((nestedPassiveUpdateCount = nestedUpdateCount = 0), - (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && - ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null), - console.error( - "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." - )); - null === sourceFiber.alternate && - 0 !== (sourceFiber.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); - for (var node = sourceFiber, parent = node.return; null !== parent; ) - null === node.alternate && - 0 !== (node.flags & 4098) && - warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), - (node = parent), - (parent = node.return); - return 3 === node.tag ? node.stateNode : null; + function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + function resetComponentEffectTimers() { + componentEffectEndTime = componentEffectStartTime = -1.1; } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); + function pushComponentEffectStart() { + var prevEffectStart = componentEffectStartTime; + componentEffectStartTime = -1.1; + return prevEffectStart; } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; + function popComponentEffectStart(prevEffectStart) { + 0 <= prevEffectStart && (componentEffectStartTime = prevEffectStart); } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - console.error( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; + function pushComponentEffectDuration() { + var prevEffectDuration = componentEffectDuration; + componentEffectDuration = -0; + return prevEffectDuration; + } + function popComponentEffectDuration(prevEffectDuration) { + 0 <= prevEffectDuration && (componentEffectDuration = prevEffectDuration); + } + function pushComponentEffectErrors() { + var prevErrors = componentEffectErrors; + componentEffectErrors = null; + return prevErrors; + } + function pushComponentEffectDidSpawnUpdate() { + var prev = componentEffectSpawnedUpdate; + componentEffectSpawnedUpdate = !1; + return prev; + } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; } } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; + function recordEffectDuration() { + if (0 <= profilerStartTime) { + var endTime = now(), + elapsedTime = endTime - profilerStartTime; + profilerStartTime = -1; + profilerEffectDuration += elapsedTime; + componentEffectDuration += elapsedTime; + componentEffectEndTime = endTime; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; + function recordEffectError(errorInfo) { + null === componentEffectErrors && (componentEffectErrors = []); + componentEffectErrors.push(errorInfo); + null === commitErrors && (commitErrors = []); + commitErrors.push(errorInfo); + } + function startEffectTimer() { + profilerStartTime = now(); + 0 > componentEffectStartTime && + (componentEffectStartTime = profilerStartTime); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } + function ensureRootIsScheduled(root) { + root !== lastScheduledRoot && + null === root.next && + (null === lastScheduledRoot + ? (firstScheduledRoot = lastScheduledRoot = root) + : (lastScheduledRoot = lastScheduledRoot.next = root)); + mightHavePendingSyncWork = !0; + null !== ReactSharedInternals.actQueue + ? didScheduleMicrotask_act || + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) + : didScheduleMicrotask || + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); + } + function flushSyncWorkAcrossRoots_impl(syncTransitionLanes) { + if (!isFlushingWork && mightHavePendingSyncWork) { + isFlushingWork = !0; + do { + var didPerformSomeWork = !1; + for (var root = firstScheduledRoot; null !== root; ) { + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var nextLanes = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + nextLanes = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); + nextLanes = + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 + : nextLanes + ? nextLanes | 2 + : 0; + } + 0 !== nextLanes && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); + } else + (nextLanes = workInProgressRootRenderLanes), + (nextLanes = getNextLanes( + root, + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + )), + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); + root = root.next; + } + } while (didPerformSomeWork); + isFlushingWork = !1; } } - function processUpdateQueue( - workInProgress, - props, - instance$jscomp$0, - renderLanes - ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + function processRootScheduleInImmediateTask() { + schedulerEvent = global.event; + processRootScheduleInMicrotask(); + } + function processRootScheduleInMicrotask() { + mightHavePendingSyncWork = + didScheduleMicrotask_act = + didScheduleMicrotask = + !1; + for ( + var currentTime = now$1(), prev = null, root = firstScheduledRoot; + null !== root; + + ) { + var next = root.next, + nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); + 0 === nextLanes + ? ((root.next = null), + null === prev ? (firstScheduledRoot = next) : (prev.next = next), + null === next && (lastScheduledRoot = prev)) + : ((prev = root), + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); + root = next; } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; - } - currentlyProcessingQueue = null; + (pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE) || + flushSyncWorkAcrossRoots_impl(0); + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback + function scheduleTaskForRootDuringMicrotask(root, currentTime) { + for ( + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + expirationTimes = root.expirationTimes, + lanes = root.pendingLanes & -62914561; + 0 < lanes; + + ) { + var index = 31 - clz32(lanes), + lane = 1 << index, + expirationTime = expirationTimes[index]; + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) + expirationTimes[index] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + lanes &= ~lane; + } + currentTime = workInProgressRoot; + suspendedLanes = workInProgressRootRenderLanes; + suspendedLanes = getNextLanes( + root, + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); + pingedLanes = root.callbackNode; + if ( + 0 === suspendedLanes || + (root === currentTime && + (workInProgressSuspendedReason === SuspendedOnData || + workInProgressSuspendedReason === SuspendedOnAction)) || + null !== root.cancelPendingCommit + ) + return ( + null !== pingedLanes && cancelCallback(pingedLanes), + (root.callbackNode = null), + (root.callbackPriority = 0) ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ + if ( + 0 === (suspendedLanes & 3) || + checkIfRootIsPrerendering(root, suspendedLanes) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode$1) ) - callCallback(callbacks[updateQueue], context); - } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode$1)) + : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; + } + null !== pingedLanes && cancelCallback(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + schedulerEvent = global.event; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; + var originalCallbackNode = root.callbackNode; + pendingDelayedCommitReason === IMMEDIATE_COMMIT && + (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT); + if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return null != root.callbackNode && + root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; } - function pushDehydratedActivitySuspenseHandler(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push(suspenseHandlerStackCursor, fiber, fiber); - null === shellBoundary && (shellBoundary = fiber); - } - function pushOffscreenSuspenseHandler(fiber) { - 22 === fiber.tag - ? (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary && (shellBoundary = fiber)) - : reuseSuspenseHandlerOnStack(fiber); - } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); + function performSyncWorkOnRoot(root, lanes) { + if (flushPendingEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); } - function pushSuspenseListContext(fiber, newContext) { - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - push(suspenseStackCursor, newContext, fiber); + function cancelCallback(callbackNode) { + callbackNode !== fakeActCallbackNode$1 && + null !== callbackNode && + cancelCallback$1(callbackNode); } - function popSuspenseListContext(fiber) { - pop(suspenseStackCursor, fiber); - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); + function scheduleImmediateRootScheduleTask() { + null !== ReactSharedInternals.actQueue && + ReactSharedInternals.actQueue.push(function () { + processRootScheduleInMicrotask(); + return null; + }); + scheduleMicrotask(function () { + (executionContext & (RenderContext | CommitContext)) !== NoContext + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); + }); } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - (null === state.dehydrated || - isSuspenseInstancePending() || - isSuspenseInstanceFallback()) - ) - return node; - } else if ( - 19 === node.tag && - "independent" !== 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; + function requestTransitionLane() { + if (0 === currentEventTransitionLane) { + var actionScopeLane = currentEntangledLane; + 0 === actionScopeLane && + ((actionScopeLane = nextTransitionUpdateLane), + (nextTransitionUpdateLane <<= 1), + 0 === (nextTransitionUpdateLane & 261888) && + (nextTransitionUpdateLane = 256)); + currentEventTransitionLane = actionScopeLane; } - return null; + return currentEventTransitionLane; } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); + 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 updateHookTypesDev() { - var hookName = currentHookNameInDev; + function pingEngtangledActionScope() { if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + 0 === --currentEntangledPendingCount && + (-1 < transitionUpdateTime || (transitionStartTime = -1.1), + (entangledTransitionTypes = null), + null !== currentEntangledListeners) ) { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber); - 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; + 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); } - 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 - ); + }; + 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 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 peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber); - 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 pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; } - 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; + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } return !0; } - function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes - ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; + } + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), console.error( - "%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.", - null === nextRenderLanes - ? "An unknown Component" - : "<" + nextRenderLanes + ">" - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - 0 !== (workInProgress.mode & 8); - 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 + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop, noop), + (thenable = index)); + if (void 0 === thenable._debugInfo && Object.isExtensible(thenable)) { + thenableState = performance.now(); + trackedThenables = thenable.displayName; + var ioInfo = { + name: + "string" === typeof trackedThenables ? trackedThenables : "Promise", + start: thenableState, + end: thenableState, + value: thenable + }; + thenable._debugInfo = [{ awaited: ioInfo }]; + "fulfilled" !== thenable.status && + "rejected" !== thenable.status && + ((thenableState = function () { + ioInfo.end = performance.now(); + }), + thenable.then(thenableState, thenableState)); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + thenableState = thenable.reason; + checkIfUseWrappedInAsyncCatch(thenableState); + if (void 0 === thenableState && !("reason" in thenable)) + throw Error( + "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." + ); + throw thenableState; + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; + } + } + function resolveLazy(lazyType) { + try { + return callLazyInitInDEV(lazyType); + } catch (x) { + if (null !== x && "object" === typeof x && "function" === typeof x.then) + throw ( + ((suspendedThenable = x), + (needsToResetSuspendedThenableDEV = !0), + SuspenseException) ); - } finally { - setIsStrictModeForDevtools(!1); - } + throw x; } - 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 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 1206910976) !== (workInProgress.flags & 1206910976) && - 0 !== (current.mode & 1) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter = 0; - thenableState = null; - if (didRenderTooFewHooks) + function getSuspendedThenable() { + if (null === suspendedThenable) throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + "Expected a suspended thenable. This is a bug in React. Please file an issue." ); - 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." - ))); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber = 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); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; + function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber.flags |= 1024); - return maybeThenable; + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - 0 !== (workInProgress.mode & 16) - ? workInProgress.flags & -805308421 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; + function getCurrentDebugTask() { + var debugInfo = currentDebugInfo; + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if (null != debugInfo[i].name) { + var debugTask = debugInfo[i].debugTask; + if (null != debugTask) return debugTask; + } + return null; } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; + 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 && "ref" !== 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`, `ref`, and `children` props.", + erroredKey + ); + }, + key + ); + break; } - didScheduleRenderPhaseUpdate = !1; } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter = 0; - thenableState = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; + function unwrapThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + return trackUsedThenable(thenableState$1, thenable, index); } - function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } - function useThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - thenable = trackUsedThenable(thenableState, thenable, index); - index = currentlyRenderingFiber; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; + function throwOnInvalidObjectTypeImpl(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 use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_RECOVERABLE_TYPE) return; - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error("An unsupported type was passed to use(): " + String(usable)); + function throwOnInvalidObjectType(returnFiber, newChild) { + var debugTask = getCurrentDebugTask(); + null !== debugTask + ? debugTask.run( + throwOnInvalidObjectTypeImpl.bind(null, returnFiber, newChild) + ) + : throwOnInvalidObjectTypeImpl(returnFiber, newChild); } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && - 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 - ); - memoCache.index++; - return updateQueue; + function warnOnFunctionTypeImpl(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 basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + function warnOnFunctionType(returnFiber, invalidChild) { + var debugTask = getCurrentDebugTask(); + null !== debugTask + ? debugTask.run( + warnOnFunctionTypeImpl.bind(null, returnFiber, invalidChild) + ) + : warnOnFunctionTypeImpl(returnFiber, invalidChild); } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; + function warnOnSymbolTypeImpl(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 updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); + function warnOnSymbolType(returnFiber, invalidChild) { + var debugTask = getCurrentDebugTask(); + null !== debugTask + ? debugTask.run( + warnOnSymbolTypeImpl.bind(null, returnFiber, invalidChild) + ) + : warnOnSymbolTypeImpl(returnFiber, invalidChild); } - 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; + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); } - current.baseQueue !== baseQueue && - console.error( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + } + 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.index, currentFirstChild) + : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) + : newIndex ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + newFiber.flags |= 134217730; + return lastPlacedIndex; } - 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, - gesture: null, - 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, - gesture: null, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - gesture: update.gesture, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 134217730); + 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 + ); + 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 + )), + coerceRef(current, element), + validateFragmentProps(element, current, returnFiber), + current + ); if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; + 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; } - 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; - } - return [newState, dispatch]; - } - function mountSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - if (!didWarnUncachedGetSnapshot) { - var cachedSnapshot = getSnapshot(); - objectIs(nextSnapshot, cachedSnapshot) || - (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 & 127) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - hook.memoizedState = nextSnapshot; - cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = cachedSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, cachedSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - { destroy: void 0 }, - updateStoreInstance.bind( - null, - fiber, - cachedSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; - } - function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = updateWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - if (!didWarnUncachedGetSnapshot) { - var cachedSnapshot = getSnapshot(); - objectIs(nextSnapshot, cachedSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - nextSnapshot - )) - ) - (hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - subscribe = - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - (workInProgressHook.memoizedState.tag & HasEffect) !== NoFlags); - pushSimpleEffect( - subscribe ? HasEffect | Passive : Passive, - { destroy: void 0 }, - updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), - null - ); - if (subscribe) { - fiber.flags |= 2048; - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." + 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 ); - 0 !== (renderLanes & 127) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - return nextSnapshot; - } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); - } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && - (startUpdateTimerByLane(2, "updateSyncExternalStore()", fiber), - 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 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 forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); - } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); + function 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 = resolveLazy(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (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; } - 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, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); - } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update action 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 = {}; - currentTransition.types = - null !== prevTransition ? prevTransition.types : null; - currentTransition._updatedFibers = new Set(); - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - null !== prevTransition && - null !== currentTransition.types && - (null !== prevTransition.types && - prevTransition.types !== currentTransition.types && - console.error( - "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." - ), - (prevTransition.types = currentTransition.types)), - (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 handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (ReactSharedInternals.asyncTransitions++, - returnValue.then(releaseAsyncTransition, releaseAsyncTransition), - returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop." - )) - : onActionSuccess(actionQueue, node, returnValue); - } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); - } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; - } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); - } - function actionStateReducer(oldState, newState) { - return newState; - } - function mountActionState(action, initialStateProp) { - var stateHook = mountWorkInProgressHook(); - stateHook.memoizedState = stateHook.baseState = initialStateProp; - var stateQueue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind( - null, - currentlyRenderingFiber, - stateQueue - ); - stateQueue.dispatch = stateHook; - stateQueue = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !1, - stateQueue.queue - ); - stateQueue = mountWorkInProgressHook(); - var actionQueue = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - stateQueue.queue = actionQueue; - stateHook = dispatchActionState.bind( - null, - currentlyRenderingFiber, - actionQueue, - setPendingState, - stateHook - ); - actionQueue.dispatch = stateHook; - stateQueue.memoizedState = action; - return [initialStateProp, stateHook, !1]; - } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); - } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; + 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 = resolveLazy(newChild)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( + returnFiber, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; + } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - { destroy: void 0 }, - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; - } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; - } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; - } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.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 mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - { destroy: void 0 }, - create, - 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 = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); - } - function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber.mode & 16) - ? mountEffectImpl(545261568, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); - } - function useEffectEventImpl(payload) { - currentlyRenderingFiber.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + 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." + 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) ); - return ref.impl.apply(void 0, arguments); - }; - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 268435456); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - 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; + 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 = resolveLazy(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; } - ); - } - 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; - 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 268435456); - 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); + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; } - 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 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 = resolveLazy(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); } + return knownKeys; } - 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 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 ); - } - function mountDeferredValueImpl(hook, value, initialValue) { - if ( - void 0 === initialValue || - (0 !== (renderLanes & 1073741824) && - 0 === (workInProgressRootRenderLanes & 261930)) - ) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; - } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if ( - 0 === (renderLanes & 106) || - (0 !== (renderLanes & 1073741824) && - 0 === (workInProgressRootRenderLanes & 261930)) - ) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; - } - function releaseAsyncTransition() { - ReactSharedInternals.asyncTransitions--; - } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - currentTransition.types = - null !== prevTransition ? prevTransition.types : null; - currentTransition._updatedFibers = new Set(); - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - ReactSharedInternals.asyncTransitions++; - returnValue.then(releaseAsyncTransition, releaseAsyncTransition); - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (currentUpdatePriority = previousPriority), - null !== prevTransition && - null !== currentTransition.types && - (null !== prevTransition.types && - prevTransition.types !== currentTransition.types && - console.error( - "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." - ), - (prevTransition.types = currentTransition.types)), - (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 mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); - } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix, - globalClientId = globalClientIdCounter++; - identifierPrefix = - "_" + identifierPrefix + "r_" + globalClientId.toString(32) + "_"; - return (hook.memoizedState = identifierPrefix); - } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - } - function refreshCache(fiber, seedKey) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider), - refreshUpdate = createUpdate(lane), - root = enqueueUpdate(provider, refreshUpdate, lane); - null !== root && - (startUpdateTimerByLane(lane, "refresh()", fiber), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - fiber = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - console.error( - "The seed argument is not enabled outside experimental channels." - ); - refreshUpdate.payload = { cache: fiber }; - return; - } - provider = provider.return; - } - } - function dispatchReducerAction(fiber, queue, action) { - var args = arguments; - "function" === typeof args[3] && - 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()." - ); - args = requestUpdateLane(fiber); - var update = { - lane: args, - revertLane: 0, - gesture: null, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, update) - : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), - null !== update && - (startUpdateTimerByLane(args, "dispatch()", fiber), - scheduleUpdateOnFiber(update, fiber, args), - entangleTransitionUpdate(update, queue, args))); - } - function dispatchSetState(fiber, queue, action) { - var args = arguments; - "function" === typeof args[3] && - 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()." - ); - args = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, args) && - startUpdateTimerByLane(args, "setState()", fiber); - } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - gesture: null, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - ReactSharedInternals.H = prevDispatcher; + 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; } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) + if (newIdx === newChildren.length) return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild ); - } - 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(), - gesture: null, - 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, "setOptimistic()", fiber), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber || - (null !== alternate && alternate === currentlyRenderingFiber) - ); - } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194048)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); - } - } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } - } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); + 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)); + 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 && + ((newFiber = nextOldFiber.alternate), + null !== newFiber && + oldFiber.delete( + null === newFiber.key ? newIdx : newFiber.key + )), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); - } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext - ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); + 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; } - } - void 0 === oldProps && - console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys ); - return oldProps; - } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; - } - function constructClassInstance(workInProgress, ctor, props) { - var context = emptyContextObject, - contextType = ctor.contextType; - if ( - "contextType" in ctor && - null !== contextType && - (void 0 === contextType || - contextType.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(ctor) - ) { - didWarnAboutInvalidateContextType.add(ctor); - var addendum = - void 0 === contextType - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof contextType - ? " However, it is set to a " + typeof contextType + "." - : contextType.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(contextType).join(", ") + - "}."; - console.error( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(ctor) || "Component", - addendum - ); - } - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - contextType = new ctor(props, context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - contextType = new ctor(props, context); - } finally { - setIsStrictModeForDevtools(!1); + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - } - props = workInProgress.memoizedState = - null !== contextType.state && void 0 !== contextType.state - ? contextType.state - : null; - contextType.updater = classComponentUpdater; - workInProgress.stateNode = contextType; - contextType._reactInternals = workInProgress; - contextType._reactInternalInstance = fakeInternalInstance; - "function" === typeof ctor.getDerivedStateFromProps && - null === props && - ((workInProgress = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUninitializedState.has(workInProgress) || - (didWarnAboutUninitializedState.add(workInProgress), - console.error( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - workInProgress, - null === contextType.state ? "null" : "undefined", - workInProgress - ))); - if ( - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof contextType.getSnapshotBeforeUpdate - ) - if ( - ((context = props = workInProgress = null), - "function" === typeof contextType.componentWillMount && - !0 !== contextType.componentWillMount.__suppressDeprecationWarning - ? (workInProgress = "componentWillMount") - : "function" === typeof contextType.UNSAFE_componentWillMount && - (workInProgress = "UNSAFE_componentWillMount"), - "function" === typeof contextType.componentWillReceiveProps && - !0 !== - contextType.componentWillReceiveProps.__suppressDeprecationWarning - ? (props = "componentWillReceiveProps") - : "function" === - typeof contextType.UNSAFE_componentWillReceiveProps && - (props = "UNSAFE_componentWillReceiveProps"), - "function" === typeof contextType.componentWillUpdate && - !0 !== contextType.componentWillUpdate.__suppressDeprecationWarning - ? (context = "componentWillUpdate") - : "function" === typeof contextType.UNSAFE_componentWillUpdate && - (context = "UNSAFE_componentWillUpdate"), - null !== workInProgress || null !== props || null !== context) - ) - (addendum = getComponentNameFromType(ctor) || "Component"), - (ctor = - "function" === typeof ctor.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"), - didWarnAboutLegacyLifecyclesAndDerivedState.has(addendum) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(addendum), - console.error( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - addendum, - ctor, - null !== workInProgress ? "\n " + workInProgress : "", - null !== props ? "\n " + props : "", - null !== context ? "\n " + context : "" - )); - return contextType; - } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext - ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); - } - function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode, - name = getComponentNameFromType(ctor) || "Component"; - instance.render || - (ctor.prototype && "function" === typeof ctor.prototype.render - ? console.error( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - name - ) - : console.error( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - name - )); - !instance.getInitialState || - instance.getInitialState.isReactClassApproved || - instance.state || - console.error( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - name - ); - instance.getDefaultProps && - !instance.getDefaultProps.isReactClassApproved && - console.error( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - name - ); - instance.contextType && - console.error( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - name - ); - ctor.childContextTypes && - !didWarnAboutChildContextTypes.has(ctor) && - (didWarnAboutChildContextTypes.add(ctor), - console.error( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - name - )); - ctor.contextTypes && - !didWarnAboutContextTypes$1.has(ctor) && - (didWarnAboutContextTypes$1.add(ctor), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - name - )); - "function" === typeof instance.componentShouldUpdate && - console.error( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - name - ); - ctor.prototype && - ctor.prototype.isPureReactComponent && - "undefined" !== typeof instance.shouldComponentUpdate && - console.error( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(ctor) || "A pure component" - ); - "function" === typeof instance.componentDidUnmount && - console.error( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - name - ); - "function" === typeof instance.componentDidReceiveProps && - console.error( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - name - ); - "function" === typeof instance.componentWillRecieveProps && - console.error( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - name - ); - "function" === typeof instance.UNSAFE_componentWillRecieveProps && - console.error( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - name - ); - var hasMutatedProps = instance.props !== newProps; - void 0 !== instance.props && - hasMutatedProps && - console.error( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - name - ); - instance.defaultProps && - console.error( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - name, - name - ); - "function" !== typeof instance.getSnapshotBeforeUpdate || - "function" === typeof instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), - console.error( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(ctor) - )); - "function" === typeof instance.getDerivedStateFromProps && - console.error( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof instance.getDerivedStateFromError && - console.error( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - name - ); - "function" === typeof ctor.getSnapshotBeforeUpdate && - console.error( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - name - ); - (hasMutatedProps = instance.state) && - ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && - console.error("%s.state: must be set to an object or null", name); - "function" === typeof instance.getChildContext && - "object" !== typeof ctor.childContextTypes && - console.error( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - name - ); - instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - name = ctor.contextType; - instance.context = - "object" === typeof name && null !== name - ? readContext(name) - : emptyContextObject; - instance.state === newProps && - ((name = getComponentNameFromType(ctor) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(name) || - (didWarnAboutDirectlyAssigningPropsToState.add(name), - console.error( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - name - ))); - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - instance - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - instance - ); - instance.state = workInProgress.memoizedState; - name = ctor.getDerivedStateFromProps; - "function" === typeof name && - (applyDerivedStateFromProps(workInProgress, ctor, name, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - (console.error( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 268435456); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; - } - function defaultOnRecoverableError(error) { - reportGlobalError(error); - } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); - } - } catch (e) { - setTimeout(function () { - throw e; - }); - } - } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e) { - setTimeout(function () { - throw e; - }); - } - } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; - } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; - } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - console.error( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); - } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes - ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 31: - case 13: - case 19: - return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended)), - (currentSourceFiber.flags &= -257), - 0 === (currentSourceFiber.mode & 1) - ? currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)) - : ((currentSourceFiber.flags |= 65536), - (currentSourceFiber.lanes = rootRenderLanes)), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); - } - if (1 === root.tag) + if (step.done) return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild ); - value = Error( - "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." - ); - } - currentSourceFiber = createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber - ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - value, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - sourceFiber = returnFiber.type; - currentSourceFiber = returnFiber.stateNode; - if ( - 0 === (returnFiber.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - )))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( returnFiber, - value - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - break; - case 22: - if (null !== returnFiber.memoizedState) - return (returnFiber.flags |= 65536), !1; + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + return resultingFirstChild; } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; - } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); - } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var resolvedRender = resolveTypeForHotReloading(Component); - resolvedRender !== Component && - ((Component = resolvedRender), - null !== current && (didReceiveUpdate = !0)); - resolvedRender = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - resolvedRender, - renderLanes - ); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; - } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (Component = resolveTypeForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys + )), + shouldTrackSideEffects && + ((step = nextOldFiber.alternate), + null !== step && + oldFiber.delete(null === step.key ? newIdx : step.key)), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); - } - function updateOffscreenComponent( - current, - workInProgress, - renderLanes, - nextProps - ) { - var nextChildren = nextProps.children, - prevState = null !== current ? current.memoizedState : null; - null === current && - null === workInProgress.stateNode && - (workInProgress.stateNode = { - _visibility: OffscreenVisible, - _pendingMarkers: null, - _retryCache: null, - _transitions: null - }); - if ("hidden" === nextProps.mode) { - if (0 !== (workInProgress.flags & 128)) { - prevState = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextProps = workInProgress.child = current.child; - for (nextChildren = 0; null !== nextProps; ) - (nextChildren = - nextChildren | nextProps.lanes | nextProps.childLanes), - (nextProps = nextProps.sibling); - nextProps = nextChildren & ~prevState; - } else (nextProps = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - prevState, - renderLanes, - nextProps - ); + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + void 0 === newChild.props.ref && + (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 + ); + coerceRef(lanes, newChild); + 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 && + resolveLazy(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 + )), + coerceRef(lanes, newChild), + (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 = resolveLazy(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = newChild; + newChild = getIteratorFn(prevDebugInfo); + if ("function" !== typeof newChild) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + key = newChild.call(prevDebugInfo); + if (key === prevDebugInfo) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== Object.prototype.toString.call(key) + ) + 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 + prevDebugInfo.entries !== newChild || + didWarnAboutMaps || + (console.error( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + key, + lanes + ); + } + 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 (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) return ( - (nextProps = workInProgress.lanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes, - nextProps - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + (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; + try { + thenableIndexCounter$1 = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState$1 = 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; + } + }; } - function bailoutOffscreenComponent(current, workInProgress) { - (null !== current && 22 === current.tag) || - null !== workInProgress.stateNode || - (workInProgress.stateNode = { - _visibility: OffscreenVisible, - _pendingMarkers: null, - _retryCache: null, - _transitions: null - }); - return workInProgress.sibling; + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + console.error( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes, - remainingChildLanes - ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue2, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - workInProgress.childLanes = remainingChildLanes; - return null; + function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } } - function mountActivityChildren(workInProgress, nextProps) { - var hiddenProp = nextProps.hidden; - void 0 !== hiddenProp && - console.error( - ' doesn\'t accept a hidden prop. Use mode="hidden" instead.\n- \n+ ', - !0 === hiddenProp - ? "hidden" - : !1 === hiddenProp - ? "hidden={false}" - : "hidden={...}", - hiddenProp ? 'mode="hidden"' : 'mode="visible"' - ); - nextProps = mountWorkInProgressOffscreenFiber( - { mode: nextProps.mode, children: nextProps.children }, - workInProgress.mode - ); - nextProps.ref = workInProgress.ref; - workInProgress.child = nextProps; - nextProps.return = workInProgress; - return nextProps; + function enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); } - function retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountActivityChildren( - workInProgress, - workInProgress.pendingProps - ); - current.flags |= 2; - popSuspenseHandler(workInProgress); - workInProgress.memoizedState = null; - return current; + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 4194816); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." - ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 4194816; - } + function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (console.error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ), - (didWarnAboutBadClass[componentName] = !0)); - } - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null + function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || + sourceFiber._visibility & OffscreenVisible || + (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; + } + function getRootForUpdatedFiber(sourceFiber) { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) + throw ( + ((nestedPassiveUpdateCount = nestedUpdateCount = 0), + (rootWithPassiveNestedUpdates = rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes - ); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; + nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && + ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null), + console.error( + "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." + )); + null === sourceFiber.alternate && + 0 !== (sourceFiber.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + for (var node = sourceFiber, parent = node.return; null !== parent; ) + null === node.alternate && + 0 !== (node.flags & 4098) && + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), + (node = parent), + (parent = node.return); + return 3 === node.tag ? node.stateNode : null; } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - if (null !== current && !didReceiveUpdate) + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; + } + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); + } + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + } + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if ( + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate + ) { + var componentName = getComponentNameFromFiber(fiber); + console.error( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName + ); + didWarnUpdateInsideUpdate = !0; + } + if ((executionContext & RenderContext) !== NoContext) return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function updateClassComponent( - current, + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } + } + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; + } + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } + } + function processUpdateQueue( workInProgress, - Component, - nextProps, + props, + instance$jscomp$0, renderLanes ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) - ); - enqueueCapturedUpdate(workInProgress, lane); - } - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (_instance = !0); - else if (null === current) { - _instance = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - _instance.props = lane; - var oldContext = _instance.context, - contextType = Component.contextType; - state = emptyContextObject; - "object" === typeof contextType && - null !== contextType && - (state = readContext(contextType)); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType = - "function" === typeof getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== state) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - state - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - state - )) - ? (contextType || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ("function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount()), - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 268435456)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 268435456), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (_instance.props = nextProps), - (_instance.state = oldContext), - (_instance.context = state), - (_instance = lane)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 268435456), - (_instance = !1)); - } else { - _instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - state = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, state); - _instance.props = contextType; - getDerivedStateFromProps = workInProgress.pendingProps; - oldState = _instance.context; - oldContext = Component.contextType; - lane = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (lane = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof _instance.getSnapshotBeforeUpdate) || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((state !== getDerivedStateFromProps || oldState !== lane) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - lane - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - state !== getDerivedStateFromProps || - oldState !== newState || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - oldState, - newState, - lane - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (oldContext || - ("function" !== typeof _instance.UNSAFE_componentWillUpdate && - "function" !== typeof _instance.componentWillUpdate) || - ("function" === typeof _instance.componentWillUpdate && - _instance.componentWillUpdate(nextProps, newState, lane), - "function" === typeof _instance.UNSAFE_componentWillUpdate && - _instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - lane - )), - "function" === typeof _instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof _instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (_instance.props = nextProps), - (_instance.state = newState), - (_instance.context = lane), - (_instance = contextType)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (_instance = !1)); - } - current = finishClassComponent( - current, - workInProgress, - Component, - _instance, - !1, - renderLanes - ); - Component = workInProgress.stateNode; - _instance && - Component.props !== nextProps && - (didWarnAboutReassigningProps || - console.error( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" - ), - (didWarnAboutReassigningProps = !0)); - return current; - } - function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes - ) { - markRef(current, workInProgress); - hasContext = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !hasContext) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - shouldUpdate = workInProgress.stateNode; - setCurrentFiber(workInProgress); - if ( - hasContext && - "function" !== typeof Component.getDerivedStateFromError - ) - (Component = null), (profilerStartTime = -1); - else if ( - ((Component = callRenderInDEV(shouldUpdate)), workInProgress.mode & 8) - ) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(shouldUpdate); - } finally { - setIsStrictModeForDevtools(!1); - } - } - workInProgress.flags |= 1; - null !== current && hasContext - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - return workInProgress.child; - } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && - console.error( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" - ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (console.error( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (console.error( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); - } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; - } - function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes - ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; - } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - didSuspend = nextProps.children; - nextProps = nextProps.fallback; - if (showFallback) { - reuseSuspenseHandlerOnStack(workInProgress); - showFallback = workInProgress.mode; - var progressedPrimaryFragment = workInProgress.child; - didSuspend = { mode: "hidden", children: didSuspend }; - 0 === (showFallback & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = didSuspend), - workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = mountWorkInProgressOffscreenFiber( - didSuspend, - showFallback - )); - nextProps = createFiberFromFragment( - nextProps, - showFallback, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - nextProps.return = workInProgress; - progressedPrimaryFragment.sibling = nextProps; - workInProgress.child = progressedPrimaryFragment; - nextProps = workInProgress.child; - nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(null, nextProps); - } - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, didSuspend); - } - progressedPrimaryFragment = current.memoizedState; - if (null !== progressedPrimaryFragment) { - var _dehydrated2 = progressedPrimaryFragment.dehydrated; - if (null !== _dehydrated2) - return updateDehydratedSuspenseComponent( - current, - workInProgress, - didSuspend, - JSCompiler_temp, - nextProps, - _dehydrated2, - progressedPrimaryFragment, - renderLanes - ); - } - if (showFallback) { - reuseSuspenseHandlerOnStack(workInProgress); - showFallback = nextProps.fallback; - didSuspend = workInProgress.mode; - progressedPrimaryFragment = current.child; - _dehydrated2 = progressedPrimaryFragment.sibling; - var primaryChildProps = { - mode: "hidden", - children: nextProps.children - }; - 0 === (didSuspend & 1) && - workInProgress.child !== progressedPrimaryFragment - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = primaryChildProps), - workInProgress.mode & 2 && - ((nextProps.actualDuration = -0), - (nextProps.actualStartTime = -1.1), - (nextProps.selfBaseDuration = - progressedPrimaryFragment.selfBaseDuration), - (nextProps.treeBaseDuration = - progressedPrimaryFragment.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - progressedPrimaryFragment, - primaryChildProps - )), - (nextProps.subtreeFlags = - progressedPrimaryFragment.subtreeFlags & 1206910976)); - null !== _dehydrated2 - ? (showFallback = createWorkInProgress(_dehydrated2, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - didSuspend, - renderLanes, - null - )), - (showFallback.flags |= 2)); - showFallback.return = workInProgress; - nextProps.return = workInProgress; - nextProps.sibling = showFallback; - workInProgress.child = nextProps; - bailoutOffscreenComponent(null, nextProps); - nextProps = workInProgress.child; - showFallback = current.child.memoizedState; - null === showFallback - ? (showFallback = mountSuspenseOffscreenState(renderLanes)) - : ((didSuspend = showFallback.cachePool), - null !== didSuspend - ? ((progressedPrimaryFragment = CacheContext._currentValue2), - (didSuspend = - didSuspend.parent !== progressedPrimaryFragment - ? { - parent: progressedPrimaryFragment, - pool: progressedPrimaryFragment - } - : didSuspend)) - : (didSuspend = getSuspendedCache()), - (showFallback = { - baseLanes: showFallback.baseLanes | renderLanes, - cachePool: didSuspend - })); - nextProps.memoizedState = showFallback; - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(current.child, nextProps); - } - null !== progressedPrimaryFragment && - (renderLanes & 62914560) === renderLanes && - 0 !== (renderLanes & current.lanes) && - markRenderDerivedCause(workInProgress); - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; - } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); - } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - offscreenProps = createFiber(22, offscreenProps, null, mode); - offscreenProps.lanes = 0; - return offscreenProps; - } - function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; - } - function updateDehydratedSuspenseComponent( - current, - workInProgress, - didSuspend, - didPrimaryChildrenDefer, - nextProps, - suspenseInstance, - suspenseState, - renderLanes - ) { - if (didSuspend) { - if (workInProgress.flags & 256) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) - ); - if (null !== workInProgress.memoizedState) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - null - ); - reuseSuspenseHandlerOnStack(workInProgress); - suspenseState = nextProps.fallback; - didSuspend = workInProgress.mode; - nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - didSuspend - ); - suspenseState = createFiberFromFragment( - suspenseState, - didSuspend, - renderLanes, - null - ); - suspenseState.flags |= 2; - nextProps.return = workInProgress; - suspenseState.return = workInProgress; - nextProps.sibling = suspenseState; - workInProgress.child = nextProps; - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ); - nextProps = workInProgress.child; - nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - didPrimaryChildrenDefer, - renderLanes - ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(null, nextProps); - } - pushPrimaryTreeSuspenseHandler(workInProgress); - 0 !== (renderLanes & 536870912) && markRenderDerivedCause(workInProgress); - if (isSuspenseInstanceFallback()) - return ( - (didSuspend = getSuspenseInstanceFallbackErrorDetails()), - (didPrimaryChildrenDefer = didSuspend.digest), - (suspenseState = didSuspend.message), - (nextProps = didSuspend.stack), - (didSuspend = didSuspend.componentStack), - didPrimaryChildrenDefer !== REACT_RECOVERABLE_DIGEST && - ((suspenseState = suspenseState - ? Error(suspenseState) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (suspenseState.stack = nextProps || ""), - (suspenseState.digest = didPrimaryChildrenDefer), - (didPrimaryChildrenDefer = - void 0 === didSuspend ? null : didSuspend), - (nextProps = { - value: suspenseState, - source: null, - stack: didPrimaryChildrenDefer - }), - "string" === typeof didPrimaryChildrenDefer && - CapturedStacks.set(suspenseState, nextProps), - null === hydrationErrors - ? (hydrationErrors = [nextProps]) - : hydrationErrors.push(nextProps)), - retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1); - didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes); - if (didReceiveUpdate || didPrimaryChildrenDefer) { - if (null !== currentTreeHiddenStackCursor.current) - return retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - didPrimaryChildrenDefer = workInProgressRoot; - if ( - null !== didPrimaryChildrenDefer && - ((nextProps = getBumpedLaneForHydration( - didPrimaryChildrenDefer, - renderLanes - )), - 0 !== nextProps && nextProps !== suspenseState.retryLane) - ) - throw ( - ((suspenseState.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps), - SelectiveHydrationException) - ); - isSuspenseInstancePending() || renderDidSuspendDelayIfPossible(); - return retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } - if (isSuspenseInstancePending()) - return ( - (workInProgress.flags |= 192), - (workInProgress.child = current.child), - null - ); - current = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - ); - current.flags |= 134221824; - return current; - } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot - ); - } - function findLastContentRow(firstChild) { - for (var lastContentRow = null; null !== firstChild; ) { - var currentRow = firstChild.alternate; - null !== currentRow && - null === findFirstSuspended(currentRow) && - (lastContentRow = firstChild); - firstChild = firstChild.sibling; - } - return lastContentRow; - } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode, - treeForkCount - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode, - treeForkCount: treeForkCount - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode), - (renderState.treeForkCount = treeForkCount)); - } - function reverseChildren(fiber) { - var row = fiber.child; - for (fiber.child = null; null !== row; ) { - var nextRow = row.sibling; - row.sibling = fiber.child; - fiber.child = row; - row = nextRow; - } - } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - var suspenseContext = suspenseStackCursor.current; - if (workInProgress.flags & 128) - return pushSuspenseListContext(workInProgress, suspenseContext), null; - var shouldForceFallback = 0 !== (suspenseContext & ForceSuspenseFallback); - shouldForceFallback - ? ((suspenseContext = - (suspenseContext & SubtreeSuspenseContextMask) | - ForceSuspenseFallback), - (workInProgress.flags |= 128)) - : (suspenseContext &= SubtreeSuspenseContextMask); - pushSuspenseListContext(workInProgress, suspenseContext); - suspenseContext = null == revealOrder ? "null" : revealOrder; - if ( - null != revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "unstable_legacy-backwards" !== revealOrder && - "together" !== revealOrder && - "independent" !== revealOrder && - !didWarnAboutRevealOrder[suspenseContext] - ) - if ( - ((didWarnAboutRevealOrder[suspenseContext] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - case "independent": - console.error( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - console.error( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: - console.error( - '"%s" is not a supported revealOrder on . Did you mean "independent", "together", "forwards" or "backwards"?', - revealOrder - ); - } - else - console.error( - '%s is not a supported value for revealOrder on . Did you mean "independent", "together", "forwards" or "backwards"?', - revealOrder - ); - suspenseContext = null == tailMode ? "null" : tailMode; - didWarnAboutTailOptions[suspenseContext] || - null == tailMode || - ("visible" !== tailMode && - "collapsed" !== tailMode && - "hidden" !== tailMode - ? ((didWarnAboutTailOptions[suspenseContext] = !0), - console.error( - '"%s" is not a supported value for tail on . Did you mean "visible", "collapsed" or "hidden"?', - tailMode - )) - : null != revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "unstable_legacy-backwards" !== revealOrder && - ((didWarnAboutTailOptions[suspenseContext] = !0), - console.error( - ' is only valid if revealOrder is "forwards" (default) or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - (null == revealOrder || - "forwards" === revealOrder || - "backwards" === revealOrder || - "unstable_legacy-backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for ( - suspenseContext = 0; - suspenseContext < nextProps.length; - suspenseContext++ - ) { - if ( - !validateSuspenseListNestedChild( - nextProps[suspenseContext], - suspenseContext - ) - ) - break a; - } - else if ( - ((suspenseContext = getIteratorFn(nextProps)), - "function" === typeof suspenseContext) - ) { - if ((suspenseContext = suspenseContext.call(nextProps))) - for ( - var step = suspenseContext.next(), _i = 0; - !step.done; - step = suspenseContext.next() - ) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - console.error( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder - ); - "backwards" === revealOrder && null !== current - ? (reverseChildren(current), - reconcileChildren(current, workInProgress, nextProps, renderLanes), - reverseChildren(current)) - : reconcileChildren(current, workInProgress, nextProps, renderLanes); - if ( - !shouldForceFallback && - null !== current && - 0 !== (current.flags & 128) - ) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "backwards": - renderLanes = findLastContentRow(workInProgress.child); - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null), - reverseChildren(workInProgress)); - initSuspenseListRenderState( - workInProgress, - !0, - revealOrder, - null, - tailMode, - 0 - ); - break; - case "unstable_legacy-backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode, - 0 - ); - break; - case "together": - initSuspenseListRenderState( - workInProgress, - !1, - null, - null, - void 0, - 0 - ); - break; - case "independent": - workInProgress.memoizedState = null; - break; - default: - (renderLanes = findLastContentRow(workInProgress.child)), - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)), - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode, - 0 - ); - } - return workInProgress.child; - } - function updateContextProvider(current, workInProgress, renderLanes) { - var context = workInProgress.type, - newProps = workInProgress.pendingProps, - newValue = newProps.value; - "value" in newProps || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - console.error( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, context, newValue); - reconcileChildren( - current, - workInProgress, - newProps.children, - renderLanes - ); - return workInProgress.child; - } - function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); - } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; - } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; - } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache - ); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 31: - if (null !== workInProgress.memoizedState) - return ( - (workInProgress.flags |= 128), - pushDehydratedActivitySuspenseHandler(workInProgress), - null - ); - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - stateNode = propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ); - var primaryChildLanes = workInProgress.child.childLanes; - if (stateNode || 0 !== (renderLanes & primaryChildLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - if (workInProgress.flags & 128) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - primaryChildLanes = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (primaryChildLanes) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - primaryChildLanes = workInProgress.memoizedState; - null !== primaryChildLanes && - ((primaryChildLanes.rendering = null), - (primaryChildLanes.tail = null), - (primaryChildLanes.lastEffect = null)); - pushSuspenseListContext(workInProgress, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent( - current, - workInProgress, - renderLanes, - workInProgress.pendingProps - ) - ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache - ); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - resolveTypeForHotReloading(workInProgress.elementType), - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes - ); - renderLanes._debugStack = workInProgress._debugStack; - renderLanes._debugTask = workInProgress._debugTask; - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; - } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 134217730; - return renderLanes; - } - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - workInProgress.type !== current.type - ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else didReceiveUpdate = !1; - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((prevSibling = workInProgress.elementType), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (returnFiber = workInProgress.pendingProps), - (current = resolveLazy(prevSibling)), - (current = resolveTypeForHotReloading(current)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_CONTEXT_TYPE) { - workInProgress.tag = 10; - workInProgress.type = current; - workInProgress = updateContextProvider( - null, - workInProgress, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - current = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - if (null === current) - throw Error("Should have a current fiber. This is a bug in React."); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - nextProps = workInProgress.memoizedState; - var nextCache = nextProps.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - prevSibling = nextProps.element; - prevSibling === returnFiber - ? (workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )) - : (reconcileChildren( - current, - workInProgress, - prevSibling, - renderLanes - ), - (workInProgress = workInProgress.child)); - return workInProgress; - case 26: - case 27: - case 5: - return ( - pushHostContext(workInProgress), - (returnFiber = workInProgress.pendingProps.children), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue2 = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 6: - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - (returnFiber = workInProgress.pendingProps), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return updateContextProvider(current, workInProgress, renderLanes); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - console.error( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 17: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, returnFiber, prevSibling), - mountClassInstance( - workInProgress, - returnFiber, - prevSibling, - renderLanes - ), - finishClassComponent( - null, - workInProgress, - returnFiber, - !0, - !1, - renderLanes - ) - ); - case 28: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - case 31: - prevSibling = workInProgress.pendingProps; - nextProps = 0 !== (workInProgress.flags & 128); - workInProgress.flags &= -129; - if (null === current) - workInProgress = mountActivityChildren(workInProgress, prevSibling); - else if ( - ((returnFiber = current.memoizedState), null !== returnFiber) - ) - b: { - pushDehydratedActivitySuspenseHandler(workInProgress); - if (nextProps) { - if (workInProgress.flags & 256) { - workInProgress.flags &= -257; - workInProgress = retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - break b; - } - if (null !== workInProgress.memoizedState) { - workInProgress.child = current.child; - workInProgress.flags |= 128; - workInProgress = null; - break b; - } - throw Error( - "Client rendering an Activity suspended it again. This is a bug in React." - ); - } - 0 !== (renderLanes & 536870912) && - markRenderDerivedCause(workInProgress); - didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ); - nextProps = 0 !== (renderLanes & current.childLanes); - if (didReceiveUpdate || nextProps) { - if (null === currentTreeHiddenStackCursor.current) { - prevSibling = workInProgressRoot; - if ( - null !== prevSibling && - ((nextProps = getBumpedLaneForHydration( - prevSibling, - renderLanes - )), - 0 !== nextProps && nextProps !== returnFiber.retryLane) - ) - throw ( - ((returnFiber.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(prevSibling, current, nextProps), - SelectiveHydrationException) + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); + } + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps ); - renderDidSuspendDelayIfPossible(); - } - workInProgress = retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - (workInProgress = mountActivityChildren( - workInProgress, - prevSibling - )), - (workInProgress.flags |= 134221824); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } } - else - (returnFiber = current.child), - (prevSibling = { - mode: prevSibling.mode, - children: prevSibling.children - }), - 0 !== (renderLanes & 536870912) && - 0 !== (renderLanes & current.lanes) && - markRenderDerivedCause(workInProgress), - (current = createWorkInProgress(returnFiber, prevSibling)), - (current.ref = workInProgress.ref), - (workInProgress.child = current), - (current.return = workInProgress), - (workInProgress = current); - return workInProgress; - case 22: - return updateOffscreenComponent( - current, - workInProgress, - renderLanes, - workInProgress.pendingProps - ); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 30: - return ( - null === workInProgress.stateNode && - (workInProgress.stateNode = { - autoName: null, - paired: null, - clones: null, - ref: null - }), - (returnFiber = workInProgress.pendingProps), - null != returnFiber.name && - "auto" !== returnFiber.name && - (workInProgress.flags |= null === current ? 18882560 : 18874368), - void 0 !== returnFiber.className && - ((prevSibling = - "string" === typeof returnFiber.className - ? JSON.stringify(returnFiber.className) - : "{...}"), - didWarnAboutClassNameOnViewTransition[prevSibling] || - ((didWarnAboutClassNameOnViewTransition[prevSibling] = !0), - console.error( - ' doesn\'t accept a "className" prop. It has been renamed to "default".\n- \n+ ', - prevSibling, - prevSibling - ))), - null !== current && current.memoizedProps.name !== returnFiber.name - ? (workInProgress.flags |= 4194816) - : markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; + } + currentlyProcessingQueue = null; + } + function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error( + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback + ); + callback.call(context); + } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); + } + function 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 doesRequireClone(current, completedWork) { - if (null !== current && current.child === completedWork.child) return !1; - if (0 !== (completedWork.flags & 16)) return !0; - for (current = completedWork.child; null !== current; ) { - if (0 !== (current.flags & 8218) || 0 !== (current.subtreeFlags & 8218)) - return !0; - current = current.sibling; - } - return !1; + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); } - function appendAllChildren( - parent, - workInProgress, - needsVisibilityToggle, - isHidden - ) { - for (var _node = workInProgress.child; null !== _node; ) { - if (5 === _node.tag) { - var instance = _node.stateNode; - needsVisibilityToggle && - isHidden && - (instance = cloneHiddenInstance(instance)); - appendChildNode(parent.node, instance.node); - } else if (6 === _node.tag) { - instance = _node.stateNode; - if (needsVisibilityToggle && isHidden) - throw Error("Not yet implemented."); - appendChildNode(parent.node, instance.node); - } else if (4 !== _node.tag) - if (22 === _node.tag && null !== _node.memoizedState) - (instance = _node.child), - null !== instance && (instance.return = _node), - appendAllChildren(parent, _node, !0, !0); - else if (null !== _node.child) { - _node.child.return = _node; - _node = _node.child; - continue; - } - if (_node === workInProgress) break; - for (; null === _node.sibling; ) { - if (null === _node.return || _node.return === workInProgress) return; - _node = _node.return; - } - _node.sibling.return = _node.return; - _node = _node.sibling; - } + 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 appendAllChildrenToContainer( - containerChildSet, - workInProgress, - needsVisibilityToggle, - isHidden - ) { - for ( - var hasOffscreenComponentChild = !1, node = workInProgress.child; - null !== node; - - ) { - if (5 === node.tag) { - var instance = node.stateNode; - needsVisibilityToggle && - isHidden && - (instance = cloneHiddenInstance(instance)); - appendChildNodeToSet(containerChildSet, instance.node); - } else if (6 === node.tag) { - instance = node.stateNode; - if (needsVisibilityToggle && isHidden) - throw Error("Not yet implemented."); - appendChildNodeToSet(containerChildSet, instance.node); - } else if (4 !== node.tag) - if (22 === node.tag && null !== node.memoizedState) - (hasOffscreenComponentChild = node.child), - null !== hasOffscreenComponentChild && - (hasOffscreenComponentChild.return = node), - appendAllChildrenToContainer(containerChildSet, node, !0, !0), - (hasOffscreenComponentChild = !0); - else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === workInProgress) break; + function pushDehydratedActivitySuspenseHandler(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push(suspenseHandlerStackCursor, fiber, fiber); + null === shellBoundary && (shellBoundary = fiber); + } + function pushOffscreenSuspenseHandler(fiber) { + 22 === fiber.tag + ? (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary && (shellBoundary = fiber)) + : reuseSuspenseHandlerOnStack(fiber); + } + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + } + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); + } + function pushSuspenseListContext(fiber, newContext) { + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + push(suspenseStackCursor, newContext, fiber); + } + function popSuspenseListContext(fiber) { + pop(suspenseStackCursor, fiber); + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + } + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + (null === state.dehydrated || + isSuspenseInstancePending() || + isSuspenseInstanceFallback()) + ) + return node; + } else if ( + 19 === node.tag && + "independent" !== 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 === workInProgress) - return hasOffscreenComponentChild; + if (null === node.return || node.return === row) return null; node = node.return; } node.sibling.return = node.return; node = node.sibling; } - return hasOffscreenComponentChild; + return null; + } + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); + } + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + if ( + !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) || + 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 warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + 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 updateHostContainer(current, workInProgress) { - if (doesRequireClone(current, workInProgress)) { - current = workInProgress.stateNode; - var newChildSet = createChildNodeSet(); - appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1); - current.pendingChildren = newChildSet; - workInProgress.flags |= 4; - } + function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); } - function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue && (workInProgress.flags |= 4); - workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + 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 cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { - switch (renderState.tailMode) { - case "visible": - break; - case "collapsed": - for ( - var tailNode = renderState.tail, lastTailNode = null; - null !== tailNode; - - ) - null !== tailNode.alternate && (lastTailNode = tailNode), - (tailNode = tailNode.sibling); - null === lastTailNode - ? hasRenderedATailFallback || null === renderState.tail - ? (renderState.tail = null) - : (renderState.tail.sibling = null) - : (lastTailNode.sibling = null); - break; - default: - hasRenderedATailFallback = renderState.tail; - for (tailNode = null; null !== hasRenderedATailFallback; ) - null !== hasRenderedATailFallback.alternate && - (tailNode = hasRenderedATailFallback), - (hasRenderedATailFallback = hasRenderedATailFallback.sibling); - null === tailNode - ? (renderState.tail = null) - : (tailNode.sibling = null); + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + console.error( + "%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.", + null === nextRenderLanes + ? "An unknown Component" + : "<" + nextRenderLanes + ">" + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + 0 !== (workInProgress.mode & StrictLegacyMode); + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { + setIsStrictModeForDevtools(!0); + try { + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + ); + } finally { + setIsStrictModeForDevtools(!1); + } } + finishRenderingHooks(current, workInProgress); + return children; } - function bubbleProperties(completedWork) { - var didBailout = - null !== completedWork.alternate && - completedWork.alternate.child === completedWork.child, - newChildLanes = 0, - subtreeFlags = 0; - if (didBailout) - if (0 !== (completedWork.mode & 2)) { - for ( - var _treeBaseDuration = completedWork.selfBaseDuration, - _child2 = completedWork.child; - null !== _child2; - - ) - (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 1206910976), - (subtreeFlags |= _child2.flags & 1206910976), - (_treeBaseDuration += _child2.treeBaseDuration), - (_child2 = _child2.sibling); - completedWork.treeBaseDuration = _treeBaseDuration; - } else - for ( - _treeBaseDuration = completedWork.child; - null !== _treeBaseDuration; - - ) - (newChildLanes |= - _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 1206910976), - (subtreeFlags |= _treeBaseDuration.flags & 1206910976), - (_treeBaseDuration.return = completedWork), - (_treeBaseDuration = _treeBaseDuration.sibling); - else if (0 !== (completedWork.mode & 2)) { - _treeBaseDuration = completedWork.actualDuration; - _child2 = completedWork.selfBaseDuration; - for (var child = completedWork.child; null !== child; ) - (newChildLanes |= child.lanes | child.childLanes), - (subtreeFlags |= child.subtreeFlags), - (subtreeFlags |= child.flags), - (_treeBaseDuration += child.actualDuration), - (_child2 += child.treeBaseDuration), - (child = child.sibling); - completedWork.actualDuration = _treeBaseDuration; - completedWork.treeBaseDuration = _child2; - } else + 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 = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 1206910976) !== (workInProgress.flags & 1206910976) && + 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." + ))); + } + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = 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); + } + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; + } + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; + } + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + 0 !== (workInProgress.mode & 16) + ? workInProgress.flags & -805308421 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { for ( - _treeBaseDuration = completedWork.child; - null !== _treeBaseDuration; + workInProgress = workInProgress.memoizedState; + null !== workInProgress; - ) - (newChildLanes |= - _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags), - (subtreeFlags |= _treeBaseDuration.flags), - (_treeBaseDuration.return = completedWork), - (_treeBaseDuration = _treeBaseDuration.sibling); - completedWork.subtreeFlags |= subtreeFlags; - completedWork.childLanes = newChildLanes; - return didBailout; + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; + } + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter = 0; + thenableState = null; } - function completeWork(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - switch (workInProgress.tag) { - case 28: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return bubbleProperties(workInProgress), null; - case 1: - return bubbleProperties(workInProgress), null; - case 3: - return ( - (newProps = workInProgress.stateNode), - (renderLanes = null), - null !== current && (renderLanes = current.memoizedState.cache), - workInProgress.memoizedState.cache !== renderLanes && - (workInProgress.flags |= 2048), - popProvider(CacheContext, workInProgress), - popHostContainer(workInProgress), - newProps.pendingContext && - ((newProps.context = newProps.pendingContext), - (newProps.pendingContext = null)), - (null !== current && null !== current.child) || - null === current || - (current.memoizedState.isDehydrated && - 0 === (workInProgress.flags & 256)) || - ((workInProgress.flags |= 1024), - upgradeHydrationErrorsToRecoverable()), - updateHostContainer(current, workInProgress), - bubbleProperties(workInProgress), - null - ); - case 26: - case 27: - case 5: - popHostContext(workInProgress); - var _type2 = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - if ( - ((renderLanes = current.stateNode), - (_type2 = current.memoizedProps), - (current = doesRequireClone(current, workInProgress)) || - _type2 !== newProps) - ) { - requiredContext(contextStackCursor.current); - b: { - var keepChildren = !current; - _type2 = reactPrivateInterface.diffAttributePayloads( - _type2, - newProps, - renderLanes.canonical.viewConfig.validAttributes - ); - renderLanes.canonical.currentProps = newProps; - newProps = renderLanes.node; - if (keepChildren) - if (null !== _type2) - newProps = cloneNodeWithNewProps(newProps, _type2); - else { - newProps = renderLanes; - break b; - } - else - newProps = - null !== _type2 - ? cloneNodeWithNewChildrenAndProps(newProps, _type2) - : cloneNodeWithNewChildren(newProps); - newProps = { node: newProps, canonical: renderLanes.canonical }; - } - newProps === renderLanes - ? (workInProgress.stateNode = renderLanes) - : ((workInProgress.flags |= 8), - (workInProgress.stateNode = newProps), - current && - appendAllChildren(newProps, workInProgress, !1, !1)); - } else workInProgress.stateNode = renderLanes; - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error( - "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." - ); - bubbleProperties(workInProgress); - workInProgress.subtreeFlags &= -33554433; - return null; - } - requiredContext(contextStackCursor.current); - current = requiredContext(rootInstanceStackCursor.current); - renderLanes = allocateTag(); - _type2 = getViewConfigForType(_type2); - for (keepChildren in _type2.validAttributes) - newProps.hasOwnProperty(keepChildren) && - reactPrivateInterface.deepFreezeAndThrowOnMutationInDev( - newProps[keepChildren] - ); - keepChildren = reactPrivateInterface.createAttributePayload( - newProps, - _type2.validAttributes - ); - current = { - node: createNode( - renderLanes, - _type2.uiViewClassName, - current.containerTag, - keepChildren, - workInProgress - ), - canonical: { - nativeTag: renderLanes, - viewConfig: _type2, - currentProps: newProps, - internalInstanceHandle: workInProgress, - publicInstance: null, - publicRootInstance: current.publicInstance - } - }; - workInProgress.flags |= 8; - appendAllChildren(current, workInProgress, !1, !1); - workInProgress.stateNode = current; - } - bubbleProperties(workInProgress); - workInProgress.subtreeFlags &= -33554433; - workInProgress.flags &= -16777217; - return null; - case 6: - if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps - ? ((current = requiredContext(rootInstanceStackCursor.current)), - (renderLanes = requiredContext(contextStackCursor.current)), - (workInProgress.flags |= 8), - (workInProgress.stateNode = createTextInstance( - newProps, - current, - renderLanes, - workInProgress - ))) - : (workInProgress.stateNode = current.stateNode); - else { - if ( - "string" !== typeof newProps && - null === workInProgress.stateNode - ) - throw Error( - "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." - ); - current = requiredContext(rootInstanceStackCursor.current); - renderLanes = requiredContext(contextStackCursor.current); - workInProgress.flags |= 8; - workInProgress.stateNode = createTextInstance( - newProps, - current, - renderLanes, - workInProgress + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; + } + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); + throw Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; + } + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; + } + function useThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + thenable = trackUsedThenable(thenableState, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; + } + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_RECOVERABLE_TYPE) return; + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); + } + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + 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 + ); + 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); } - bubbleProperties(workInProgress); - return null; - case 31: - newProps = workInProgress.memoizedState; - if (null === current || null !== current.memoizedState) { - if (null !== newProps) { - if (null === current) { - throw Error( - "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." - ); - throw Error( - "Expected prepareToHydrateHostActivityInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." - ); - } - emitPendingHydrationWarnings(); - 0 === (workInProgress.flags & 128) && - (newProps = workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - null !== newProps && - ((current = workInProgress.child), - null !== current && - (workInProgress.treeBaseDuration -= - current.treeBaseDuration)); - current = !1; + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + } + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); + } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + 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, + gesture: null, + 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 - (newProps = upgradeHydrationErrorsToRecoverable()), - null !== current && - null !== current.memoizedState && - (current.memoizedState.hydrationErrors = newProps), - (current = !0); - if (!current) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; - } - if (0 !== (workInProgress.flags & 128)) - throw Error( - "Client rendering an Activity suspended it again. This is a bug in React." - ); + (updateLane = { + lane: 0, + revertLane: update.revertLane, + gesture: null, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + gesture: update.gesture, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; + } + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; + } + function mountSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + objectIs(nextSnapshot, cachedSnapshot) || + (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 & 127) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = cachedSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, cachedSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + { destroy: void 0 }, + updateStoreInstance.bind( + null, + fiber, + cachedSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; + } + function updateSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + objectIs(nextSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + nextSnapshot + )) + ) + (hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + subscribe = + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + (workInProgressHook.memoizedState.tag & HasEffect) !== NoFlags); + pushSimpleEffect( + subscribe ? HasEffect | Passive : Passive, + { destroy: void 0 }, + updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), + null + ); + if (subscribe) { + fiber.flags |= 2048; + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (renderLanes & 127) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + return nextSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + } + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && + (startUpdateTimerByLane(2, "updateSyncExternalStore()", fiber), + 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); } - bubbleProperties(workInProgress); - return null; - case 13: - newProps = workInProgress.memoizedState; - if ( - null === current || - (null !== current.memoizedState && - null !== current.memoizedState.dehydrated) - ) { - keepChildren = newProps; - if (null !== keepChildren && null !== keepChildren.dehydrated) { - if (null === current) { - throw Error( - "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." - ); - throw Error( - "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." - ); - } - emitPendingHydrationWarnings(); - 0 === (workInProgress.flags & 128) && - (keepChildren = workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - null !== keepChildren && - ((keepChildren = workInProgress.child), - null !== keepChildren && - (workInProgress.treeBaseDuration -= - keepChildren.treeBaseDuration)); - keepChildren = !1; - } else - (keepChildren = upgradeHydrationErrorsToRecoverable()), - null !== current && - null !== current.memoizedState && - (current.memoizedState.hydrationErrors = keepChildren), - (keepChildren = !0); - if (!keepChildren) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; + } + } + 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, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update action 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 = {}; + currentTransition.types = + null !== prevTransition ? prevTransition.types : null; + currentTransition._updatedFibers = new Set(); + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + null !== prevTransition && + null !== currentTransition.types && + (null !== prevTransition.types && + prevTransition.types !== currentTransition.types && + console.error( + "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." + ), + (prevTransition.types = currentTransition.types)), + (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 handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (ReactSharedInternals.asyncTransitions++, + returnValue.then(releaseAsyncTransition, releaseAsyncTransition), + returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); } + ), + node.isTransition || + console.error( + "An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop." + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); + } + actionQueue.action = null; + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + } + function actionStateReducer(oldState, newState) { + return newState; + } + function mountActionState(action, initialStateProp) { + var stateHook = mountWorkInProgressHook(); + stateHook.memoizedState = stateHook.baseState = initialStateProp; + var stateQueue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + stateHook.queue = stateQueue; + stateHook = dispatchSetState.bind( + null, + currentlyRenderingFiber, + stateQueue + ); + stateQueue.dispatch = stateHook; + stateQueue = mountStateImpl(!1); + var setPendingState = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + stateQueue.queue + ); + stateQueue = mountWorkInProgressHook(); + var actionQueue = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + stateQueue.queue = actionQueue; + stateHook = dispatchActionState.bind( + null, + currentlyRenderingFiber, + actionQueue, + setPendingState, + stateHook + ); + actionQueue.dispatch = stateHook; + stateQueue.memoizedState = action; + return [initialStateProp, stateHook, !1]; + } + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); + } + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + { destroy: void 0 }, + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; + } + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; + } + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; + } + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.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 mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + { destroy: void 0 }, + create, + 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 = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + 0 !== (currentlyRenderingFiber.mode & 16) + ? mountEffectImpl(545261568, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.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 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; + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 268435456); + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; + } + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || + 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; } - popSuspenseHandler(workInProgress); - if (0 !== (workInProgress.flags & 128)) - return ( - (workInProgress.lanes = renderLanes), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress - ); - newProps = null !== newProps; - current = null !== current && null !== current.memoizedState; - newProps && - ((renderLanes = workInProgress.child), - (keepChildren = null), - null !== renderLanes.alternate && - null !== renderLanes.alternate.memoizedState && - null !== renderLanes.alternate.memoizedState.cachePool && - (keepChildren = - renderLanes.alternate.memoizedState.cachePool.pool), - (_type2 = null), - null !== renderLanes.memoizedState && - null !== renderLanes.memoizedState.cachePool && - (_type2 = renderLanes.memoizedState.cachePool.pool), - _type2 !== keepChildren && (renderLanes.flags |= 2048)); - newProps !== current && - newProps && - (workInProgress.child.flags |= 8192); - scheduleRetryEffect(workInProgress, workInProgress.updateQueue); - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - newProps && - ((current = workInProgress.child), - null !== current && - (workInProgress.treeBaseDuration -= current.treeBaseDuration)); - return null; - case 4: + ); + } + 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; + 0 !== (currentlyRenderingFiber.mode & 16) && (fiberFlags |= 268435456); + 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); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(), + prevState = currentHook.memoizedState; + return updateDeferredValueImpl( + hook, + prevState.value, + prevState.isInitial, + value, + initialValue + ); + } + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + if (null === currentHook) + return mountDeferredValueImpl(hook, value, initialValue); + var prevState = currentHook.memoizedState; + return updateDeferredValueImpl( + hook, + prevState.value, + prevState.isInitial, + value, + initialValue + ); + } + function mountDeferredValueImpl(hook, value, initialValue) { + if ( + void 0 === initialValue || + objectIs(value, initialValue) || + (0 !== (renderLanes & 1073741824) && + 0 === (workInProgressRootRenderLanes & 261930)) + ) + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + hook.memoizedState = { value: initialValue, isInitial: !0 }; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl( + hook, + prevValue, + prevIsInitial, + value, + initialValue + ) { + if (prevIsInitial) { + if (objectIs(value, prevValue)) + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + if (void 0 !== initialValue) return ( - popHostContainer(workInProgress), - updateHostContainer(current, workInProgress), - (workInProgress.flags |= 67108864), - bubbleProperties(workInProgress), - null + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + } + 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 & 106) || + (0 !== (renderLanes & 1073741824) && + 0 === (workInProgressRootRenderLanes & 261930)) + ) + return ( + (didReceiveUpdate = !0), + (hook.memoizedState = { value: value, isInitial: !1 }), + value + ); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; + } + function releaseAsyncTransition() { + ReactSharedInternals.asyncTransitions--; + } + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback + ) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + currentTransition.types = + null !== prevTransition ? prevTransition.types : null; + currentTransition._updatedFibers = new Set(); + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + ReactSharedInternals.asyncTransitions++; + returnValue.then(releaseAsyncTransition, releaseAsyncTransition); + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - case 10: - return ( - popProvider(workInProgress.type, workInProgress), - bubbleProperties(workInProgress), - null + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) ); - case 17: - return bubbleProperties(workInProgress), null; - case 19: - popSuspenseListContext(workInProgress); - newProps = workInProgress.memoizedState; - if (null === newProps) return bubbleProperties(workInProgress), null; - keepChildren = 0 !== (workInProgress.flags & 128); - _type2 = newProps.rendering; - if (null === _type2) - if (keepChildren) cutOffTailIfNeeded(newProps, !1); - else { - if ( - workInProgressRootExitStatus !== RootInProgress || - (null !== current && 0 !== (current.flags & 128)) - ) - for (current = workInProgress.child; null !== current; ) { - _type2 = findFirstSuspended(current); - if (null !== _type2) { - workInProgress.flags |= 128; - cutOffTailIfNeeded(newProps, !1); - current = _type2.updateQueue; - workInProgress.updateQueue = current; - scheduleRetryEffect(workInProgress, current); - workInProgress.subtreeFlags = 0; - current = renderLanes; - for (newProps = workInProgress.child; null !== newProps; ) - resetWorkInProgress(newProps, current), - (newProps = newProps.sibling); - pushSuspenseListContext( - workInProgress, - (suspenseStackCursor.current & - SubtreeSuspenseContextMask) | - ForceSuspenseFallback - ); - return workInProgress.child; - } - current = current.sibling; - } - null !== newProps.tail && - now$1() > workInProgressRootRenderTargetTime && - ((workInProgress.flags |= 128), - (keepChildren = !0), - cutOffTailIfNeeded(newProps, !1), - (workInProgress.lanes = 4194304)); - } - else { - if (!keepChildren) - if (((current = findFirstSuspended(_type2)), null !== current)) { - if ( - ((workInProgress.flags |= 128), - (keepChildren = !0), - (current = current.updateQueue), - (workInProgress.updateQueue = current), - scheduleRetryEffect(workInProgress, current), - cutOffTailIfNeeded(newProps, !0), - null === newProps.tail && - "collapsed" !== newProps.tailMode && - "visible" !== newProps.tailMode && - !_type2.alternate) - ) - return bubbleProperties(workInProgress), null; - } else - 2 * now$1() - newProps.renderingStartTime > - workInProgressRootRenderTargetTime && - 536870912 !== renderLanes && - ((workInProgress.flags |= 128), - (keepChildren = !0), - cutOffTailIfNeeded(newProps, !1), - (workInProgress.lanes = 4194304)); - newProps.isBackwards - ? ((_type2.sibling = workInProgress.child), - (workInProgress.child = _type2)) - : ((current = newProps.last), - null !== current - ? (current.sibling = _type2) - : (workInProgress.child = _type2), - (newProps.last = _type2)); - } - if (null !== newProps.tail) { - current = newProps.tail; - a: { - for (renderLanes = current; null !== renderLanes; ) { - if (null !== renderLanes.alternate) { - renderLanes = !1; - break a; - } - renderLanes = renderLanes.sibling; - } - renderLanes = !0; - } - newProps.rendering = current; - newProps.tail = current.sibling; - newProps.renderingStartTime = now$1(); - current.sibling = null; - _type2 = suspenseStackCursor.current; - _type2 = keepChildren - ? (_type2 & SubtreeSuspenseContextMask) | ForceSuspenseFallback - : _type2 & SubtreeSuspenseContextMask; - "visible" !== newProps.tailMode && - "collapsed" !== newProps.tailMode && - renderLanes - ? ((newProps = _type2), - push( - suspenseHandlerStackCursor, - workInProgress, - workInProgress - ), - push(suspenseStackCursor, newProps, workInProgress), - null === shellBoundary && (shellBoundary = workInProgress)) - : pushSuspenseListContext(workInProgress, _type2); - return current; + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (currentUpdatePriority = previousPriority), + null !== prevTransition && + null !== currentTransition.types && + (null !== prevTransition.types && + prevTransition.types !== currentTransition.types && + console.error( + "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." + ), + (prevTransition.types = currentTransition.types)), + (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 mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + } + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = + "_" + identifierPrefix + "r_" + globalClientId.toString(32) + "_"; + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider), + refreshUpdate = createUpdate(lane), + root = enqueueUpdate(provider, refreshUpdate, lane); + null !== root && + (startUpdateTimerByLane(lane, "refresh()", fiber), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + fiber = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + console.error( + "The seed argument is not enabled outside experimental channels." + ); + refreshUpdate.payload = { cache: fiber }; + return; + } + provider = provider.return; + } + } + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + 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()." + ); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + gesture: null, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (startUpdateTimerByLane(args, "dispatch()", fiber), + scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + 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()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args) && + startUpdateTimerByLane(args, "setState()", fiber); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + gesture: null, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { + } finally { + ReactSharedInternals.H = prevDispatcher; } - bubbleProperties(workInProgress); - return null; - case 22: - case 23: + } + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - popSuspenseHandler(workInProgress), - popHiddenContext(workInProgress), - (newProps = null !== workInProgress.memoizedState), - null !== current - ? (null !== current.memoizedState) !== newProps && - (workInProgress.flags |= 8192) - : newProps && (workInProgress.flags |= 8192), - newProps && 0 !== (workInProgress.mode & 1) - ? 0 !== (renderLanes & 536870912) && - 0 === (workInProgress.flags & 128) && - (bubbleProperties(workInProgress), - workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), - (newProps = workInProgress.updateQueue), - null !== newProps && - scheduleRetryEffect(workInProgress, newProps.retryQueue), - (newProps = null), - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (newProps = current.memoizedState.cachePool.pool), - (renderLanes = null), - null !== workInProgress.memoizedState && - null !== workInProgress.memoizedState.cachePool && - (renderLanes = workInProgress.memoizedState.cachePool.pool), - renderLanes !== newProps && (workInProgress.flags |= 2048), - null !== current && pop(resumedCache, workInProgress), - null + 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(), + gesture: null, + 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, "setOptimistic()", fiber), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); + } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194048)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } + } + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); + } + } + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } + } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); + } + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); + } + } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" ); - case 24: - return ( - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && - (workInProgress.flags |= 2048), - popProvider(CacheContext, workInProgress), - bubbleProperties(workInProgress), - null + return oldProps; + } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; + } + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); + } + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; + } + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e) { + setTimeout(function () { + throw e; + }); + } + } + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e) { + setTimeout(function () { + throw e; + }); + } + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - case 25: - return null; - case 30: - return ( - (workInProgress.flags |= 33554432), - bubbleProperties(workInProgress), - null + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - case 29: - return null; + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + console.error( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); + } + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes + ) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + returnFiber = suspenseHandlerStackCursor.current; + if (null !== returnFiber) { + switch (returnFiber.tag) { + case 31: + case 13: + case 19: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === returnFiber.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended), + (returnFiber.flags &= -257), + (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? (returnFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (returnFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (returnFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + returnFiber.tag + + "). This is a bug in React." + ); + } + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." + var error = createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [error]) + : workInProgressRootConcurrentErrors.push(error); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + value, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + sourceFiber = returnFiber.type; + error = returnFiber.stateNode; + if ( + 0 === (returnFiber.flags & 128) && + ("function" === typeof sourceFiber.getDerivedStateFromError || + (null !== error && + "function" === typeof error.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(error)))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + value + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + break; + case 22: + if (null !== returnFiber.memoizedState) + return (returnFiber.flags |= 65536), !1; + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; + } + function reconcileChildren( + current, + workInProgress, + nextChildren, + renderLanes + ) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); + } + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var resolvedRender = resolveTypeForHotReloading(Component); + resolvedRender !== Component && + ((Component = resolvedRender), + null !== current && (didReceiveUpdate = !0)); + resolvedRender = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + resolvedRender, + renderLanes ); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function unwindWork(current, workInProgress) { - switch (workInProgress.tag) { - case 1: + function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null + (Component = resolveTypeForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) ); - case 3: - return ( - popProvider(CacheContext, workInProgress), - popHostContainer(workInProgress), - (current = workInProgress.flags), - 0 !== (current & 65536) && 0 === (current & 128) - ? ((workInProgress.flags = (current & -65537) | 128), - workInProgress) - : null + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes ); - case 26: - case 27: - case 5: - return popHostContext(workInProgress), null; - case 31: - if ( - null !== workInProgress.memoizedState && - (popSuspenseHandler(workInProgress), - null === workInProgress.alternate) - ) - throw Error( - "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." - ); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null; - case 13: - popSuspenseHandler(workInProgress); - current = workInProgress.memoizedState; + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) if ( - null !== current && - null !== current.dehydrated && - null === workInProgress.alternate + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) ) - throw Error( - "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null; - case 19: - return ( - popSuspenseListContext(workInProgress), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - (current = workInProgress.memoizedState), - null !== current && - ((current.rendering = null), (current.tail = null)), - (workInProgress.flags |= 4), - workInProgress) - : null + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent( + current, + workInProgress, + renderLanes, + nextProps + ) { + var nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + null === current && + null === workInProgress.stateNode && + (workInProgress.stateNode = { + _visibility: OffscreenVisible, + _pendingMarkers: null, + _retryCache: null, + _transitions: null + }); + if ("hidden" === nextProps.mode) { + if (0 !== (workInProgress.flags & 128)) { + prevState = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextProps = workInProgress.child = current.child; + for (nextChildren = 0; null !== nextProps; ) + (nextChildren = + nextChildren | nextProps.lanes | nextProps.childLanes), + (nextProps = nextProps.sibling); + nextProps = nextChildren & ~prevState; + } else (nextProps = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + prevState, + renderLanes, + nextProps ); - case 4: - return popHostContainer(workInProgress), null; - case 10: - return popProvider(workInProgress.type, workInProgress), null; - case 22: - case 23: + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - popSuspenseHandler(workInProgress), - popHiddenContext(workInProgress), - null !== current && pop(resumedCache, workInProgress), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null + (nextProps = workInProgress.lanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes, + nextProps + ) ); - case 24: - return popProvider(CacheContext, workInProgress), null; - case 25: - return null; - default: - return null; - } + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; } - function unwindInterruptedWork(current, interruptedWork) { - switch (interruptedWork.tag) { - case 3: - popProvider(CacheContext, interruptedWork); - popHostContainer(interruptedWork); - break; - case 26: - case 27: - case 5: - popHostContext(interruptedWork); - break; - case 4: - popHostContainer(interruptedWork); - break; - case 31: - null !== interruptedWork.memoizedState && - popSuspenseHandler(interruptedWork); - break; - case 13: - popSuspenseHandler(interruptedWork); - break; - case 19: - popSuspenseListContext(interruptedWork); - break; - case 10: - popProvider(interruptedWork.type, interruptedWork); - break; - case 22: - case 23: - popSuspenseHandler(interruptedWork); - popHiddenContext(interruptedWork); - null !== current && pop(resumedCache, interruptedWork); - break; - case 24: - popProvider(CacheContext, interruptedWork); - } + function bailoutOffscreenComponent(current, workInProgress) { + (null !== current && 22 === current.tag) || + null !== workInProgress.stateNode || + (workInProgress.stateNode = { + _visibility: OffscreenVisible, + _pendingMarkers: null, + _retryCache: null, + _transitions: null + }); + return workInProgress.sibling; } - function shouldProfile(current) { - return 0 !== (current.mode & 2); + function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes, + remainingChildLanes + ) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue2, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + workInProgress.childLanes = remainingChildLanes; + return null; } - function commitHookLayoutEffects(finishedWork, hookFlags) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork), - recordEffectDuration()) - : commitHookEffectListMount(hookFlags, finishedWork); + function mountActivityChildren(workInProgress, nextProps) { + var hiddenProp = nextProps.hidden; + void 0 !== hiddenProp && + console.error( + ' doesn\'t accept a hidden prop. Use mode="hidden" instead.\n- \n+ ', + !0 === hiddenProp + ? "hidden" + : !1 === hiddenProp + ? "hidden={false}" + : "hidden={...}", + hiddenProp ? 'mode="hidden"' : 'mode="visible"' + ); + nextProps = mountWorkInProgressOffscreenFiber( + { mode: nextProps.mode, children: nextProps.children }, + workInProgress.mode + ); + nextProps.ref = workInProgress.ref; + workInProgress.child = nextProps; + nextProps.return = workInProgress; + return nextProps; } - function commitHookLayoutUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags + function retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes ) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordEffectDuration()) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountActivityChildren( + workInProgress, + workInProgress.pendingProps + ); + current.flags |= 2; + popSuspenseHandler(workInProgress); + workInProgress.memoizedState = null; + return current; } - function commitHookEffectListMount(flags, finishedWork) { - try { - var updateQueue = finishedWork.updateQueue, - lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== lastEffect) { - var firstEffect = lastEffect.next; - updateQueue = firstEffect; - do { - if ( - (updateQueue.tag & flags) === flags && - ((lastEffect = void 0), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - (lastEffect = runWithFiberInDEV( - finishedWork, - callCreateInDEV, - updateQueue - )), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - void 0 !== lastEffect && "function" !== typeof lastEffect) - ) { - var hookName = void 0; - hookName = - 0 !== (updateQueue.tag & Layout) - ? "useLayoutEffect" - : 0 !== (updateQueue.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - var addendum = void 0; - addendum = - null === lastEffect - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof lastEffect.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + lastEffect; - runWithFiberInDEV( - finishedWork, - function (n, a) { - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - n, - a - ); - }, - hookName, - addendum - ); - } - updateQueue = updateQueue.next; - } while (updateQueue !== firstEffect); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 4194816); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 4194816; } } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor + function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes ) { - try { - var updateQueue = finishedWork.updateQueue, - lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== lastEffect) { - var firstEffect = lastEffect.next; - updateQueue = firstEffect; - do { - if ((updateQueue.tag & flags) === flags) { - var inst = updateQueue.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - (lastEffect = finishedWork), - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, - nearestMountedAncestor, - destroy - ), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1)); - } - updateQueue = updateQueue.next; - } while (updateQueue !== firstEffect); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (console.error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ), + (didWarnAboutBadClass[componentName] = !0)); } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork), - recordEffectDuration()) - : commitHookEffectListMount(hookFlags, finishedWork); - } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes ) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordEffectDuration()) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } - function commitClassDidMount(finishedWork) { - var instance = finishedWork.stateNode; - "function" === typeof instance.componentDidMount && - runWithFiberInDEV( - finishedWork, - callComponentDidMountInDEV, - finishedWork, - instance + prepareToReadContext(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && + function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) + ); + enqueueCapturedUpdate(workInProgress, lane); + } + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + state = emptyContextObject; + _instance = Component.contextType; + "contextType" in Component && + null !== _instance && + (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(Component) && + (didWarnAboutInvalidateContextType.add(Component), + (lane = + void 0 === _instance + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof _instance + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), + console.error( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(Component) || "Component", + lane + )); + "object" === typeof _instance && + null !== _instance && + (state = readContext(_instance)); + _instance = new Component(nextProps, state); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + _instance = new Component(nextProps, state); + } finally { + setIsStrictModeForDevtools(!1); + } + } + state = workInProgress.memoizedState = + null !== _instance.state && void 0 !== _instance.state + ? _instance.state + : null; + _instance.updater = classComponentUpdater; + workInProgress.stateNode = _instance; + _instance._reactInternals = workInProgress; + _instance._reactInternalInstance = fakeInternalInstance; + "function" === typeof Component.getDerivedStateFromProps && + null === state && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutUninitializedState.has(state) || + (didWarnAboutUninitializedState.add(state), console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - runWithFiberInDEV( - finishedWork, - commitCallbacks, - updateQueue, - instance + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + state, + null === _instance.state ? "null" : "undefined", + state + ))); + if ( + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate + ) { + var foundWillUpdateName = (lane = state = null); + "function" === typeof _instance.componentWillMount && + !0 !== _instance.componentWillMount.__suppressDeprecationWarning + ? (state = "componentWillMount") + : "function" === typeof _instance.UNSAFE_componentWillMount && + (state = "UNSAFE_componentWillMount"); + "function" === typeof _instance.componentWillReceiveProps && + !0 !== + _instance.componentWillReceiveProps.__suppressDeprecationWarning + ? (lane = "componentWillReceiveProps") + : "function" === + typeof _instance.UNSAFE_componentWillReceiveProps && + (lane = "UNSAFE_componentWillReceiveProps"); + "function" === typeof _instance.componentWillUpdate && + !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof _instance.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if (null !== state || null !== lane || null !== foundWillUpdateName) { + _instance = getComponentNameFromType(Component) || "Component"; + var newApiName = + "function" === typeof Component.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), + console.error( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _instance, + newApiName, + null !== state ? "\n " + state : "", + null !== lane ? "\n " + lane : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + _instance = workInProgress.stateNode; + state = getComponentNameFromType(Component) || "Component"; + _instance.render || + (Component.prototype && + "function" === typeof Component.prototype.render + ? console.error( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + state + ) + : console.error( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + state + )); + !_instance.getInitialState || + _instance.getInitialState.isReactClassApproved || + _instance.state || + console.error( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + state + ); + _instance.getDefaultProps && + !_instance.getDefaultProps.isReactClassApproved && + console.error( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + state + ); + _instance.contextType && + console.error( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + state + ); + Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), + console.error( + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + state + )); + Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + state + )); + "function" === typeof _instance.componentShouldUpdate && + console.error( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + state + ); + Component.prototype && + Component.prototype.isPureReactComponent && + "undefined" !== typeof _instance.shouldComponentUpdate && + console.error( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(Component) || "A pure component" + ); + "function" === typeof _instance.componentDidUnmount && + console.error( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + state + ); + "function" === typeof _instance.componentDidReceiveProps && + console.error( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + state ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { - return instance.getSnapshotBeforeUpdate(prevProps, prevState); - } - function commitClassSnapshot(finishedWork, current) { - var prevProps = current.memoizedProps, - prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && + "function" === typeof _instance.componentWillRecieveProps && console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + state + ); + "function" === typeof _instance.UNSAFE_componentWillRecieveProps && console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + state + ); + lane = _instance.props !== nextProps; + void 0 !== _instance.props && + lane && + console.error( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + state + ); + _instance.defaultProps && + console.error( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + state, + state + ); + "function" !== typeof _instance.getSnapshotBeforeUpdate || + "function" === typeof _instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), + console.error( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(Component) )); - try { - var resolvedPrevProps = resolveClassComponentProps( - finishedWork.type, - prevProps - ); - var snapshot = runWithFiberInDEV( - finishedWork, - callGetSnapshotBeforeUpdates, - current, - resolvedPrevProps, - prevState - ); - prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== snapshot || - prevProps.has(finishedWork.type) || - (prevProps.add(finishedWork.type), - runWithFiberInDEV(finishedWork, function () { + "function" === typeof _instance.getDerivedStateFromProps && + console.error( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state + ); + "function" === typeof _instance.getDerivedStateFromError && + console.error( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state + ); + "function" === typeof Component.getSnapshotBeforeUpdate && + console.error( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + state + ); + (lane = _instance.state) && + ("object" !== typeof lane || isArrayImpl(lane)) && + console.error("%s.state: must be set to an object or null", state); + "function" === typeof _instance.getChildContext && + "object" !== typeof Component.childContextTypes && + console.error( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + state + ); + _instance = workInProgress.stateNode; + _instance.props = nextProps; + _instance.state = workInProgress.memoizedState; + _instance.refs = {}; + initializeUpdateQueue(workInProgress); + state = Component.contextType; + _instance.context = + "object" === typeof state && null !== state + ? readContext(state) + : emptyContextObject; + _instance.state === nextProps && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(state) || + (didWarnAboutDirectlyAssigningPropsToState.add(state), console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - ); - })); - current.__reactInternalSnapshotBeforeUpdate = snapshot; - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startEffectTimer(), - runWithFiberInDEV( - current, - callComponentWillUnmountInDEV, - current, - nearestMountedAncestor, - instance - ), - recordEffectDuration()) - : runWithFiberInDEV( - current, - callComponentWillUnmountInDEV, - current, - nearestMountedAncestor, - instance + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + state + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + _instance ); - } - function commitAttachRef(finishedWork) { - var ref = finishedWork.ref; - if (null !== ref) { - switch (finishedWork.tag) { - case 26: - case 27: - case 5: - var instanceToUse = getPublicInstance(finishedWork.stateNode); - break; - case 30: - instanceToUse = finishedWork.stateNode; - var name = getViewTransitionName( - finishedWork.memoizedProps, - instanceToUse - ); - if (null === instanceToUse.ref || instanceToUse.ref.name !== name) - instanceToUse.ref = createViewTransitionInstance(name); - instanceToUse = instanceToUse.ref; - break; - case 7: - null === finishedWork.stateNode && - ((instanceToUse = new FragmentInstance(finishedWork)), - traverseVisibleInstancesAndTextInstances( - finishedWork.child, - !1, - addFragmentHandleToFiber, - instanceToUse, - void 0, - void 0 + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + _instance + ); + _instance.state = workInProgress.memoizedState; + state = Component.getDerivedStateFromProps; + "function" === typeof state && + (applyDerivedStateFromProps( + workInProgress, + Component, + state, + nextProps + ), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ((state = _instance.state), + "function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount(), + state !== _instance.state && + (console.error( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + _instance, + _instance.state, + null + )), + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308); + 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 268435456); + _instance = !0; + } else if (null === current) { + _instance = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + _instance.props = lane; + var oldContext = _instance.context; + foundWillUpdateName = Component.contextType; + state = emptyContextObject; + "object" === typeof foundWillUpdateName && + null !== foundWillUpdateName && + (state = readContext(foundWillUpdateName)); + newApiName = Component.getDerivedStateFromProps; + foundWillUpdateName = + "function" === typeof newApiName || + "function" === typeof _instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== state) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + state + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof newApiName && + (applyDerivedStateFromProps( + workInProgress, + Component, + newApiName, + nextProps ), - (finishedWork.stateNode = instanceToUse)); - instanceToUse = finishedWork.stateNode; - break; - default: - instanceToUse = finishedWork.stateNode; - } - if ("function" === typeof ref) - if (shouldProfile(finishedWork)) - try { - startEffectTimer(), - (finishedWork.refCleanup = ref(instanceToUse)); - } finally { - recordEffectDuration(); - } - else finishedWork.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(finishedWork) + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + state + )) + ? (foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ("function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount()), + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 268435456)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 268435456), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (_instance.props = nextProps), + (_instance.state = oldContext), + (_instance.context = state), + (_instance = lane)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 268435456), + (_instance = !1)); + } else { + _instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + state = workInProgress.memoizedProps; + foundWillUpdateName = resolveClassComponentProps(Component, state); + _instance.props = foundWillUpdateName; + newApiName = workInProgress.pendingProps; + oldState = _instance.context; + oldContext = Component.contextType; + lane = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (lane = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof _instance.getSnapshotBeforeUpdate) || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((state !== newApiName || oldState !== lane) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + lane + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + state !== newApiName || + oldState !== newState || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + unresolvedOldProps, + nextProps ), - (ref.current = instanceToUse); - } - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - runWithFiberInDEV(current, commitAttachRef, current); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + (newState = workInProgress.memoizedState)), + (foundWillUpdateName = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + foundWillUpdateName, + nextProps, + oldState, + newState, + lane + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (oldContext || + ("function" !== typeof _instance.UNSAFE_componentWillUpdate && + "function" !== typeof _instance.componentWillUpdate) || + ("function" === typeof _instance.componentWillUpdate && + _instance.componentWillUpdate(nextProps, newState, lane), + "function" === typeof _instance.UNSAFE_componentWillUpdate && + _instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + lane + )), + "function" === typeof _instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof _instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (_instance.props = nextProps), + (_instance.state = newState), + (_instance.context = lane), + (_instance = foundWillUpdateName)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (_instance = !1)); } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) + lane = _instance; + markRef(current, workInProgress); + state = 0 !== (workInProgress.flags & 128); + if (lane || state) { + lane = workInProgress.stateNode; + setCurrentFiber(workInProgress); + if (state && "function" !== typeof Component.getDerivedStateFromError) + (Component = null), (profilerStartTime = -1); + else if ( + ((Component = callRenderInDEV(lane)), + workInProgress.mode & StrictLegacyMode) + ) { + setIsStrictModeForDevtools(!0); try { - if (shouldProfile(current)) - try { - startEffectTimer(), runWithFiberInDEV(current, refCleanup); - } finally { - recordEffectDuration(current); - } - else runWithFiberInDEV(current, refCleanup); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + callRenderInDEV(lane); } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startEffectTimer(), runWithFiberInDEV(current, ref, null); - } finally { - recordEffectDuration(current); - } - else runWithFiberInDEV(current, ref, null); - } catch (error$4) { - captureCommitPhaseError(current, nearestMountedAncestor, error$4); - } - else ref.current = null; - } - function commitProfiler( - finishedWork, - current, - commitStartTime, - effectDuration - ) { - var _finishedWork$memoize = finishedWork.memoizedProps, - id = _finishedWork$memoize.id, - onCommit = _finishedWork$memoize.onCommit; - _finishedWork$memoize = _finishedWork$memoize.onRender; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize( - id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - commitStartTime - ); - "function" === typeof onCommit && - onCommit(id, current, effectDuration, commitStartTime); - } - function commitProfilerPostCommitImpl( - finishedWork, - current, - commitStartTime, - passiveEffectDuration - ) { - var _finishedWork$memoize2 = finishedWork.memoizedProps; - finishedWork = _finishedWork$memoize2.id; - _finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof _finishedWork$memoize2 && - _finishedWork$memoize2( - finishedWork, - current, - passiveEffectDuration, - commitStartTime - ); - } - function pushMutationContext() { - var prev = viewTransitionMutationContext; - viewTransitionMutationContext = !1; - return prev; - } - function commitFragmentInstanceInsertionEffects(fiber) { - for (var parent = fiber.return; null !== parent; ) { - isFragmentInstanceParent(parent) && - commitNewChildToFragmentInstance(fiber.stateNode, parent.stateNode); - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; - } - } - function commitFragmentInstanceDeletionEffects(fiber) { - for (var parent = fiber.return; null !== parent; ) { - if (isFragmentInstanceParent(parent)) { - var childInstance = fiber.stateNode, - fragmentInstance = parent.stateNode; - null != childInstance.canonical && - ((childInstance = getPublicInstance(childInstance)), - null != childInstance.reactFragments && - childInstance.reactFragments.delete(fragmentInstance)); - } - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; - } - } - function isFragmentInstanceHostBoundary(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || !1; - } - function isFragmentInstanceParent(fiber) { - return fiber && 7 === fiber.tag && null !== fiber.stateNode; - } - function commitHostMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - runWithFiberInDEV( - finishedWork, - commitMount, - instance, - type, - props, - finishedWork - ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitPlacement(finishedWork) { - for ( - var parentFragmentInstances = null, parent = finishedWork.return; - null !== parent; - - ) { - if (isFragmentInstanceParent(parent)) { - var fragmentInstance = parent.stateNode; - null === parentFragmentInstances - ? (parentFragmentInstances = [fragmentInstance]) - : parentFragmentInstances.push(fragmentInstance); - } - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; - } - commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances - ); - } - function commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances - ) { - if (5 === finishedWork.tag) { - if ( - (5 === finishedWork.tag || - 27 === finishedWork.tag || - 6 === finishedWork.tag) && - null === finishedWork.alternate && - null !== parentFragmentInstances - ) - for (var i = 0; i < parentFragmentInstances.length; i++) - commitNewChildToFragmentInstance( - finishedWork.stateNode, - parentFragmentInstances[i] - ); - } else if ( - 4 !== finishedWork.tag && - ((finishedWork = finishedWork.child), null !== finishedWork) - ) - for ( - commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances - ), - finishedWork = finishedWork.sibling; - null !== finishedWork; - - ) - commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances + setIsStrictModeForDevtools(!1); + } + } + workInProgress.flags |= 1; + null !== current && state + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes); + workInProgress.memoizedState = lane.state; + current = workInProgress.child; + } else + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + renderLanes = workInProgress.stateNode; + _instance && + renderLanes.props !== nextProps && + (didWarnAboutReassigningProps || + console.error( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" ), - (finishedWork = finishedWork.sibling); + (didWarnAboutReassigningProps = !0)); + return current; } - function commitHostPortalContainerChildren( - portal, - finishedWork, - pendingChildren - ) { - portal = portal.containerInfo; - try { - runWithFiberInDEV( - finishedWork, - replaceContainerChildren, - portal, - pendingChildren + function mountLazyComponent(workInProgress, elementType, renderLanes) { + var props = workInProgress.pendingProps; + elementType = resolveLazy(elementType); + elementType = resolveTypeForHotReloading(elementType); + workInProgress.type = elementType; + if ("function" === typeof elementType) { + if (shouldConstruct(elementType)) + return ( + (props = resolveClassComponentProps(elementType, props)), + (workInProgress.tag = 1), + updateClassComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ) + ); + workInProgress.tag = 0; + validateFunctionComponentInDev(workInProgress, elementType); + return updateFunctionComponent( + null, + workInProgress, + elementType, + props, + renderLanes ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); } + if (void 0 !== elementType && null !== elementType) { + var $$typeof = elementType.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) + return ( + (workInProgress.tag = 11), + updateForwardRef( + null, + workInProgress, + elementType, + props, + renderLanes + ) + ); + if ($$typeof === REACT_MEMO_TYPE) + return ( + (workInProgress.tag = 14), + updateMemoComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ) + ); + if ($$typeof === REACT_CONTEXT_TYPE) + return ( + (workInProgress.tag = 10), + (workInProgress.type = elementType), + updateContextProvider(null, workInProgress, renderLanes) + ); + } + workInProgress = ""; + null !== elementType && + "object" === typeof elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(elementType) || elementType; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + renderLanes + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); } - function trackEnterViewTransitions(placement) { - if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432)) - shouldStartViewTransition = !0; - } - function pushViewTransitionCancelableScope() { - var prevChildren = viewTransitionCancelableChildren; - viewTransitionCancelableChildren = null; - return prevChildren; - } - function applyViewTransitionToHostInstances() { - viewTransitionHostInstanceIdx = 0; - return !1; - } - function commitAppearingPairViewTransitions(placement) { - if (0 !== (placement.subtreeFlags & 18874368)) - for (placement = placement.child; null !== placement; ) { - if (22 !== placement.tag || null === placement.memoizedState) - if ( - (commitAppearingPairViewTransitions(placement), - 30 === placement.tag && - 0 !== (placement.flags & 18874368) && - placement.stateNode.paired) - ) { - var props = placement.memoizedProps; - if (null == props.name || "auto" === props.name) - throw Error( - "Found a pair with an auto name. This is a bug in React." - ); - "none" !== - getViewTransitionClassName(props.default, props.share) && - applyViewTransitionToHostInstances(placement); - } - placement = placement.sibling; - } - } - function commitEnterViewTransitions(placement, gesture) { - if (30 === placement.tag) { - var state = placement.stateNode, - props = placement.memoizedProps; - getViewTransitionName(props, state); - "none" !== - getViewTransitionClassName( - props.default, - state.paired ? props.share : props.enter - ) - ? applyViewTransitionToHostInstances(placement) && - (commitAppearingPairViewTransitions(placement), - state.paired || - gesture || - scheduleViewTransitionEvent(placement, props.onEnter)) - : commitAppearingPairViewTransitions(placement); - } else if (0 !== (placement.subtreeFlags & 33554432)) - for (placement = placement.child; null !== placement; ) - commitEnterViewTransitions(placement, gesture), - (placement = placement.sibling); - else commitAppearingPairViewTransitions(placement); + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + console.error( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (console.error( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (console.error( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); } - function commitDeletedPairViewTransitions(deletion) { - if ( - null !== appearingViewTransitions && - 0 !== appearingViewTransitions.size - ) { - var pairs = appearingViewTransitions; - if (0 !== (deletion.subtreeFlags & 18874368)) - for (deletion = deletion.child; null !== deletion; ) { - if (22 !== deletion.tag || null === deletion.memoizedState) { - if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) { - var props = deletion.memoizedProps, - name = props.name; - if (null != name && "auto" !== name) { - var pair = pairs.get(name); - if (void 0 !== pair) { - if ( - "none" !== - getViewTransitionClassName( - props.default, - props.share - ) && - applyViewTransitionToHostInstances(deletion) - ) { - var oldInstance = deletion.stateNode; - pair.paired = oldInstance; - oldInstance.paired = pair; - scheduleViewTransitionEvent(deletion, props.onShare); - } - pairs.delete(name); - if (0 === pairs.size) break; - } - } - } - commitDeletedPairViewTransitions(deletion); - } - deletion = deletion.sibling; - } - } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } - function commitExitViewTransitions(deletion) { - if (30 === deletion.tag) { - var props = deletion.memoizedProps, - name = getViewTransitionName(props, deletion.stateNode), - pair = - null !== appearingViewTransitions - ? appearingViewTransitions.get(name) - : void 0; - if ( - "none" !== - getViewTransitionClassName( - props.default, - void 0 !== pair ? props.share : props.exit - ) && - applyViewTransitionToHostInstances(deletion) - ) - if (void 0 !== pair) { - var oldInstance = deletion.stateNode; - pair.paired = oldInstance; - oldInstance.paired = pair; - appearingViewTransitions.delete(name); - scheduleViewTransitionEvent(deletion, props.onShare); - } else scheduleViewTransitionEvent(deletion, props.onExit); - null !== appearingViewTransitions && - commitDeletedPairViewTransitions(deletion); - } else if (0 !== (deletion.subtreeFlags & 33554432)) - for (deletion = deletion.child; null !== deletion; ) - commitExitViewTransitions(deletion), (deletion = deletion.sibling); - else - null !== appearingViewTransitions && - commitDeletedPairViewTransitions(deletion); + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; } - function commitNestedViewTransitions(changedParent) { - for (changedParent = changedParent.child; null !== changedParent; ) { - if (30 === changedParent.tag) { - var props = changedParent.memoizedProps, - name = getViewTransitionName(props, changedParent.stateNode); - props = getViewTransitionClassName(props.default, props.update); - changedParent.flags &= -5; - "none" !== props && - applyViewTransitionToHostInstances( - changedParent, - name, - props, - (changedParent.memoizedState = []) - ); - } else - 0 !== (changedParent.subtreeFlags & 33554432) && - commitNestedViewTransitions(changedParent); - changedParent = changedParent.sibling; + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + didSuspend = nextProps.children; + nextProps = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = workInProgress.mode), + (didSuspend = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: didSuspend }, + showFallback + )), + (nextProps = createFiberFromFragment( + nextProps, + showFallback, + renderLanes, + null + )), + (didSuspend.return = workInProgress), + (nextProps.return = workInProgress), + (didSuspend.sibling = nextProps), + (workInProgress.child = didSuspend), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(null, nextProps) + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, didSuspend); + } + var prevState = current.memoizedState; + if (null !== prevState) { + var _dehydrated2 = prevState.dehydrated; + if (null !== _dehydrated2) + return updateDehydratedSuspenseComponent( + current, + workInProgress, + didSuspend, + JSCompiler_temp, + nextProps, + _dehydrated2, + prevState, + renderLanes + ); } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (didSuspend = workInProgress.mode), + (prevState = current.child), + (_dehydrated2 = prevState.sibling), + (nextProps = createWorkInProgress(prevState, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = prevState.subtreeFlags & 1206910976), + null !== _dehydrated2 + ? (showFallback = createWorkInProgress(_dehydrated2, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + didSuspend, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + bailoutOffscreenComponent(null, nextProps), + (nextProps = workInProgress.child), + (showFallback = current.child.memoizedState), + null === showFallback + ? (showFallback = mountSuspenseOffscreenState(renderLanes)) + : ((didSuspend = showFallback.cachePool), + null !== didSuspend + ? ((prevState = CacheContext._currentValue2), + (didSuspend = + didSuspend.parent !== prevState + ? { parent: prevState, pool: prevState } + : didSuspend)) + : (didSuspend = getSuspendedCache()), + (showFallback = { + baseLanes: showFallback.baseLanes | renderLanes, + cachePool: didSuspend + })), + (nextProps.memoizedState = showFallback), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(current.child, nextProps) + ); + null !== prevState && + (renderLanes & 62914560) === renderLanes && + 0 !== (renderLanes & current.lanes) && + markRenderDerivedCause(workInProgress); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: nextProps.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; } - function restorePairedViewTransitions(parent) { - if (0 !== (parent.subtreeFlags & 18874368)) - for (parent = parent.child; null !== parent; ) { - if (22 !== parent.tag || null === parent.memoizedState) { - if (30 === parent.tag && 0 !== (parent.flags & 18874368)) { - var instance = parent.stateNode; - null !== instance.paired && (instance.paired = null); - } - restorePairedViewTransitions(parent); - } - parent = parent.sibling; - } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } - function restoreEnterOrExitViewTransitions(fiber) { - if (30 === fiber.tag) - (fiber.stateNode.paired = null), restorePairedViewTransitions(fiber); - else if (0 !== (fiber.subtreeFlags & 33554432)) - for (fiber = fiber.child; null !== fiber; ) - restoreEnterOrExitViewTransitions(fiber), (fiber = fiber.sibling); - else restorePairedViewTransitions(fiber); + function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + offscreenProps = createFiber(22, offscreenProps, null, mode); + offscreenProps.lanes = 0; + return offscreenProps; } - function measureNestedViewTransitions(changedParent, gesture) { - for (changedParent = changedParent.child; null !== changedParent; ) { - if (30 === changedParent.tag) { - var props = changedParent.memoizedProps, - state = changedParent.stateNode; - getViewTransitionName(props, state); - getViewTransitionClassName(props.default, props.update); - gesture - ? ((props = state.clones), - null !== props && props.map(measureClonedInstance)) - : (changedParent.memoizedState = null); - viewTransitionHostInstanceIdx = 0; - } else - 0 !== (changedParent.subtreeFlags & 33554432) && - measureNestedViewTransitions(changedParent, gesture); - changedParent = changedParent.sibling; - } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } - function trackNamedViewTransition(fiber) { - var name = fiber.memoizedProps.name; - if (null != name && "auto" !== name) { - var existing = mountedNamedViewTransitions.get(name); - if (void 0 !== existing) { - if ( - existing !== fiber && - existing !== fiber.alternate && - !didWarnAboutName[name] - ) { - didWarnAboutName[name] = !0; - var stringifiedName = JSON.stringify(name); - runWithFiberInDEV(fiber, function () { - console.error( - "There are two components with the same name mounted at the same time. This is not supported and will cause View Transitions to error. Try to use a more unique name e.g. by using a namespace prefix and adding the id of an item to the name.", - stringifiedName - ); - }); - runWithFiberInDEV(existing, function () { - console.error( - "The existing duplicate has this stack trace.", - stringifiedName - ); - }); - } - } else mountedNamedViewTransitions.set(name, fiber); + function updateDehydratedSuspenseComponent( + current, + workInProgress, + didSuspend, + didPrimaryChildrenDefer, + nextProps, + suspenseInstance, + suspenseState, + renderLanes + ) { + if (didSuspend) { + if (workInProgress.flags & 256) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) + ); + if (null !== workInProgress.memoizedState) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + null + ); + reuseSuspenseHandlerOnStack(workInProgress); + suspenseState = nextProps.fallback; + didSuspend = workInProgress.mode; + nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + didSuspend + ); + suspenseState = createFiberFromFragment( + suspenseState, + didSuspend, + renderLanes, + null + ); + suspenseState.flags |= 2; + nextProps.return = workInProgress; + suspenseState.return = workInProgress; + nextProps.sibling = suspenseState; + workInProgress.child = nextProps; + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + nextProps = workInProgress.child; + nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); + nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + didPrimaryChildrenDefer, + renderLanes + ); + workInProgress.memoizedState = SUSPENDED_MARKER; + return bailoutOffscreenComponent(null, nextProps); } - } - function untrackNamedViewTransition(fiber) { - var name = fiber.memoizedProps.name; - if (null != name && "auto" !== name) { - var existing = mountedNamedViewTransitions.get(name); - void 0 === existing || - (existing !== fiber && existing !== fiber.alternate) || - mountedNamedViewTransitions.delete(name); + pushPrimaryTreeSuspenseHandler(workInProgress); + 0 !== (renderLanes & 536870912) && markRenderDerivedCause(workInProgress); + if (isSuspenseInstanceFallback()) + return ( + (didSuspend = getSuspenseInstanceFallbackErrorDetails()), + (didPrimaryChildrenDefer = didSuspend.digest), + (suspenseState = didSuspend.message), + (nextProps = didSuspend.stack), + (didSuspend = didSuspend.componentStack), + didPrimaryChildrenDefer !== REACT_RECOVERABLE_DIGEST && + ((suspenseState = suspenseState + ? Error(suspenseState) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (suspenseState.stack = nextProps || ""), + (suspenseState.digest = didPrimaryChildrenDefer), + (didPrimaryChildrenDefer = + void 0 === didSuspend ? null : didSuspend), + (nextProps = { + value: suspenseState, + source: null, + stack: didPrimaryChildrenDefer + }), + "string" === typeof didPrimaryChildrenDefer && + CapturedStacks.set(suspenseState, nextProps), + null === hydrationErrors + ? (hydrationErrors = [nextProps]) + : hydrationErrors.push(nextProps)), + retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1); + didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || didPrimaryChildrenDefer) { + if (null !== currentTreeHiddenStackCursor.current) + return retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + didPrimaryChildrenDefer = workInProgressRoot; + if ( + null !== didPrimaryChildrenDefer && + ((nextProps = getBumpedLaneForHydration( + didPrimaryChildrenDefer, + renderLanes + )), + 0 !== nextProps && nextProps !== suspenseState.retryLane) + ) + throw ( + ((suspenseState.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps), + SelectiveHydrationException) + ); + isSuspenseInstancePending() || renderDidSuspendDelayIfPossible(); + return retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); } + if (isSuspenseInstancePending()) + return ( + (workInProgress.flags |= 192), + (workInProgress.child = current.child), + null + ); + current = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + ); + current.flags |= 134221824; + return current; } - function isHydratingParent(current, finishedWork) { - return 31 === finishedWork.tag - ? ((finishedWork = finishedWork.memoizedState), - null !== current.memoizedState && null === finishedWork) - : 13 === finishedWork.tag - ? ((current = current.memoizedState), - (finishedWork = finishedWork.memoizedState), - null !== current && - null !== current.dehydrated && - (null === finishedWork || null === finishedWork.dehydrated)) - : 3 === finishedWork.tag - ? current.memoizedState.isDehydrated && - 0 === (finishedWork.flags & 256) - : !1; + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); } - function commitBeforeMutationEffects(root, firstChild, committedLanes) { - root = (committedLanes & 335544064) === committedLanes; - nextEffect = firstChild; - for (firstChild = root ? 9270 : 1024; null !== nextEffect; ) { - committedLanes = nextEffect; - if (root) { - var deletions = committedLanes.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) - root && commitExitViewTransitions(deletions[i]); - } - if ( - null === committedLanes.alternate && - 0 !== (committedLanes.flags & 2) - ) - root && trackEnterViewTransitions(committedLanes), - commitBeforeMutationEffects_complete(root); - else { - if (22 === committedLanes.tag && 0 !== (committedLanes.mode & 1)) - if ( - ((deletions = committedLanes.alternate), - null !== committedLanes.memoizedState) - ) { - null !== deletions && - null === deletions.memoizedState && - root && - commitExitViewTransitions(deletions); - commitBeforeMutationEffects_complete(root); - continue; - } else if (null !== deletions && null !== deletions.memoizedState) { - root && trackEnterViewTransitions(committedLanes); - commitBeforeMutationEffects_complete(root); - continue; - } - deletions = committedLanes.child; - 0 !== (committedLanes.subtreeFlags & firstChild) && null !== deletions - ? ((deletions.return = committedLanes), (nextEffect = deletions)) - : (root && commitNestedViewTransitions(committedLanes), - commitBeforeMutationEffects_complete(root)); - } + function findLastContentRow(firstChild) { + for (var lastContentRow = null; null !== firstChild; ) { + var currentRow = firstChild.alternate; + null !== currentRow && + null === findFirstSuspended(currentRow) && + (lastContentRow = firstChild); + firstChild = firstChild.sibling; } - appearingViewTransitions = null; + return lastContentRow; } - function commitBeforeMutationEffects_complete( - isViewTransitionEligible$jscomp$0 + function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode, + treeForkCount ) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - finishedWork = fiber, - isViewTransitionEligible = isViewTransitionEligible$jscomp$0, - current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 1: - 0 !== (flags & 1024) && - null !== current && - commitClassSnapshot(finishedWork, current); - break; - case 3: - break; - case 0: - case 11: - case 15: - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - case 30: - isViewTransitionEligible && - null !== current && - ((isViewTransitionEligible = current), - (current = finishedWork), - (finishedWork = getViewTransitionName( - isViewTransitionEligible.memoizedProps, - isViewTransitionEligible.stateNode - )), - (current = current.memoizedProps), - (current = getViewTransitionClassName( - current.default, - current.update - )), - "none" !== current && - applyViewTransitionToHostInstances( - isViewTransitionEligible, - finishedWork, - current, - (isViewTransitionEligible.memoizedState = []) - )); - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - isViewTransitionEligible = fiber.sibling; - if (null !== isViewTransitionEligible) { - isViewTransitionEligible.return = fiber.return; - nextEffect = isViewTransitionEligible; - break; - } - nextEffect = fiber.return; + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode, + treeForkCount: treeForkCount + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode), + (renderState.treeForkCount = treeForkCount)); + } + function reverseChildren(fiber) { + var row = fiber.child; + for (fiber.child = null; null !== row; ) { + var nextRow = row.sibling; + row.sibling = fiber.child; + fiber.child = row; + row = nextRow; } } - function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && - commitHookLayoutEffects(finishedWork, Layout | HasEffect); - break; - case 1: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 4) - if (((finishedRoot = finishedWork.stateNode), null === current)) - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - finishedRoot.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )), - shouldProfile(finishedWork) - ? (startEffectTimer(), - runWithFiberInDEV( - finishedWork, - callComponentDidMountInDEV, - finishedWork, - finishedRoot - ), - recordEffectDuration()) - : runWithFiberInDEV( - finishedWork, - callComponentDidMountInDEV, - finishedWork, - finishedRoot - ); - else { - var prevProps = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + var suspenseContext = suspenseStackCursor.current; + if (workInProgress.flags & 128) + return pushSuspenseListContext(workInProgress, suspenseContext), null; + var shouldForceFallback = 0 !== (suspenseContext & ForceSuspenseFallback); + shouldForceFallback + ? ((suspenseContext = + (suspenseContext & SubtreeSuspenseContextMask) | + ForceSuspenseFallback), + (workInProgress.flags |= 128)) + : (suspenseContext &= SubtreeSuspenseContextMask); + pushSuspenseListContext(workInProgress, suspenseContext); + suspenseContext = null == revealOrder ? "null" : revealOrder; + if ( + null != revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "unstable_legacy-backwards" !== revealOrder && + "together" !== revealOrder && + "independent" !== revealOrder && + !didWarnAboutRevealOrder[suspenseContext] + ) + if ( + ((didWarnAboutRevealOrder[suspenseContext] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + case "independent": + console.error( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() ); - current = current.memoizedState; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - finishedRoot.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - shouldProfile(finishedWork) - ? (startEffectTimer(), - runWithFiberInDEV( - finishedWork, - callComponentDidUpdateInDEV, - finishedWork, - finishedRoot, - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ), - recordEffectDuration()) - : runWithFiberInDEV( - finishedWork, - callComponentDidUpdateInDEV, - finishedWork, - finishedRoot, - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } - flags & 64 && commitClassCallbacks(finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 3: - current = pushNestedEffectDurations(); - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if ( - flags & 64 && - ((flags = finishedWork.updateQueue), null !== flags) - ) { - prevProps = null; - if (null !== finishedWork.child) - switch (finishedWork.child.tag) { - case 27: - case 5: - prevProps = getPublicInstance(finishedWork.child.stateNode); - break; - case 1: - prevProps = finishedWork.child.stateNode; - } - try { - runWithFiberInDEV( - finishedWork, - commitCallbacks, - flags, - prevProps + break; + case "forward": + case "backward": + console.error( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - finishedRoot.effectDuration += popNestedEffectDurations(current); - break; - case 27: - case 26: - case 5: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (null === current) - if (flags & 4) commitHostMount(finishedWork); - else if (flags & 64) { - finishedRoot = finishedWork.type; - current = finishedWork.memoizedProps; - prevProps = finishedWork.stateNode; - try { - runWithFiberInDEV( - finishedWork, - commitHydratedInstance, - prevProps, - finishedRoot, - current, - finishedWork - ); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } - } - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - if (flags & 4) { - flags = pushNestedEffectDurations(); - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - finishedRoot = finishedWork.stateNode; - finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); - try { - runWithFiberInDEV( - finishedWork, - commitProfiler, - finishedWork, - current, - commitStartTime, - finishedRoot.effectDuration + break; + default: + console.error( + '"%s" is not a supported revealOrder on . Did you mean "independent", "together", "forwards" or "backwards"?', + revealOrder ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + else + console.error( + '%s is not a supported value for revealOrder on . Did you mean "independent", "together", "forwards" or "backwards"?', + revealOrder + ); + suspenseContext = null == tailMode ? "null" : tailMode; + didWarnAboutTailOptions[suspenseContext] || + null == tailMode || + ("visible" !== tailMode && + "collapsed" !== tailMode && + "hidden" !== tailMode + ? ((didWarnAboutTailOptions[suspenseContext] = !0), + console.error( + '"%s" is not a supported value for tail on . Did you mean "visible", "collapsed" or "hidden"?', + tailMode + )) + : null != revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "unstable_legacy-backwards" !== revealOrder && + ((didWarnAboutTailOptions[suspenseContext] = !0), + console.error( + ' is only valid if revealOrder is "forwards" (default) or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + (null == revealOrder || + "forwards" === revealOrder || + "backwards" === revealOrder || + "unstable_legacy-backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for ( + suspenseContext = 0; + suspenseContext < nextProps.length; + suspenseContext++ + ) { + if ( + !validateSuspenseListNestedChild( + nextProps[suspenseContext], + suspenseContext + ) + ) + break a; + } + else if ( + ((suspenseContext = getIteratorFn(nextProps)), + "function" === typeof suspenseContext) + ) { + if ((suspenseContext = suspenseContext.call(nextProps))) + for ( + var step = suspenseContext.next(), _i = 0; + !step.done; + step = suspenseContext.next() + ) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 31: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 13: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 64 && - ((finishedRoot = finishedWork.memoizedState), - null !== finishedRoot && - null !== finishedRoot.dehydrated && - (retryDehydratedSuspenseBoundary.bind(null, finishedWork), - registerSuspenseInstanceRetry())); + } else + console.error( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + "backwards" === revealOrder && null !== current + ? (reverseChildren(current), + reconcileChildren(current, workInProgress, nextProps, renderLanes), + reverseChildren(current)) + : reconcileChildren(current, workInProgress, nextProps, renderLanes); + if ( + !shouldForceFallback && + null !== current && + 0 !== (current.flags & 128) + ) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + switch (revealOrder) { + case "backwards": + renderLanes = findLastContentRow(workInProgress.child); + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null), + reverseChildren(workInProgress)); + initSuspenseListRenderState( + workInProgress, + !0, + revealOrder, + null, + tailMode, + 0 + ); break; - case 22: - if (0 !== (finishedWork.mode & 1)) { - if ( - ((flags = - null !== finishedWork.memoizedState || - offscreenSubtreeIsHidden), - !flags) - ) { - var newOffscreenSubtreeWasHidden = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - current = offscreenSubtreeIsHidden; - prevProps = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = flags; - (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && - !prevProps - ? ((flags = NoLayoutEffectTraversalFlags), - 0 !== (finishedWork.subtreeFlags & 8772) && - (flags |= IncludeWorkInProgressEffects), - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - flags - ), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - )) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = current; - offscreenSubtreeWasHidden = prevProps; + case "unstable_legacy-backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode, + 0 + ); break; - case 30: - flags & 18874368 && trackNamedViewTransition(finishedWork); - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + case "together": + initSuspenseListRenderState( + workInProgress, + !1, + null, + null, + void 0, + 0 + ); + break; + case "independent": + workInProgress.memoizedState = null; break; - case 7: - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + (renderLanes = findLastContentRow(workInProgress.child)), + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)), + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode, + 0 + ); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ), - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - 0.05 < componentEffectEndTime - componentEffectStartTime && - (isHydratingParent( - finishedWork.return.alternate, - finishedWork.return - ) || - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Mount" - ))); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + return workInProgress.child; } - function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber._debugOwner = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; + function updateContextProvider(current, workInProgress, renderLanes) { + var context = workInProgress.type, + newProps = workInProgress.pendingProps, + newValue = newProps.value; + "value" in newProps || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + console.error( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )); + pushProvider(workInProgress, context, newValue); + reconcileChildren( + current, + workInProgress, + newProps.children, + renderLanes + ); + return workInProgress.child; } - function recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - parent + function bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes ) { - for (parent = parent.child; null !== parent; ) - commitDeletionEffectsOnFiber( - finishedRoot, - nearestMountedAncestor, - parent - ), - (parent = parent.sibling); + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; } - function commitDeletionEffectsOnFiber( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ) { - if ( - injectedHook && - "function" === typeof injectedHook.onCommitFiberUnmount - ) - try { - injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %o", - err - )); - } - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (deletedFiber.tag) { - case 26: - case 27: - case 5: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor), - commitFragmentInstanceDeletionEffects(deletedFiber); - case 6: - 6 === deletedFiber.tag && - commitFragmentInstanceDeletionEffects(deletedFiber); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 18: - break; - case 4: - commitHostPortalContainerChildren( - deletedFiber.stateNode, - deletedFiber, - createChildNodeSet() - ); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 0: - case 11: - case 14: - case 15: - commitHookEffectListUnmount( - Insertion, - deletedFiber, - nearestMountedAncestor - ); - offscreenSubtreeWasHidden || - commitHookLayoutUnmountEffects( - deletedFiber, - nearestMountedAncestor, - Layout - ); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 1: - if (!offscreenSubtreeWasHidden) { - safelyDetachRef(deletedFiber, nearestMountedAncestor); - var instance = deletedFiber.stateNode; - "function" === typeof instance.componentWillUnmount && - safelyCallComponentWillUnmount( - deletedFiber, - nearestMountedAncestor, - instance - ); - } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; + } + function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) { + switch (workInProgress.tag) { + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo ); - break; - case 21: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache ); break; - case 22: - deletedFiber.mode & 1 - ? ((offscreenSubtreeWasHidden = - (instance = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState), - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ), - (offscreenSubtreeWasHidden = instance)) - : recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); + case 27: + case 5: + pushHostContext(workInProgress); break; - case 30: - deletedFiber.flags & 18874368 && - untrackNamedViewTransition(deletedFiber); - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo ); break; - case 7: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value ); break; - default: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - } - 0 !== (deletedFiber.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - deletedFiber, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - } - function getRetryCache(finishedWork) { - switch (finishedWork.tag) { + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; case 31: + if (null !== workInProgress.memoizedState) + return ( + (workInProgress.flags |= 128), + pushDehydratedActivitySuspenseHandler(workInProgress), + null + ); + break; case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + stateNode = propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ); + var primaryChildLanes = workInProgress.child.childLanes; + if (stateNode || 0 !== (renderLanes & primaryChildLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; case 19: - var retryCache = finishedWork.stateNode; - null === retryCache && - (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); - return retryCache; + if (workInProgress.flags & 128) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + primaryChildLanes = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (primaryChildLanes) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + primaryChildLanes = workInProgress.memoizedState; + null !== primaryChildLanes && + ((primaryChildLanes.rendering = null), + (primaryChildLanes.tail = null), + (primaryChildLanes.lastEffect = null)); + pushSuspenseListContext(workInProgress, suspenseStackCursor.current); + if (stateNode) break; + else return null; case 22: return ( - (finishedWork = finishedWork.stateNode), - (retryCache = finishedWork._retryCache), - null === retryCache && - (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), - retryCache + (workInProgress.lanes = 0), + updateOffscreenComponent( + current, + workInProgress, + renderLanes, + workInProgress.pendingProps + ) ); - default: - throw Error( - "Unexpected Suspense handler tag (" + - finishedWork.tag + - "). This is a bug in React." + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache ); } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } - function attachSuspenseRetryListeners(finishedWork, wakeables) { - var retryCache = getRetryCache(finishedWork); - wakeables.forEach(function (wakeable) { - if (!retryCache.has(wakeable)) { - retryCache.add(wakeable); - if (isDevToolsPresent) - if (null !== inProgressLanes && null !== inProgressRoot) - restorePendingUpdaters(inProgressRoot, inProgressLanes); - else - throw Error( - "Expected finished root and lanes to be set. This is a bug in React." - ); - var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); - wakeable.then(retry, retry); - } - }); - } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { - var deletions = parentFiber.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = deletions[i], - prevEffectStart = pushComponentEffectStart(); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - 0 !== (deletedFiber.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - deletedFiber, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" - ); - popComponentEffectStart(prevEffectStart); - root = deletedFiber; - returnFiber = root.alternate; - null !== returnFiber && (returnFiber.return = null); - root.return = null; + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + resolveTypeForHotReloading(workInProgress.elementType), + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; } - if (parentFiber.subtreeFlags & 13886) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitMutationEffectsOnFiber(parentFiber, root$jscomp$0, lanes), - (parentFiber = parentFiber.sibling); - } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 134217730; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + workInProgress.type !== current.type + ) + didReceiveUpdate = !0; + else { if ( - flags & 4 && - ((current = finishedWork.updateQueue), - (current = null !== current ? current.events : null), - null !== current) + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) ) - for (var ii = 0; ii < current.length; ii++) { - var _eventPayloads$ii = current[ii]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - (commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork), - commitHookLayoutUnmountEffects( - finishedWork, - finishedWork.return, - Layout | HasEffect - )); - break; + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else didReceiveUpdate = !1; + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + return mountLazyComponent( + workInProgress, + workInProgress.elementType, + renderLanes + ); + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - flags & 64 && - offscreenSubtreeIsHidden && - ((root = finishedWork.updateQueue), - null !== root && - ((lanes = root.callbacks), - null !== lanes && - ((flags = root.shared.hiddenCallbacks), - (root.shared.hiddenCallbacks = - null === flags ? lanes : flags.concat(lanes))))); - break; + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) + throw Error("Should have a current fiber. This is a bug in React."); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + nextProps = workInProgress.memoizedState; + var nextCache = nextProps.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + prevSibling = nextProps.element; + prevSibling === returnFiber + ? (current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + )) + : (reconcileChildren( + current, + workInProgress, + prevSibling, + renderLanes + ), + (current = workInProgress.child)); + return current; case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - null !== finishedWork.alternate && - (finishedWork.alternate.stateNode = finishedWork.stateNode); - break; + return ( + pushHostContext(workInProgress), + (returnFiber = workInProgress.pendingProps.children), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue2 = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - break; - case 3: - current = pushNestedEffectDurations(); - viewTransitionMutationContext = !1; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - lanes = root.containerInfo; - flags = root.pendingChildren; - try { - runWithFiberInDEV( - finishedWork, - replaceContainerChildren, - lanes, - flags - ), - (viewTransitionMutationContext = !0); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - root.effectDuration += popNestedEffectDurations(current); - viewTransitionMutationContext = !1; - break; + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); case 4: - current = pushMutationContext(); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - viewTransitionMutationContext && - inUpdateViewTransition && - (rootViewTransitionAffected = !0); - viewTransitionMutationContext = current; - flags & 4 && - commitHostPortalContainerChildren( - finishedWork.stateNode, - finishedWork, - finishedWork.stateNode.pendingChildren - ); - break; + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + (returnFiber = workInProgress.pendingProps), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); case 12: - flags = pushNestedEffectDurations(); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - finishedWork.stateNode.effectDuration += - bubbleNestedEffectDurations(flags); - break; + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return updateContextProvider(current, workInProgress, renderLanes); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + console.error( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); case 31: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; - case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((root = null !== current && null !== current.memoizedState), - null === finishedWork.memoizedState || - root || - (globalMostRecentFallbackTime = now$1())); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; + prevSibling = workInProgress.pendingProps; + nextProps = 0 !== (workInProgress.flags & 128); + workInProgress.flags &= -129; + if (null === current) + current = mountActivityChildren(workInProgress, prevSibling); + else if ( + ((returnFiber = current.memoizedState), null !== returnFiber) + ) + b: { + pushDehydratedActivitySuspenseHandler(workInProgress); + if (nextProps) { + if (workInProgress.flags & 256) { + workInProgress.flags &= -257; + current = retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + break b; + } + if (null !== workInProgress.memoizedState) { + workInProgress.child = current.child; + workInProgress.flags |= 128; + current = null; + break b; + } + throw Error( + "Client rendering an Activity suspended it again. This is a bug in React." + ); + } + 0 !== (renderLanes & 536870912) && + markRenderDerivedCause(workInProgress); + didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ); + nextProps = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || nextProps) { + if (null === currentTreeHiddenStackCursor.current) { + prevSibling = workInProgressRoot; + if ( + null !== prevSibling && + ((nextProps = getBumpedLaneForHydration( + prevSibling, + renderLanes + )), + 0 !== nextProps && nextProps !== returnFiber.retryLane) + ) + throw ( + ((returnFiber.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(prevSibling, current, nextProps), + SelectiveHydrationException) + ); + renderDidSuspendDelayIfPossible(); + } + current = retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + (current = mountActivityChildren(workInProgress, prevSibling)), + (current.flags |= 134221824); + } + else + (returnFiber = current.child), + (prevSibling = { + mode: prevSibling.mode, + children: prevSibling.children + }), + 0 !== (renderLanes & 536870912) && + 0 !== (renderLanes & current.lanes) && + markRenderDerivedCause(workInProgress), + (current = createWorkInProgress(returnFiber, prevSibling)), + (current.ref = workInProgress.ref), + (workInProgress.child = current), + (current.return = workInProgress); + return current; case 22: - ii = null !== finishedWork.memoizedState; - _eventPayloads$ii = - null !== current && null !== current.memoizedState; - if (finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; - offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || _eventPayloads$ii; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - _eventPayloads$ii && - !ii && - !prevOffscreenSubtreeIsHidden && - !prevOffscreenSubtreeWasHidden && - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - ); - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 8192 && - ((root = finishedWork.stateNode), - (root._visibility = ii - ? root._visibility & ~OffscreenVisible - : root._visibility | OffscreenVisible), - !ii || - null === current || - _eventPayloads$ii || - offscreenSubtreeIsHidden || - offscreenSubtreeWasHidden || - 0 === (finishedWork.mode & 1) || - ((root = _eventPayloads$ii || offscreenSubtreeWasHidden), - (lanes = offscreenSubtreeIsHidden), - (current = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = ii || offscreenSubtreeIsHidden), - (offscreenSubtreeWasHidden = root), - recursivelyTraverseDisappearLayoutEffects(finishedWork), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Disconnect" - ), - (offscreenSubtreeIsHidden = lanes), - (offscreenSubtreeWasHidden = current))); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((lanes = root.retryQueue), - null !== lanes && - ((root.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, lanes)))); - break; - case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; + return updateOffscreenComponent( + current, + workInProgress, + renderLanes, + workInProgress.pendingProps + ); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); case 30: - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - flags = pushMutationContext(); - ii = inUpdateViewTransition; - _eventPayloads$ii = (lanes & 335544064) === lanes; - prevOffscreenSubtreeIsHidden = finishedWork.memoizedProps; - inUpdateViewTransition = - _eventPayloads$ii && - "none" !== - getViewTransitionClassName( - prevOffscreenSubtreeIsHidden.default, - prevOffscreenSubtreeIsHidden.update - ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - _eventPayloads$ii && - null !== current && - viewTransitionMutationContext && - (finishedWork.flags |= 4); - inUpdateViewTransition = ii; - viewTransitionMutationContext = flags; - break; - case 21: - break; - case 7: - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)), - current && - null !== current.stateNode && - (current.stateNode._fragmentFiber = finishedWork); - default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - commitReconciliationEffects(finishedWork); + return ( + null === workInProgress.stateNode && + (workInProgress.stateNode = { + autoName: null, + paired: null, + clones: null, + ref: null + }), + (returnFiber = workInProgress.pendingProps), + null != returnFiber.name && + "auto" !== returnFiber.name && + (workInProgress.flags |= null === current ? 18882560 : 18874368), + void 0 !== returnFiber.className && + ((prevSibling = + "string" === typeof returnFiber.className + ? JSON.stringify(returnFiber.className) + : "{...}"), + didWarnAboutClassNameOnViewTransition[prevSibling] || + ((didWarnAboutClassNameOnViewTransition[prevSibling] = !0), + console.error( + ' doesn\'t accept a "className" prop. It has been renamed to "default".\n- \n+ ', + prevSibling, + prevSibling + ))), + null !== current && current.memoizedProps.name !== returnFiber.name + ? (workInProgress.flags |= 4194816) + : markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ), - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - 0.05 < componentEffectEndTime - componentEffectStartTime && - (isHydratingParent( - finishedWork.return.alternate, - finishedWork.return - ) || - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Mount" - ))); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } - function commitReconciliationEffects(finishedWork) { - var flags = finishedWork.flags; - if (flags & 2) { - try { - runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - finishedWork.flags &= -3; + function doesRequireClone(current, completedWork) { + if (null !== current && current.child === completedWork.child) return !1; + if (0 !== (completedWork.flags & 16)) return !0; + for (current = completedWork.child; null !== current; ) { + if (0 !== (current.flags & 8218) || 0 !== (current.subtreeFlags & 8218)) + return !0; + current = current.sibling; } - flags & 4096 && (finishedWork.flags &= -4097); - } - function recursivelyTraverseAfterMutationEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 9270) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitAfterMutationEffectsOnFiber(parentFiber, root), - (parentFiber = parentFiber.sibling); - else measureNestedViewTransitions(parentFiber, !1); + return !1; } - function commitAfterMutationEffectsOnFiber(finishedWork, root) { - var current = finishedWork.alternate; - if (null === current) commitEnterViewTransitions(finishedWork, !1); - else - switch (finishedWork.tag) { - case 3: - viewTransitionContextChanged = !1; - pushViewTransitionCancelableScope(); - recursivelyTraverseAfterMutationEffects(root, finishedWork); - if ( - !viewTransitionContextChanged && - !rootViewTransitionAffected && - ((finishedWork = viewTransitionCancelableChildren), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current += 3) - console.warn("cancelViewTransitionName is not implemented"); - viewTransitionCancelableChildren = null; - break; - case 5: - recursivelyTraverseAfterMutationEffects(root, finishedWork); - break; - case 4: - current = viewTransitionContextChanged; - viewTransitionContextChanged = !1; - recursivelyTraverseAfterMutationEffects(root, finishedWork); - viewTransitionContextChanged && (rootViewTransitionAffected = !0); - viewTransitionContextChanged = current; - break; - case 22: - 0 !== (finishedWork.mode & 1) - ? null === finishedWork.memoizedState && - (null !== current.memoizedState - ? commitEnterViewTransitions(finishedWork, !1) - : recursivelyTraverseAfterMutationEffects(root, finishedWork)) - : recursivelyTraverseAfterMutationEffects(root, finishedWork); - break; - case 30: - var _prevContextChanged = viewTransitionContextChanged, - prevCancelableChildren = pushViewTransitionCancelableScope(); - viewTransitionContextChanged = !1; - recursivelyTraverseAfterMutationEffects(root, finishedWork); - viewTransitionContextChanged && (finishedWork.flags |= 4); - root = finishedWork.memoizedProps; - var state = finishedWork.stateNode; - getViewTransitionName(root, state); - getViewTransitionName(current.memoizedProps, state); - "none" !== getViewTransitionClassName(root.default, root.update) && - ((root = current.memoizedState), - (current.memoizedState = null), - (viewTransitionHostInstanceIdx = 0), - viewTransitionHostInstanceIdx !== - (null === root ? 0 : root.length) && - (finishedWork.flags |= 32)); - null !== prevCancelableChildren && - (prevCancelableChildren.push.apply( - prevCancelableChildren, - viewTransitionCancelableChildren - ), - (viewTransitionCancelableChildren = prevCancelableChildren)); - viewTransitionContextChanged = - 0 !== (finishedWork.flags & 32) ? !0 : _prevContextChanged; - break; - default: - recursivelyTraverseAfterMutationEffects(root, finishedWork); + function appendAllChildren( + parent, + workInProgress, + needsVisibilityToggle, + isHidden + ) { + for (var _node = workInProgress.child; null !== _node; ) { + if (5 === _node.tag) { + var instance = _node.stateNode; + needsVisibilityToggle && + isHidden && + (instance = cloneHiddenInstance(instance)); + appendChildNode(parent.node, instance.node); + } else if (6 === _node.tag) { + instance = _node.stateNode; + if (needsVisibilityToggle && isHidden) + throw Error("Not yet implemented."); + appendChildNode(parent.node, instance.node); + } else if (4 !== _node.tag) + if (22 === _node.tag && null !== _node.memoizedState) + (instance = _node.child), + null !== instance && (instance.return = _node), + appendAllChildren(parent, _node, !0, !0); + else if (null !== _node.child) { + _node.child.return = _node; + _node = _node.child; + continue; + } + if (_node === workInProgress) break; + for (; null === _node.sibling; ) { + if (null === _node.return || _node.return === workInProgress) return; + _node = _node.return; } + _node.sibling.return = _node.return; + _node = _node.sibling; + } } - function recursivelyTraverseLayoutEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 8772) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), - (parentFiber = parentFiber.sibling); + function appendAllChildrenToContainer( + containerChildSet, + workInProgress, + needsVisibilityToggle, + isHidden + ) { + for ( + var hasOffscreenComponentChild = !1, node = workInProgress.child; + null !== node; + + ) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && + isHidden && + (instance = cloneHiddenInstance(instance)); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) + throw Error("Not yet implemented."); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (4 !== node.tag) + if (22 === node.tag && null !== node.memoizedState) + (hasOffscreenComponentChild = node.child), + null !== hasOffscreenComponentChild && + (hasOffscreenComponentChild.return = node), + appendAllChildrenToContainer(containerChildSet, node, !0, !0), + (hasOffscreenComponentChild = !0); + else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === workInProgress) + return hasOffscreenComponentChild; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return hasOffscreenComponentChild; } - function disappearLayoutEffects(finishedWork) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - commitHookLayoutUnmountEffects( - finishedWork, - finishedWork.return, - Layout - ); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 1: - safelyDetachRef(finishedWork, finishedWork.return); - var instance = finishedWork.stateNode; - "function" === typeof instance.componentWillUnmount && - safelyCallComponentWillUnmount( - finishedWork, - finishedWork.return, - instance - ); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 27: - case 5: - safelyDetachRef(finishedWork, finishedWork.return); - (5 !== finishedWork.tag && 27 !== finishedWork.tag) || - commitFragmentInstanceDeletionEffects(finishedWork); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 6: - commitFragmentInstanceDeletionEffects(finishedWork); - break; - case 26: - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseDisappearLayoutEffects(finishedWork); + function updateHostContainer(current, workInProgress) { + if (doesRequireClone(current, workInProgress)) { + current = workInProgress.stateNode; + var newChildSet = createChildNodeSet(); + appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1); + current.pendingChildren = newChildSet; + workInProgress.flags |= 4; + } + } + function scheduleRetryEffect(workInProgress, retryQueue) { + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); + } + function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "visible": break; - case 30: - finishedWork.flags & 18874368 && - untrackNamedViewTransition(finishedWork); - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); + case "collapsed": + for ( + var tailNode = renderState.tail, lastTailNode = null; + null !== tailNode; + + ) + null !== tailNode.alternate && (lastTailNode = tailNode), + (tailNode = tailNode.sibling); + null === lastTailNode + ? hasRenderedATailFallback || null === renderState.tail + ? (renderState.tail = null) + : (renderState.tail.sibling = null) + : (lastTailNode.sibling = null); break; - case 7: - safelyDetachRef(finishedWork, finishedWork.return); default: - recursivelyTraverseDisappearLayoutEffects(finishedWork); + hasRenderedATailFallback = renderState.tail; + for (tailNode = null; null !== hasRenderedATailFallback; ) + null !== hasRenderedATailFallback.alternate && + (tailNode = hasRenderedATailFallback), + (hasRenderedATailFallback = hasRenderedATailFallback.sibling); + null === tailNode + ? (renderState.tail = null) + : (tailNode.sibling = null); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } - function recursivelyTraverseDisappearLayoutEffects(parentFiber) { - for (parentFiber = parentFiber.child; null !== parentFiber; ) - disappearLayoutEffects(parentFiber), - (parentFiber = parentFiber.sibling); + function bubbleProperties(completedWork) { + var didBailout = + null !== completedWork.alternate && + completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) + if (0 !== (completedWork.mode & 2)) { + for ( + var _treeBaseDuration = completedWork.selfBaseDuration, + _child2 = completedWork.child; + null !== _child2; + + ) + (newChildLanes |= _child2.lanes | _child2.childLanes), + (subtreeFlags |= _child2.subtreeFlags & 1206910976), + (subtreeFlags |= _child2.flags & 1206910976), + (_treeBaseDuration += _child2.treeBaseDuration), + (_child2 = _child2.sibling); + completedWork.treeBaseDuration = _treeBaseDuration; + } else + for ( + _treeBaseDuration = completedWork.child; + null !== _treeBaseDuration; + + ) + (newChildLanes |= + _treeBaseDuration.lanes | _treeBaseDuration.childLanes), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 1206910976), + (subtreeFlags |= _treeBaseDuration.flags & 1206910976), + (_treeBaseDuration.return = completedWork), + (_treeBaseDuration = _treeBaseDuration.sibling); + else if (0 !== (completedWork.mode & 2)) { + _treeBaseDuration = completedWork.actualDuration; + _child2 = completedWork.selfBaseDuration; + for (var child = completedWork.child; null !== child; ) + (newChildLanes |= child.lanes | child.childLanes), + (subtreeFlags |= child.subtreeFlags), + (subtreeFlags |= child.flags), + (_treeBaseDuration += child.actualDuration), + (_child2 += child.treeBaseDuration), + (child = child.sibling); + completedWork.actualDuration = _treeBaseDuration; + completedWork.treeBaseDuration = _child2; + } else + for ( + _treeBaseDuration = completedWork.child; + null !== _treeBaseDuration; + + ) + (newChildLanes |= + _treeBaseDuration.lanes | _treeBaseDuration.childLanes), + (subtreeFlags |= _treeBaseDuration.subtreeFlags), + (subtreeFlags |= _treeBaseDuration.flags), + (_treeBaseDuration.return = completedWork), + (_treeBaseDuration = _treeBaseDuration.sibling); + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; } - function reappearLayoutEffects( - finishedRoot, - current, - finishedWork, - layoutEffectTraversalFlags - ) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - flags = finishedWork.flags, - includeWorkInProgressEffects = - (layoutEffectTraversalFlags & IncludeWorkInProgressEffects) !== - NoLayoutEffectTraversalFlags; - switch (finishedWork.tag) { + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + switch (workInProgress.tag) { + case 16: + case 15: case 0: case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - commitHookLayoutEffects(finishedWork, Layout); - break; + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + return bubbleProperties(workInProgress), null; + case 3: + return ( + (newProps = workInProgress.stateNode), + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && + (workInProgress.flags |= 2048), + popProvider(CacheContext, workInProgress), + popHostContainer(workInProgress), + newProps.pendingContext && + ((newProps.context = newProps.pendingContext), + (newProps.pendingContext = null)), + (null !== current && null !== current.child) || + null === current || + (current.memoizedState.isDehydrated && + 0 === (workInProgress.flags & 256)) || + ((workInProgress.flags |= 1024), + upgradeHydrationErrorsToRecoverable()), + updateHostContainer(current, workInProgress), + bubbleProperties(workInProgress), + null ); - commitClassDidMount(finishedWork); - current = finishedWork.updateQueue; - if (null !== current) { - finishedRoot = finishedWork.stateNode; - try { - runWithFiberInDEV( - finishedWork, - commitHiddenCallbacks, - current, - finishedRoot + case 26: + case 27: + case 5: + popHostContext(workInProgress); + var _type2 = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) + if ( + ((renderLanes = current.stateNode), + (_type2 = current.memoizedProps), + (current = doesRequireClone(current, workInProgress)) || + _type2 !== newProps) + ) { + requiredContext(contextStackCursor.current); + b: { + var keepChildren = !current; + _type2 = reactPrivateInterface.diffAttributePayloads( + _type2, + newProps, + renderLanes.canonical.viewConfig.validAttributes + ); + renderLanes.canonical.currentProps = newProps; + newProps = renderLanes.node; + if (keepChildren) + if (null !== _type2) + newProps = cloneNodeWithNewProps(newProps, _type2); + else { + newProps = renderLanes; + break b; + } + else + newProps = + null !== _type2 + ? cloneNodeWithNewChildrenAndProps(newProps, _type2) + : cloneNodeWithNewChildren(newProps); + newProps = { node: newProps, canonical: renderLanes.canonical }; + } + newProps === renderLanes + ? (workInProgress.stateNode = renderLanes) + : ((workInProgress.flags |= 8), + (workInProgress.stateNode = newProps), + current && + appendAllChildren(newProps, workInProgress, !1, !1)); + } else workInProgress.stateNode = renderLanes; + else { + if (!newProps) { + if (null === workInProgress.stateNode) + throw Error( + "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." + ); + bubbleProperties(workInProgress); + workInProgress.subtreeFlags &= -33554433; + return null; + } + requiredContext(contextStackCursor.current); + current = requiredContext(rootInstanceStackCursor.current); + renderLanes = allocateTag(); + _type2 = getViewConfigForType(_type2); + for (keepChildren in _type2.validAttributes) + newProps.hasOwnProperty(keepChildren) && + reactPrivateInterface.deepFreezeAndThrowOnMutationInDev( + newProps[keepChildren] + ); + keepChildren = reactPrivateInterface.createAttributePayload( + newProps, + _type2.validAttributes + ); + current = { + node: createNode( + renderLanes, + _type2.uiViewClassName, + current.containerTag, + keepChildren, + workInProgress + ), + canonical: { + nativeTag: renderLanes, + viewConfig: _type2, + currentProps: newProps, + internalInstanceHandle: workInProgress, + publicInstance: null, + publicRootInstance: current.publicInstance + } + }; + workInProgress.flags |= 8; + appendAllChildren(current, workInProgress, !1, !1); + workInProgress.stateNode = current; + } + bubbleProperties(workInProgress); + workInProgress.subtreeFlags &= -33554433; + workInProgress.flags &= -16777217; + return null; + case 6: + if (current && null != workInProgress.stateNode) + current.memoizedProps !== newProps + ? ((current = requiredContext(rootInstanceStackCursor.current)), + (renderLanes = requiredContext(contextStackCursor.current)), + (workInProgress.flags |= 8), + (workInProgress.stateNode = createTextInstance( + newProps, + current, + renderLanes, + workInProgress + ))) + : (workInProgress.stateNode = current.stateNode); + else { + if ( + "string" !== typeof newProps && + null === workInProgress.stateNode + ) + throw Error( + "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + current = requiredContext(rootInstanceStackCursor.current); + renderLanes = requiredContext(contextStackCursor.current); + workInProgress.flags |= 8; + workInProgress.stateNode = createTextInstance( + newProps, + current, + renderLanes, + workInProgress + ); + } + bubbleProperties(workInProgress); + return null; + case 31: + newProps = workInProgress.memoizedState; + if (null === current || null !== current.memoizedState) { + if (null !== newProps) { + if (null === current) { + throw Error( + "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." + ); + throw Error( + "Expected prepareToHydrateHostActivityInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." + ); + } + emitPendingHydrationWarnings(); + 0 === (workInProgress.flags & 128) && + (newProps = workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + null !== newProps && + ((current = workInProgress.child), + null !== current && + (workInProgress.treeBaseDuration -= + current.treeBaseDuration)); + current = !1; + } else + (newProps = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = newProps), + (current = !0); + if (!current) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; + } + if (0 !== (workInProgress.flags & 128)) + throw Error( + "Client rendering an Activity suspended it again. This is a bug in React." + ); + } + bubbleProperties(workInProgress); + return null; + case 13: + newProps = workInProgress.memoizedState; + if ( + null === current || + (null !== current.memoizedState && + null !== current.memoizedState.dehydrated) + ) { + keepChildren = newProps; + if (null !== keepChildren && null !== keepChildren.dehydrated) { + if (null === current) { + throw Error( + "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." + ); + throw Error( + "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." + ); + } + emitPendingHydrationWarnings(); + 0 === (workInProgress.flags & 128) && + (keepChildren = workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + null !== keepChildren && + ((keepChildren = workInProgress.child), + null !== keepChildren && + (workInProgress.treeBaseDuration -= + keepChildren.treeBaseDuration)); + keepChildren = !1; + } else + (keepChildren = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = keepChildren), + (keepChildren = !0); + if (!keepChildren) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; } } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 27: - case 5: - (5 !== finishedWork.tag && 27 !== finishedWork.tag) || - commitFragmentInstanceInsertionEffects(finishedWork); - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + popSuspenseHandler(workInProgress); + if (0 !== (workInProgress.flags & 128)) + return ( + (workInProgress.lanes = renderLanes), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress + ); + newProps = null !== newProps; + current = null !== current && null !== current.memoizedState; + newProps && + ((renderLanes = workInProgress.child), + (keepChildren = null), + null !== renderLanes.alternate && + null !== renderLanes.alternate.memoizedState && + null !== renderLanes.alternate.memoizedState.cachePool && + (keepChildren = + renderLanes.alternate.memoizedState.cachePool.pool), + (_type2 = null), + null !== renderLanes.memoizedState && + null !== renderLanes.memoizedState.cachePool && + (_type2 = renderLanes.memoizedState.cachePool.pool), + _type2 !== keepChildren && (renderLanes.flags |= 2048)); + newProps !== current && + newProps && + (workInProgress.child.flags |= 8192); + scheduleRetryEffect(workInProgress, workInProgress.updateQueue); + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + newProps && + ((current = workInProgress.child), + null !== current && + (workInProgress.treeBaseDuration -= current.treeBaseDuration)); + return null; + case 4: + return ( + popHostContainer(workInProgress), + updateHostContainer(current, workInProgress), + (workInProgress.flags |= 67108864), + bubbleProperties(workInProgress), + null ); - includeWorkInProgressEffects && - null === current && - flags & 4 && - commitHostMount(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 6: - commitFragmentInstanceInsertionEffects(finishedWork); - break; - case 26: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + case 10: + return ( + popProvider(workInProgress.type, workInProgress), + bubbleProperties(workInProgress), + null ); - includeWorkInProgressEffects && - null === current && - flags & 4 && - commitHostMount(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - if (includeWorkInProgressEffects && flags & 4) { - flags = pushNestedEffectDurations(); - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - includeWorkInProgressEffects = finishedWork.stateNode; - includeWorkInProgressEffects.effectDuration += - bubbleNestedEffectDurations(flags); - try { - runWithFiberInDEV( - finishedWork, - commitProfiler, - finishedWork, - current, - commitStartTime, - includeWorkInProgressEffects.effectDuration - ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + case 19: + popSuspenseListContext(workInProgress); + newProps = workInProgress.memoizedState; + if (null === newProps) return bubbleProperties(workInProgress), null; + keepChildren = 0 !== (workInProgress.flags & 128); + _type2 = newProps.rendering; + if (null === _type2) + if (keepChildren) cutOffTailIfNeeded(newProps, !1); + else { + if ( + workInProgressRootExitStatus !== RootInProgress || + (null !== current && 0 !== (current.flags & 128)) + ) + for (current = workInProgress.child; null !== current; ) { + _type2 = findFirstSuspended(current); + if (null !== _type2) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(newProps, !1); + current = _type2.updateQueue; + workInProgress.updateQueue = current; + scheduleRetryEffect(workInProgress, current); + workInProgress.subtreeFlags = 0; + current = renderLanes; + for (newProps = workInProgress.child; null !== newProps; ) + resetWorkInProgress(newProps, current), + (newProps = newProps.sibling); + pushSuspenseListContext( + workInProgress, + (suspenseStackCursor.current & + SubtreeSuspenseContextMask) | + ForceSuspenseFallback + ); + return workInProgress.child; + } + current = current.sibling; + } + null !== newProps.tail && + now$1() > workInProgressRootRenderTargetTime && + ((workInProgress.flags |= 128), + (keepChildren = !0), + cutOffTailIfNeeded(newProps, !1), + (workInProgress.lanes = 4194304)); } - } else - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - break; - case 31: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + else { + if (!keepChildren) + if (((current = findFirstSuspended(_type2)), null !== current)) { + if ( + ((workInProgress.flags |= 128), + (keepChildren = !0), + (current = current.updateQueue), + (workInProgress.updateQueue = current), + scheduleRetryEffect(workInProgress, current), + cutOffTailIfNeeded(newProps, !0), + null === newProps.tail && + "collapsed" !== newProps.tailMode && + "visible" !== newProps.tailMode && + !_type2.alternate) + ) + return bubbleProperties(workInProgress), null; + } else + 2 * now$1() - newProps.renderingStartTime > + workInProgressRootRenderTargetTime && + 536870912 !== renderLanes && + ((workInProgress.flags |= 128), + (keepChildren = !0), + cutOffTailIfNeeded(newProps, !1), + (workInProgress.lanes = 4194304)); + newProps.isBackwards + ? ((_type2.sibling = workInProgress.child), + (workInProgress.child = _type2)) + : ((current = newProps.last), + null !== current + ? (current.sibling = _type2) + : (workInProgress.child = _type2), + (newProps.last = _type2)); + } + if (null !== newProps.tail) { + current = newProps.tail; + a: { + for (renderLanes = current; null !== renderLanes; ) { + if (null !== renderLanes.alternate) { + renderLanes = !1; + break a; + } + renderLanes = renderLanes.sibling; + } + renderLanes = !0; + } + newProps.rendering = current; + newProps.tail = current.sibling; + newProps.renderingStartTime = now$1(); + current.sibling = null; + _type2 = suspenseStackCursor.current; + _type2 = keepChildren + ? (_type2 & SubtreeSuspenseContextMask) | ForceSuspenseFallback + : _type2 & SubtreeSuspenseContextMask; + "visible" !== newProps.tailMode && + "collapsed" !== newProps.tailMode && + renderLanes + ? ((newProps = _type2), + push( + suspenseHandlerStackCursor, + workInProgress, + workInProgress + ), + push(suspenseStackCursor, newProps, workInProgress), + null === shellBoundary && (shellBoundary = workInProgress)) + : pushSuspenseListContext(workInProgress, _type2); + return current; + } + bubbleProperties(workInProgress); + return null; + case 22: + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(workInProgress), + (newProps = null !== workInProgress.memoizedState), + null !== current + ? (null !== current.memoizedState) !== newProps && + (workInProgress.flags |= 8192) + : newProps && (workInProgress.flags |= 8192), + newProps + ? 0 !== (renderLanes & 536870912) && + 0 === (workInProgress.flags & 128) && + (bubbleProperties(workInProgress), + workInProgress.subtreeFlags & 6 && + (workInProgress.flags |= 8192)) + : bubbleProperties(workInProgress), + (newProps = workInProgress.updateQueue), + null !== newProps && + scheduleRetryEffect(workInProgress, newProps.retryQueue), + (newProps = null), + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (newProps = current.memoizedState.cachePool.pool), + (renderLanes = null), + null !== workInProgress.memoizedState && + null !== workInProgress.memoizedState.cachePool && + (renderLanes = workInProgress.memoizedState.cachePool.pool), + renderLanes !== newProps && (workInProgress.flags |= 2048), + null !== current && pop(resumedCache, workInProgress), + null ); - break; - case 13: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + case 24: + return ( + (newProps = null), + null !== current && (newProps = current.memoizedState.cache), + workInProgress.memoizedState.cache !== newProps && + (workInProgress.flags |= 2048), + popProvider(CacheContext, workInProgress), + bubbleProperties(workInProgress), + null ); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; + case 25: + return null; case 30: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - flags & 18874368 && trackNamedViewTransition(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 7: - safelyAttachRef(finishedWork, finishedWork.return); - default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags + return ( + (workInProgress.flags |= 33554432), + bubbleProperties(workInProgress), + null ); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - } - function recursivelyTraverseReappearLayoutEffects( - finishedRoot, - parentFiber, - layoutEffectTraversalFlags - ) { - layoutEffectTraversalFlags = - 0 !== (parentFiber.subtreeFlags & 8772) - ? layoutEffectTraversalFlags - : layoutEffectTraversalFlags & ~IncludeWorkInProgressEffects; - for (parentFiber = parentFiber.child; null !== parentFiber; ) - reappearLayoutEffects( - finishedRoot, - parentFiber.alternate, - parentFiber, - layoutEffectTraversalFlags - ), - (parentFiber = parentFiber.sibling); - } - function commitOffscreenPassiveMountEffects(current, finishedWork) { - var previousCache = null; - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (previousCache = current.memoizedState.cachePool.pool); - current = null; - null !== finishedWork.memoizedState && - null !== finishedWork.memoizedState.cachePool && - (current = finishedWork.memoizedState.cachePool.pool); - current !== previousCache && - (null != current && retainCache(current), - null != previousCache && releaseCache(previousCache)); - } - function commitCachePassiveMountEffect(current, finishedWork) { - current = null; - null !== finishedWork.alternate && - (current = finishedWork.alternate.memoizedState.cache); - finishedWork = finishedWork.memoizedState.cache; - finishedWork !== current && - (retainCache(finishedWork), null != current && releaseCache(current)); - } - function recursivelyTraversePassiveMountEffects( - root, - parentFiber, - committedLanes, - committedTransitions, - endTime - ) { - if ( - parentFiber.subtreeFlags & - ((committedLanes & 335544064) === committedLanes ? 10262 : 10256) || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child)) - ) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var nextSibling = parentFiber.sibling; - commitPassiveMountOnFiber( - root, - parentFiber, - committedLanes, - committedTransitions, - null !== nextSibling ? nextSibling.actualStartTime : endTime - ); - parentFiber = nextSibling; - } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } - function commitPassiveMountOnFiber( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - prevDeepEquality = alreadyWarnedForDeepEquality, - isViewTransitionEligible = - (committedLanes & 335544064) === committedLanes; - isViewTransitionEligible && - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - restoreEnterOrExitViewTransitions(finishedWork); - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - 0 !== (finishedWork.mode & 2) && - 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) && - logComponentRender( - finishedWork, - finishedWork.actualStartTime, - endTime, - inHydratedSubtree, - committedLanes - ); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && - commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); - break; + function unwindWork(current, workInProgress) { + switch (workInProgress.tag) { case 1: - 0 !== (finishedWork.mode & 2) && - 0 < finishedWork.actualStartTime && - (0 !== (finishedWork.flags & 128) - ? logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime, - [] - ) - : 0 !== (finishedWork.flags & 1) && - logComponentRender( - finishedWork, - finishedWork.actualStartTime, - endTime, - inHydratedSubtree, - committedLanes - )); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime + return ( + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null ); - break; case 3: - var prevProfilerEffectDuration = pushNestedEffectDurations(); - isViewTransitionEligible = inHydratedSubtree; - inHydratedSubtree = - null !== finishedWork.alternate && - finishedWork.alternate.memoizedState.isDehydrated && - 0 === (finishedWork.flags & 256); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime + return ( + popProvider(CacheContext, workInProgress), + popHostContainer(workInProgress), + (current = workInProgress.flags), + 0 !== (current & 65536) && 0 === (current & 128) + ? ((workInProgress.flags = (current & -65537) | 128), + workInProgress) + : null + ); + case 26: + case 27: + case 5: + return popHostContext(workInProgress), null; + case 31: + if ( + null !== workInProgress.memoizedState && + (popSuspenseHandler(workInProgress), + null === workInProgress.alternate) + ) + throw Error( + "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." + ); + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null; + case 13: + popSuspenseHandler(workInProgress); + current = workInProgress.memoizedState; + if ( + null !== current && + null !== current.dehydrated && + null === workInProgress.alternate + ) + throw Error( + "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." + ); + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null; + case 19: + return ( + popSuspenseListContext(workInProgress), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + (current = workInProgress.memoizedState), + null !== current && + ((current.rendering = null), (current.tail = null)), + (workInProgress.flags |= 4), + workInProgress) + : null ); - inHydratedSubtree = isViewTransitionEligible; - flags & 2048 && - ((committedLanes = null), - null !== finishedWork.alternate && - (committedLanes = finishedWork.alternate.memoizedState.cache), - (committedTransitions = finishedWork.memoizedState.cache), - committedTransitions !== committedLanes && - (retainCache(committedTransitions), - null != committedLanes && releaseCache(committedLanes))); - finishedRoot.passiveEffectDuration += popNestedEffectDurations( - prevProfilerEffectDuration + case 4: + return popHostContainer(workInProgress), null; + case 10: + return popProvider(workInProgress.type, workInProgress), null; + case 22: + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(workInProgress), + null !== current && pop(resumedCache, workInProgress), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null ); + case 24: + return popProvider(CacheContext, workInProgress), null; + case 25: + return null; + default: + return null; + } + } + function unwindInterruptedWork(current, interruptedWork) { + switch (interruptedWork.tag) { + case 3: + popProvider(CacheContext, interruptedWork); + popHostContainer(interruptedWork); break; - case 12: - if (flags & 2048) { - flags = pushNestedEffectDurations(); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - finishedRoot = finishedWork.stateNode; - finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(flags); - try { - runWithFiberInDEV( - finishedWork, - commitProfilerPostCommitImpl, - finishedWork, - finishedWork.alternate, - commitStartTime, - finishedRoot.passiveEffectDuration - ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } else - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); + case 26: + case 27: + case 5: + popHostContext(interruptedWork); + break; + case 4: + popHostContainer(interruptedWork); break; case 31: - flags = inHydratedSubtree; - prevProfilerEffectDuration = - null !== finishedWork.alternate - ? finishedWork.alternate.memoizedState - : null; - isViewTransitionEligible = finishedWork.memoizedState; - null !== prevProfilerEffectDuration && - null === isViewTransitionEligible - ? ((isViewTransitionEligible = finishedWork.deletions), - null !== isViewTransitionEligible && - 0 < isViewTransitionEligible.length && - 18 === isViewTransitionEligible[0].tag - ? ((inHydratedSubtree = !1), - (prevProfilerEffectDuration = - prevProfilerEffectDuration.hydrationErrors), - null !== prevProfilerEffectDuration && - logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime, - prevProfilerEffectDuration - )) - : (inHydratedSubtree = !0)) - : (inHydratedSubtree = !1); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - inHydratedSubtree = flags; + null !== interruptedWork.memoizedState && + popSuspenseHandler(interruptedWork); break; case 13: - flags = inHydratedSubtree; - prevProfilerEffectDuration = - null !== finishedWork.alternate - ? finishedWork.alternate.memoizedState - : null; - isViewTransitionEligible = finishedWork.memoizedState; - null === prevProfilerEffectDuration || - null === prevProfilerEffectDuration.dehydrated || - (null !== isViewTransitionEligible && - null !== isViewTransitionEligible.dehydrated) - ? (inHydratedSubtree = !1) - : ((isViewTransitionEligible = finishedWork.deletions), - null !== isViewTransitionEligible && - 0 < isViewTransitionEligible.length && - 18 === isViewTransitionEligible[0].tag - ? ((inHydratedSubtree = !1), - (prevProfilerEffectDuration = - prevProfilerEffectDuration.hydrationErrors), - null !== prevProfilerEffectDuration && - logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime, - prevProfilerEffectDuration - )) - : (inHydratedSubtree = !0)); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - inHydratedSubtree = flags; + popSuspenseHandler(interruptedWork); break; - case 23: + case 19: + popSuspenseListContext(interruptedWork); + break; + case 10: + popProvider(interruptedWork.type, interruptedWork); break; case 22: - var _instance3 = finishedWork.stateNode; - prevProfilerEffectDuration = finishedWork.alternate; - null !== finishedWork.memoizedState - ? (isViewTransitionEligible && - null !== prevProfilerEffectDuration && - null === prevProfilerEffectDuration.memoizedState && - restoreEnterOrExitViewTransitions(prevProfilerEffectDuration), - _instance3._visibility & OffscreenPassiveEffectsConnected - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : ((_instance3._visibility |= - OffscreenPassiveEffectsConnected), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ))) - : (isViewTransitionEligible && - null !== prevProfilerEffectDuration && - null !== prevProfilerEffectDuration.memoizedState && - restoreEnterOrExitViewTransitions(finishedWork), - _instance3._visibility & OffscreenPassiveEffectsConnected - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) || - (0 !== finishedWork.actualDuration && - (null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child)), - endTime - ), - 0 === (finishedWork.mode & 2) || - inHydratedSubtree || - ((finishedRoot = finishedWork.actualStartTime), - 0 <= finishedRoot && - 0.05 < endTime - finishedRoot && - logComponentReappeared( - finishedWork, - finishedRoot, - endTime - ), - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < - componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - )))); - flags & 2048 && - commitOffscreenPassiveMountEffects( - prevProfilerEffectDuration, - finishedWork - ); + case 23: + popSuspenseHandler(interruptedWork); + popHiddenContext(interruptedWork); + null !== current && pop(resumedCache, interruptedWork); break; case 24: - recursivelyTraversePassiveMountEffects( - finishedRoot, + popProvider(CacheContext, interruptedWork); + } + } + function shouldProfile(current) { + return 0 !== (current.mode & 2); + } + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookLayoutUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, finishedWork, - committedLanes, - committedTransitions, - endTime + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - case 30: - recursivelyTraversePassiveMountEffects( - finishedRoot, + } + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor + ) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = finishedWork), + runWithFiberInDEV( + lastEffect, + callDestroyInDEV, + lastEffect, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, finishedWork, - committedLanes, - committedTransitions, - endTime + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ); - break; - default: - recursivelyTraversePassiveMountEffects( - finishedRoot, + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( finishedWork, - committedLanes, - committedTransitions, - endTime + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordEffectDuration()) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(finishedWork.stateNode); + break; + case 30: + instanceToUse = finishedWork.stateNode; + var name = getViewTransitionName( + finishedWork.memoizedProps, + instanceToUse + ); + if (null === instanceToUse.ref || instanceToUse.ref.name !== name) + instanceToUse.ref = createViewTransitionInstance(name); + instanceToUse = instanceToUse.ref; + break; + case 7: + null === finishedWork.stateNode && + ((instanceToUse = new FragmentInstance(finishedWork)), + traverseVisibleInstancesAndTextInstances( + finishedWork.child, + !1, + addFragmentHandleToFiber, + instanceToUse, + void 0, + void 0 + ), + (finishedWork.stateNode = instanceToUse)); + instanceToUse = finishedWork.stateNode; + break; + default: + instanceToUse = finishedWork.stateNode; + } + if ("function" === typeof ref) + if (shouldProfile(finishedWork)) + try { + startEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordEffectDuration(); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); } - if (0 !== (finishedWork.mode & 2)) { - if ( - (finishedRoot = - !inHydratedSubtree && - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate) - ) - (committedLanes = finishedWork.actualStartTime), - 0 <= committedLanes && - 0.05 < endTime - committedLanes && - logComponentTrigger( - finishedWork, - committedLanes, - endTime, - "Mount" - ); - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ), - finishedRoot && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Mount" - )); + } + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); } - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - alreadyWarnedForDeepEquality = prevDeepEquality; } - function recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), runWithFiberInDEV(current, refCleanup); + } finally { + recordEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$4) { + captureCommitPhaseError(current, nearestMountedAncestor, error$4); + } + else ref.current = null; + } + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && - (0 !== (parentFiber.subtreeFlags & 10256) || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child))); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var nextSibling = parentFiber.sibling; - reconnectPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - null !== nextSibling ? nextSibling.actualStartTime : endTime + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit(id, current, effectDuration, commitStartTime); + } + function commitProfilerPostCommitImpl( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { + var _finishedWork$memoize2 = finishedWork.memoizedProps; + finishedWork = _finishedWork$memoize2.id; + _finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize2 && + _finishedWork$memoize2( + finishedWork, + current, + passiveEffectDuration, + commitStartTime + ); + } + function pushMutationContext() { + var prev = viewTransitionMutationContext; + viewTransitionMutationContext = !1; + return prev; + } + function commitFragmentInstanceInsertionEffects(fiber) { + for (var parent = fiber.return; null !== parent; ) { + isFragmentInstanceParent(parent) && + commitNewChildToFragmentInstance(fiber.stateNode, parent.stateNode); + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; + } + } + function commitFragmentInstanceDeletionEffects(fiber) { + for (var parent = fiber.return; null !== parent; ) { + if (isFragmentInstanceParent(parent)) { + var childInstance = fiber.stateNode, + fragmentInstance = parent.stateNode; + null != childInstance.canonical && + ((childInstance = getPublicInstance(childInstance)), + null != childInstance.reactFragments && + childInstance.reactFragments.delete(fragmentInstance)); + } + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; + } + } + function isFragmentInstanceHostBoundary(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || !1; + } + function isFragmentInstanceParent(fiber) { + return fiber && 7 === fiber.tag && null !== fiber.stateNode; + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork ); - parentFiber = nextSibling; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } - function reconnectPassiveEffects( - finishedRoot, + function commitPlacement(finishedWork) { + for ( + var parentFragmentInstances = null, parent = finishedWork.return; + null !== parent; + + ) { + if (isFragmentInstanceParent(parent)) { + var fragmentInstance = parent.stateNode; + null === parentFragmentInstances + ? (parentFragmentInstances = [fragmentInstance]) + : parentFragmentInstances.push(fragmentInstance); + } + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; + } + commitImmutablePlacementNodeToFragmentInstances( + finishedWork, + parentFragmentInstances + ); + } + function commitImmutablePlacementNodeToFragmentInstances( finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime + parentFragmentInstances ) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - prevDeepEquality = alreadyWarnedForDeepEquality; - includeWorkInProgressEffects && - 0 !== (finishedWork.mode & 2) && - 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) && - logComponentRender( - finishedWork, - finishedWork.actualStartTime, - endTime, - inHydratedSubtree, - committedLanes - ); - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); - commitHookPassiveMountEffects(finishedWork, Passive); - break; - case 23: - break; - case 22: - var _instance4 = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected - ? recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - )) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork + if (5 === finishedWork.tag) { + if ( + (5 === finishedWork.tag || + 27 === finishedWork.tag || + 6 === finishedWork.tag) && + null === finishedWork.alternate && + null !== parentFragmentInstances + ) + for (var i = 0; i < parentFragmentInstances.length; i++) + commitNewChildToFragmentInstance( + finishedWork.stateNode, + parentFragmentInstances[i] ); - break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, + } else if ( + 4 !== finishedWork.tag && + ((finishedWork = finishedWork.child), null !== finishedWork) + ) + for ( + commitImmutablePlacementNodeToFragmentInstances( finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, + parentFragmentInstances + ), + finishedWork = finishedWork.sibling; + null !== finishedWork; + + ) + commitImmutablePlacementNodeToFragmentInstances( finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); + parentFragmentInstances + ), + (finishedWork = finishedWork.sibling); + } + function commitHostPortalContainerChildren( + portal, + finishedWork, + pendingChildren + ) { + portal = portal.containerInfo; + try { + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, + portal, + pendingChildren + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function trackEnterViewTransitions(placement) { + if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432)) + shouldStartViewTransition = !0; + } + function pushViewTransitionCancelableScope() { + var prevChildren = viewTransitionCancelableChildren; + viewTransitionCancelableChildren = null; + return prevChildren; + } + function applyViewTransitionToHostInstances() { + viewTransitionHostInstanceIdx = 0; + return !1; + } + function commitAppearingPairViewTransitions(placement) { + if (0 !== (placement.subtreeFlags & 18874368)) + for (placement = placement.child; null !== placement; ) { + if (22 !== placement.tag || null === placement.memoizedState) + if ( + (commitAppearingPairViewTransitions(placement), + 30 === placement.tag && + 0 !== (placement.flags & 18874368) && + placement.stateNode.paired) + ) { + var props = placement.memoizedProps; + if (null == props.name || "auto" === props.name) + throw Error( + "Found a pair with an auto name. This is a bug in React." + ); + "none" !== + getViewTransitionClassName(props.default, props.share) && + applyViewTransitionToHostInstances(placement); + } + placement = placement.sibling; + } + } + function commitEnterViewTransitions(placement, gesture) { + if (30 === placement.tag) { + var state = placement.stateNode, + props = placement.memoizedProps; + getViewTransitionName(props, state); + "none" !== + getViewTransitionClassName( + props.default, + state.paired ? props.share : props.enter + ) + ? applyViewTransitionToHostInstances(placement) && + (commitAppearingPairViewTransitions(placement), + state.paired || + gesture || + scheduleViewTransitionEvent(placement, props.onEnter)) + : commitAppearingPairViewTransitions(placement); + } else if (0 !== (placement.subtreeFlags & 33554432)) + for (placement = placement.child; null !== placement; ) + commitEnterViewTransitions(placement, gesture), + (placement = placement.sibling); + else commitAppearingPairViewTransitions(placement); + } + function commitDeletedPairViewTransitions(deletion) { + if ( + null !== appearingViewTransitions && + 0 !== appearingViewTransitions.size + ) { + var pairs = appearingViewTransitions; + if (0 !== (deletion.subtreeFlags & 18874368)) + for (deletion = deletion.child; null !== deletion; ) { + if (22 !== deletion.tag || null === deletion.memoizedState) { + if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) { + var props = deletion.memoizedProps, + name = props.name; + if (null != name && "auto" !== name) { + var pair = pairs.get(name); + if (void 0 !== pair) { + if ( + "none" !== + getViewTransitionClassName( + props.default, + props.share + ) && + applyViewTransitionToHostInstances(deletion) + ) { + var oldInstance = deletion.stateNode; + pair.paired = oldInstance; + oldInstance.paired = pair; + scheduleViewTransitionEvent(deletion, props.onShare); + } + pairs.delete(name); + if (0 === pairs.size) break; + } + } + } + commitDeletedPairViewTransitions(deletion); + } + deletion = deletion.sibling; + } } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - alreadyWarnedForDeepEquality = prevDeepEquality; } - function recursivelyTraverseAtomicPassiveEffects( - finishedRoot$jscomp$0, - parentFiber, - committedLanes$jscomp$0, - committedTransitions$jscomp$0, - endTime$jscomp$0 - ) { - if ( - parentFiber.subtreeFlags & 10256 || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child)) - ) - for (var child = parentFiber.child; null !== child; ) { - parentFiber = child.sibling; - var finishedRoot = finishedRoot$jscomp$0, - committedLanes = committedLanes$jscomp$0, - committedTransitions = committedTransitions$jscomp$0, - endTime = - null !== parentFiber - ? parentFiber.actualStartTime - : endTime$jscomp$0, - prevDeepEquality = alreadyWarnedForDeepEquality; - 0 !== (child.mode & 2) && - 0 < child.actualStartTime && - 0 !== (child.flags & 1) && - logComponentRender( - child, - child.actualStartTime, - endTime, - inHydratedSubtree, - committedLanes + function commitExitViewTransitions(deletion) { + if (30 === deletion.tag) { + var props = deletion.memoizedProps, + name = getViewTransitionName(props, deletion.stateNode), + pair = + null !== appearingViewTransitions + ? appearingViewTransitions.get(name) + : void 0; + if ( + "none" !== + getViewTransitionClassName( + props.default, + void 0 !== pair ? props.share : props.exit + ) && + applyViewTransitionToHostInstances(deletion) + ) + if (void 0 !== pair) { + var oldInstance = deletion.stateNode; + pair.paired = oldInstance; + oldInstance.paired = pair; + appearingViewTransitions.delete(name); + scheduleViewTransitionEvent(deletion, props.onShare); + } else scheduleViewTransitionEvent(deletion, props.onExit); + null !== appearingViewTransitions && + commitDeletedPairViewTransitions(deletion); + } else if (0 !== (deletion.subtreeFlags & 33554432)) + for (deletion = deletion.child; null !== deletion; ) + commitExitViewTransitions(deletion), (deletion = deletion.sibling); + else + null !== appearingViewTransitions && + commitDeletedPairViewTransitions(deletion); + } + function commitNestedViewTransitions(changedParent) { + for (changedParent = changedParent.child; null !== changedParent; ) { + if (30 === changedParent.tag) { + var props = changedParent.memoizedProps, + name = getViewTransitionName(props, changedParent.stateNode); + props = getViewTransitionClassName(props.default, props.update); + changedParent.flags &= -5; + "none" !== props && + applyViewTransitionToHostInstances( + changedParent, + name, + props, + (changedParent.memoizedState = []) ); - var flags = child.flags; - switch (child.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && - commitOffscreenPassiveMountEffects(child.alternate, child); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime + } else + 0 !== (changedParent.subtreeFlags & 33554432) && + commitNestedViewTransitions(changedParent); + changedParent = changedParent.sibling; + } + } + function restorePairedViewTransitions(parent) { + if (0 !== (parent.subtreeFlags & 18874368)) + for (parent = parent.child; null !== parent; ) { + if (22 !== parent.tag || null === parent.memoizedState) { + if (30 === parent.tag && 0 !== (parent.flags & 18874368)) { + var instance = parent.stateNode; + null !== instance.paired && (instance.paired = null); + } + restorePairedViewTransitions(parent); + } + parent = parent.sibling; + } + } + function restoreEnterOrExitViewTransitions(fiber) { + if (30 === fiber.tag) + (fiber.stateNode.paired = null), restorePairedViewTransitions(fiber); + else if (0 !== (fiber.subtreeFlags & 33554432)) + for (fiber = fiber.child; null !== fiber; ) + restoreEnterOrExitViewTransitions(fiber), (fiber = fiber.sibling); + else restorePairedViewTransitions(fiber); + } + function measureNestedViewTransitions(changedParent, gesture) { + for (changedParent = changedParent.child; null !== changedParent; ) { + if (30 === changedParent.tag) { + var props = changedParent.memoizedProps, + state = changedParent.stateNode; + getViewTransitionName(props, state); + getViewTransitionClassName(props.default, props.update); + gesture + ? ((props = state.clones), + null !== props && props.map(measureClonedInstance)) + : (changedParent.memoizedState = null); + viewTransitionHostInstanceIdx = 0; + } else + 0 !== (changedParent.subtreeFlags & 33554432) && + measureNestedViewTransitions(changedParent, gesture); + changedParent = changedParent.sibling; + } + } + function trackNamedViewTransition(fiber) { + var name = fiber.memoizedProps.name; + if (null != name && "auto" !== name) { + var existing = mountedNamedViewTransitions.get(name); + if (void 0 !== existing) { + if ( + existing !== fiber && + existing !== fiber.alternate && + !didWarnAboutName[name] + ) { + didWarnAboutName[name] = !0; + var stringifiedName = JSON.stringify(name); + runWithFiberInDEV(fiber, function () { + console.error( + "There are two components with the same name mounted at the same time. This is not supported and will cause View Transitions to error. Try to use a more unique name e.g. by using a namespace prefix and adding the id of an item to the name.", + stringifiedName ); - flags & 2048 && - commitCachePassiveMountEffect(child.alternate, child); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime + }); + runWithFiberInDEV(existing, function () { + console.error( + "The existing duplicate has this stack trace.", + stringifiedName ); + }); } - alreadyWarnedForDeepEquality = prevDeepEquality; - child = parentFiber; + } else mountedNamedViewTransitions.set(name, fiber); + } + } + function untrackNamedViewTransition(fiber) { + var name = fiber.memoizedProps.name; + if (null != name && "auto" !== name) { + var existing = mountedNamedViewTransitions.get(name); + void 0 === existing || + (existing !== fiber && existing !== fiber.alternate) || + mountedNamedViewTransitions.delete(name); + } + } + function isHydratingParent(current, finishedWork) { + return 31 === finishedWork.tag + ? ((finishedWork = finishedWork.memoizedState), + null !== current.memoizedState && null === finishedWork) + : 13 === finishedWork.tag + ? ((current = current.memoizedState), + (finishedWork = finishedWork.memoizedState), + null !== current && + null !== current.dehydrated && + (null === finishedWork || null === finishedWork.dehydrated)) + : 3 === finishedWork.tag + ? current.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256) + : !1; + } + function commitBeforeMutationEffects(root, firstChild, committedLanes) { + root = (committedLanes & 335544064) === committedLanes; + nextEffect = firstChild; + for (firstChild = root ? 9270 : 1024; null !== nextEffect; ) { + committedLanes = nextEffect; + if (root) { + var deletions = committedLanes.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) + root && commitExitViewTransitions(deletions[i]); + } + if ( + null === committedLanes.alternate && + 0 !== (committedLanes.flags & 2) + ) + root && trackEnterViewTransitions(committedLanes), + commitBeforeMutationEffects_complete(root); + else { + if (22 === committedLanes.tag) + if ( + ((deletions = committedLanes.alternate), + null !== committedLanes.memoizedState) + ) { + null !== deletions && + null === deletions.memoizedState && + root && + commitExitViewTransitions(deletions); + commitBeforeMutationEffects_complete(root); + continue; + } else if (null !== deletions && null !== deletions.memoizedState) { + root && trackEnterViewTransitions(committedLanes); + commitBeforeMutationEffects_complete(root); + continue; + } + deletions = committedLanes.child; + 0 !== (committedLanes.subtreeFlags & firstChild) && null !== deletions + ? ((deletions.return = committedLanes), (nextEffect = deletions)) + : (root && commitNestedViewTransitions(committedLanes), + commitBeforeMutationEffects_complete(root)); } + } + appearingViewTransitions = null; } - function recursivelyAccumulateSuspenseyCommit(parentFiber) { - if (parentFiber.subtreeFlags & suspenseyCommitFlag) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - accumulateSuspenseyCommitOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); + function commitBeforeMutationEffects_complete( + isViewTransitionEligible$jscomp$0 + ) { + for (; null !== nextEffect; ) { + var fiber = nextEffect, + finishedWork = fiber, + isViewTransitionEligible = isViewTransitionEligible$jscomp$0, + current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(finishedWork, current); + break; + case 3: + break; + case 0: + case 11: + case 15: + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + case 30: + isViewTransitionEligible && + null !== current && + ((isViewTransitionEligible = current), + (current = finishedWork), + (finishedWork = getViewTransitionName( + isViewTransitionEligible.memoizedProps, + isViewTransitionEligible.stateNode + )), + (current = current.memoizedProps), + (current = getViewTransitionClassName( + current.default, + current.update + )), + "none" !== current && + applyViewTransitionToHostInstances( + isViewTransitionEligible, + finishedWork, + current, + (isViewTransitionEligible.memoizedState = []) + )); + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + isViewTransitionEligible = fiber.sibling; + if (null !== isViewTransitionEligible) { + isViewTransitionEligible.return = fiber.return; + nextEffect = isViewTransitionEligible; + break; + } + nextEffect = fiber.return; + } } - function accumulateSuspenseyCommitOnFiber(fiber) { - switch (fiber.tag) { - case 26: - recursivelyAccumulateSuspenseyCommit(fiber); - fiber.flags & suspenseyCommitFlag && - null !== fiber.memoizedState && - suspendResource(); + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 4 && + commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; - case 5: - recursivelyAccumulateSuspenseyCommit(fiber); + case 1: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + finishedRoot.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )), + shouldProfile(finishedWork) + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + finishedRoot.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + shouldProfile(finishedWork) + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } + flags & 64 && commitClassCallbacks(finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - case 4: - recursivelyAccumulateSuspenseyCommit(fiber); - break; - case 22: - if (null === fiber.memoizedState) { - var current = fiber.alternate; - null !== current && null !== current.memoizedState - ? ((current = suspenseyCommitFlag), - (suspenseyCommitFlag = 16777216), - recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current)) - : recursivelyAccumulateSuspenseyCommit(fiber); - } - break; - case 30: + current = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( - 0 !== (fiber.flags & suspenseyCommitFlag) && - ((current = fiber.memoizedProps.name), - null != current && "auto" !== current) + flags & 64 && + ((flags = finishedWork.updateQueue), null !== flags) ) { - var state = fiber.stateNode; - state.paired = null; - null === appearingViewTransitions && - (appearingViewTransitions = new Map()); - appearingViewTransitions.set(current, state); - } - recursivelyAccumulateSuspenseyCommit(fiber); - break; - default: - recursivelyAccumulateSuspenseyCommit(fiber); - } - } - function detachAlternateSiblings(parentFiber) { - var previousFiber = parentFiber.alternate; - if ( - null !== previousFiber && - ((parentFiber = previousFiber.child), null !== parentFiber) - ) { - previousFiber.child = null; - do - (previousFiber = parentFiber.sibling), - (parentFiber.sibling = null), - (parentFiber = previousFiber); - while (null !== parentFiber); - } - } - function recursivelyTraversePassiveUnmountEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i], - prevEffectStart = pushComponentEffectStart(); - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - 0 !== (childToDelete.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - childToDelete, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" + prevProps = null; + if (null !== finishedWork.child) + switch (finishedWork.child.tag) { + case 27: + case 5: + prevProps = getPublicInstance(finishedWork.child.stateNode); + break; + case 1: + prevProps = finishedWork.child.stateNode; + } + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps ); - popComponentEffectStart(prevEffectStart); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - detachAlternateSiblings(parentFiber); - } - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveUnmountOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); - } - function commitPassiveUnmountOnFiber(finishedWork) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.flags & 2048 && - commitHookPassiveUnmountEffects( - finishedWork, - finishedWork.return, - Passive | HasEffect - ); + finishedRoot.effectDuration += popNestedEffectDurations(current); break; - case 3: - var prevProfilerEffectDuration = pushNestedEffectDurations(); - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.stateNode.passiveEffectDuration += - popNestedEffectDurations(prevProfilerEffectDuration); + case 27: + case 26: + case 5: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (null === current) + if (flags & 4) commitHostMount(finishedWork); + else if (flags & 64) { + finishedRoot = finishedWork.type; + current = finishedWork.memoizedProps; + prevProps = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitHydratedInstance, + prevProps, + finishedRoot, + current, + finishedWork + ); + } catch (error) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error + ); + } + } + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - prevProfilerEffectDuration = pushNestedEffectDurations(); - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.stateNode.passiveEffectDuration += - bubbleNestedEffectDurations(prevProfilerEffectDuration); + if (flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + finishedRoot = finishedWork.stateNode; + finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + break; + case 31: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + break; + case 13: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 64 && + ((finishedRoot = finishedWork.memoizedState), + null !== finishedRoot && + null !== finishedRoot.dehydrated && + (retryDehydratedSuspenseBoundary.bind(null, finishedWork), + registerSuspenseInstanceRetry())); break; case 22: - prevProfilerEffectDuration = finishedWork.stateNode; - null !== finishedWork.memoizedState && - prevProfilerEffectDuration._visibility & - OffscreenPassiveEffectsConnected && - (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((prevProfilerEffectDuration._visibility &= - ~OffscreenPassiveEffectsConnected), - recursivelyTraverseDisconnectPassiveEffects(finishedWork), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( + flags = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; + if (!flags) { + var newOffscreenSubtreeWasHidden = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + current = offscreenSubtreeIsHidden; + prevProps = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = flags; + (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && + !prevProps + ? ((flags = NoLayoutEffectTraversalFlags), + 0 !== (finishedWork.subtreeFlags & 8772) && + (flags |= IncludeWorkInProgressEffects), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Disconnect" - )) - : recursivelyTraversePassiveUnmountEffects(finishedWork); + flags + ), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = current; + offscreenSubtreeWasHidden = prevProps; + } + break; + case 30: + flags & 18874368 && trackNamedViewTransition(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; + case 7: + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); default: - recursivelyTraversePassiveUnmountEffects(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } 0 !== (finishedWork.mode & 2) && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ), + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + 0.05 < componentEffectEndTime - componentEffectStartTime && + (isHydratingParent( + finishedWork.return.alternate, + finishedWork.return + ) || + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Mount" + ))); popComponentEffectStart(prevEffectStart); popComponentEffectDuration(prevEffectDuration); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } - function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i], - prevEffectStart = pushComponentEffectStart(); - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - 0 !== (childToDelete.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - childToDelete, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" - ); - popComponentEffectStart(prevEffectStart); - } - detachAlternateSiblings(parentFiber); - } - for (parentFiber = parentFiber.child; null !== parentFiber; ) - disconnectPassiveEffect(parentFiber), - (parentFiber = parentFiber.sibling); + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber._debugOwner = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } - function disconnectPassiveEffect(finishedWork) { + function recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + parent + ) { + for (parent = parent.child; null !== parent; ) + commitDeletionEffectsOnFiber( + finishedRoot, + nearestMountedAncestor, + parent + ), + (parent = parent.sibling); + } + function commitDeletionEffectsOnFiber( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ) { + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberUnmount + ) + try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %o", + err + )); + } var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (finishedWork.tag) { + switch (deletedFiber.tag) { + case 26: + case 27: + case 5: + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor), + commitFragmentInstanceDeletionEffects(deletedFiber); + case 6: + 6 === deletedFiber.tag && + commitFragmentInstanceDeletionEffects(deletedFiber); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 18: + break; + case 4: + commitHostPortalContainerChildren( + deletedFiber.stateNode, + deletedFiber, + createChildNodeSet() + ); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; case 0: case 11: + case 14: case 15: - commitHookPassiveUnmountEffects( - finishedWork, - finishedWork.return, - Passive + commitHookEffectListUnmount( + Insertion, + deletedFiber, + nearestMountedAncestor + ); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects( + deletedFiber, + nearestMountedAncestor, + Layout + ); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 1: + if (!offscreenSubtreeWasHidden) { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + var instance = deletedFiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + instance + ); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 21: + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber ); - recursivelyTraverseDisconnectPassiveEffects(finishedWork); break; case 22: - var instance = finishedWork.stateNode; - instance._visibility & OffscreenPassiveEffectsConnected && - ((instance._visibility &= ~OffscreenPassiveEffectsConnected), - recursivelyTraverseDisconnectPassiveEffects(finishedWork)); + offscreenSubtreeWasHidden = + (instance = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + offscreenSubtreeWasHidden = instance; + break; + case 30: + deletedFiber.flags & 18874368 && + untrackNamedViewTransition(deletedFiber); + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 7: + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: - recursivelyTraverseDisconnectPassiveEffects(finishedWork); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); } - 0 !== (finishedWork.mode & 2) && + 0 !== (deletedFiber.mode & 2) && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect( - finishedWork, + deletedFiber, componentEffectStartTime, componentEffectEndTime, componentEffectDuration, @@ -13838,3487 +11713,4744 @@ __DEV__ && ); popComponentEffectStart(prevEffectStart); popComponentEffectDuration(prevEffectDuration); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } - function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - deletedSubtreeRoot, - nearestMountedAncestor$jscomp$0 - ) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - current = fiber, - nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((nearestMountedAncestor = current.memoizedState.cachePool.pool), - null != nearestMountedAncestor && - retainCache(nearestMountedAncestor)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - 0 !== (current.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - current, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors + function getRetryCache(finishedWork) { + switch (finishedWork.tag) { + case 31: + case 13: + case 19: + var retryCache = finishedWork.stateNode; + null === retryCache && + (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + return retryCache; + case 22: + return ( + (finishedWork = finishedWork.stateNode), + (retryCache = finishedWork._retryCache), + null === retryCache && + (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), + retryCache + ); + default: + throw Error( + "Unexpected Suspense handler tag (" + + finishedWork.tag + + "). This is a bug in React." ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - componentEffectErrors = prevEffectErrors; - current = fiber.child; - if (null !== current) (current.return = fiber), (nextEffect = current); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - current = nextEffect; - prevEffectStart = current.sibling; - prevEffectDuration = current.return; - detachFiberAfterEffects(current); - if (current === fiber) { - nextEffect = null; - break a; - } - if (null !== prevEffectStart) { - prevEffectStart.return = prevEffectDuration; - nextEffect = prevEffectStart; - break a; - } - nextEffect = prevEffectDuration; - } - } - } - function invokeLayoutEffectMountInDEV(fiber) { - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookEffectListMount(Layout | HasEffect, fiber); - break; - case 1: - commitClassDidMount(fiber); } } - function invokePassiveEffectMountInDEV(fiber) { - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookEffectListMount(Passive | HasEffect, fiber); - } + function attachSuspenseRetryListeners(finishedWork, wakeables) { + var retryCache = getRetryCache(finishedWork); + wakeables.forEach(function (wakeable) { + if (!retryCache.has(wakeable)) { + retryCache.add(wakeable); + if (isDevToolsPresent) + if (null !== inProgressLanes && null !== inProgressRoot) + restorePendingUpdaters(inProgressRoot, inProgressLanes); + else + throw Error( + "Expected finished root and lanes to be set. This is a bug in React." + ); + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + attachContextPreservingListener(wakeable, retry); + } + }); } - function invokeLayoutEffectUnmountInDEV(fiber) { - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); - break; - case 1: - var instance = fiber.stateNode; - "function" === typeof instance.componentWillUnmount && - safelyCallComponentWillUnmount(fiber, fiber.return, instance); - } + function recursivelyTraverseMutationEffects( + root$jscomp$0, + parentFiber, + lanes + ) { + var deletions = parentFiber.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + prevEffectStart = pushComponentEffectStart(); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + 0 !== (deletedFiber.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + deletedFiber, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; + } + if (parentFiber.subtreeFlags & 13886) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0, lanes), + (parentFiber = parentFiber.sibling); } - function invokePassiveEffectUnmountInDEV(fiber) { - switch (fiber.tag) { + function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { case 0: case 11: + case 14: case 15: - commitHookEffectListUnmount(Passive | HasEffect, fiber, fiber.return); - } - } - function isConcurrentActEnvironment() { - var isReactActEnvironmentGlobal = - "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT - ? IS_REACT_ACT_ENVIRONMENT - : void 0; - isReactActEnvironmentGlobal || - null === ReactSharedInternals.actQueue || - console.error( - "The current testing environment is not configured to support act(...)" - ); - return isReactActEnvironmentGlobal; - } - function requestUpdateLane(fiber) { - if (0 === (fiber.mode & 1)) return 2; - if ( - (executionContext & RenderContext) !== NoContext && - 0 !== workInProgressRootRenderLanes - ) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - var transition = ReactSharedInternals.T; - return null !== transition - ? (transition._updatedFibers || (transition._updatedFibers = new Set()), - transition._updatedFibers.add(fiber), - requestTransitionLane()) - : resolveUpdatePriority(); - } - function requestDeferredLane() { - if (0 === workInProgressDeferredLane) - if (0 !== (workInProgressRootRenderLanes & 536870912)) - workInProgressDeferredLane = 536870912; - else { - var lane = nextTransitionDeferredLane; - nextTransitionDeferredLane <<= 1; - 0 === (nextTransitionDeferredLane & 3932160) && - (nextTransitionDeferredLane = 262144); - workInProgressDeferredLane = lane; - } - lane = suspenseHandlerStackCursor.current; - null !== lane && (lane.flags |= 32); - return workInProgressDeferredLane; - } - function scheduleViewTransitionEvent(fiber, callback) { - if (null != callback) { - var state = fiber.stateNode, - instance = state.ref; - null === instance && - (instance = state.ref = - createViewTransitionInstance( - getViewTransitionName(fiber.memoizedProps, state) + if ( + flags & 4 && + ((current = finishedWork.updateQueue), + (current = null !== current ? current.events : null), + null !== current) + ) + for (var ii = 0; ii < current.length; ii++) { + var _eventPayloads$ii = current[ii]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout | HasEffect )); - null === pendingViewTransitionEvents && - (pendingViewTransitionEvents = []); - pendingViewTransitionEvents.push(callback.bind(null, instance)); - } - } - function scheduleUpdateOnFiber(root, fiber, lane) { - isRunningInsertionEffect && - console.error("useInsertionEffect must not schedule updates."); - isFlushingPassiveEffects && (didScheduleUpdateDuringPassiveEffects = !0); - if ( - (root === workInProgressRoot && - (workInProgressSuspendedReason === SuspendedOnData || - workInProgressSuspendedReason === SuspendedOnAction)) || - null !== root.cancelPendingCommit - ) - prepareFreshStack(root, 0), - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 - ); - markRootUpdated$1(root, lane); - if ( - (executionContext & RenderContext) !== NoContext && - root === workInProgressRoot - ) { - if (isRendering) - switch (fiber.tag) { - case 0: - case 11: - case 15: - root = - (workInProgress && getComponentNameFromFiber(workInProgress)) || - "Unknown"; - didWarnAboutUpdateInRenderForAnotherComponent.has(root) || - (didWarnAboutUpdateInRenderForAnotherComponent.add(root), - (fiber = getComponentNameFromFiber(fiber) || "Unknown"), - console.error( - "Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render", - fiber, - root, - root - )); - break; - case 1: - didWarnAboutUpdateInRender || - (console.error( - "Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state." - ), - (didWarnAboutUpdateInRender = !0)); - } - } else - isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), - warnIfUpdatesNotWrappedWithActDEV(fiber), - root === workInProgressRoot && - ((executionContext & RenderContext) === NoContext && - (workInProgressRootInterleavedUpdatedLanes |= lane), - workInProgressRootExitStatus === RootSuspendedWithDelay && - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 - )), - ensureRootIsScheduled(root), - 2 !== lane || - executionContext !== NoContext || - 0 !== (fiber.mode & 1) || - ReactSharedInternals.isBatchingLegacy || - ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - flushSyncWorkAcrossRoots_impl(0, !0)); - } - function performWorkOnRoot(root, lanes, forceSync) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { - var yieldedFiber = workInProgress, - yieldEndTime = now$1(); - switch (yieldReason) { - case SuspendedOnImmediate: - case SuspendedOnData: - var startTime = yieldStartTime; - supportsUserTiming && - ((yieldedFiber = yieldedFiber._debugTask) - ? yieldedFiber.run( - console.timeStamp.bind( - console, - "Suspended", - startTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - ) - ) - : console.timeStamp( - "Suspended", - startTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - )); - break; - case SuspendedOnAction: - startTime = yieldStartTime; - supportsUserTiming && - ((yieldedFiber = yieldedFiber._debugTask) - ? yieldedFiber.run( - console.timeStamp.bind( - console, - "Action", - startTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - ) - ) - : console.timeStamp( - "Action", - startTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - )); - break; - default: - supportsUserTiming && - ((yieldedFiber = yieldEndTime - yieldStartTime), - 3 > yieldedFiber || - console.timeStamp( - "Blocked", - yieldStartTime, - yieldEndTime, - "Components \u269b", - void 0, - 5 > yieldedFiber - ? "primary-light" - : 10 > yieldedFiber - ? "primary" - : 100 > yieldedFiber - ? "primary-dark" - : "error" - )); - } - } - var exitStatus = (forceSync = - (!forceSync && - 0 === (lanes & 127) && - 0 === (lanes & root.expiredLanes)) || - checkIfRootIsPrerendering(root, lanes)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes, !0); - startTime = forceSync; - do { - if (exitStatus === RootInProgress) { - workInProgressRootIsPrerendering && - !forceSync && - markRootSuspended(root, lanes, 0, !1); - lanes = workInProgressSuspendedReason; - yieldStartTime = now(); - yieldReason = lanes; break; - } else { - yieldedFiber = now$1(); - yieldEndTime = root.current.alternate; - if ( - startTime && - !isRenderConsistentWithExternalStores(yieldEndTime) - ) { - setCurrentTrackFromLanes(lanes); - yieldEndTime = renderStartTime; - startTime = yieldedFiber; - !supportsUserTiming || - startTime <= yieldEndTime || - (workInProgressUpdateTask - ? workInProgressUpdateTask.run( - console.timeStamp.bind( - console, - "Teared Render", - yieldEndTime, - startTime, - currentTrack, - "Scheduler \u269b", - "error" - ) - ) - : console.timeStamp( - "Teared Render", - yieldEndTime, - startTime, - currentTrack, - "Scheduler \u269b", - "error" - )); - finalizeRender(lanes, yieldedFiber); - exitStatus = renderRootSync(root, lanes, !1); - startTime = !1; - continue; - } - if (0 !== root.tag && exitStatus === RootErrored) { - var lanesThatJustErrored = lanes; - root.errorRecoveryDisabledLanes & lanesThatJustErrored - ? (startTime = 0) - : ((startTime = root.pendingLanes & -536870913), - (startTime = - 0 !== startTime - ? startTime - : startTime & 536870912 - ? 536870912 - : 0)); - if (0 !== startTime) { - setCurrentTrackFromLanes(lanes); - logErroredRenderPhase( - renderStartTime, - yieldedFiber, + case 1: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + flags & 64 && + offscreenSubtreeIsHidden && + ((root = finishedWork.updateQueue), + null !== root && + ((lanes = root.callbacks), + null !== lanes && + ((flags = root.shared.hiddenCallbacks), + (root.shared.hiddenCallbacks = + null === flags ? lanes : flags.concat(lanes))))); + break; + case 26: + case 27: + case 5: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + null !== finishedWork.alternate && + (finishedWork.alternate.stateNode = finishedWork.stateNode); + break; + case 6: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + break; + case 3: + current = pushNestedEffectDurations(); + viewTransitionMutationContext = !1; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + lanes = root.containerInfo; + flags = root.pendingChildren; + try { + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, lanes, - workInProgressUpdateTask - ); - finalizeRender(lanes, yieldedFiber); - lanes = startTime; - a: { - yieldedFiber = root; - exitStatus = workInProgressRootConcurrentErrors; - var wasRootDehydrated = supportsHydration; - startTime = renderRootSync(yieldedFiber, startTime, !1); - if (startTime === RootSuspendedAtTheShell) - yieldedFiber.errorRecoveryDisabledLanes = - yieldedFiber.errorRecoveryDisabledLanes | - lanesThatJustErrored | - workInProgressDeferredLane; - else if (startTime !== RootErrored) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - yieldedFiber.errorRecoveryDisabledLanes |= - lanesThatJustErrored; - workInProgressRootInterleavedUpdatedLanes |= - lanesThatJustErrored; - exitStatus = RootSuspendedWithDelay; - break a; - } - yieldedFiber = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = exitStatus; - null !== yieldedFiber && - (null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = yieldedFiber) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - yieldedFiber - )); - } - exitStatus = startTime; - } - startTime = !1; - if (exitStatus !== RootErrored) continue; - else yieldedFiber = now$1(); + flags + ), + (viewTransitionMutationContext = !0); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } - if (exitStatus === RootFatalErrored) { - setCurrentTrackFromLanes(lanes); - logErroredRenderPhase( - renderStartTime, - yieldedFiber, - lanes, - workInProgressUpdateTask + root.effectDuration += popNestedEffectDurations(current); + viewTransitionMutationContext = !1; + break; + case 4: + current = pushMutationContext(); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + viewTransitionMutationContext && + inUpdateViewTransition && + (rootViewTransitionAffected = !0); + viewTransitionMutationContext = current; + flags & 4 && + commitHostPortalContainerChildren( + finishedWork.stateNode, + finishedWork, + finishedWork.stateNode.pendingChildren ); - finalizeRender(lanes, yieldedFiber); - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0, !0); - break; - } - a: { - forceSync = root; - startTime = exitStatus; - switch (startTime) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194048) !== lanes && (lanes & 62914560) !== lanes) - break; - case RootSuspendedAtTheShell: - setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase( - renderStartTime, - yieldedFiber, - lanes, - workInProgressUpdateTask - ); - finalizeRender(lanes, yieldedFiber); - yieldEndTime = lanes; - 0 !== (yieldEndTime & 127) - ? (blockingSuspendedTime = yieldedFiber) - : 0 !== (yieldEndTime & 4194048) && - (transitionSuspendedTime = yieldedFiber); - markRootSuspended( - forceSync, - lanes, - workInProgressDeferredLane, - !workInProgressRootDidSkipSuspendedSiblings - ); - break a; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); - } - if (null !== ReactSharedInternals.actQueue) - completeRoot$1( - forceSync, - yieldEndTime, - lanes, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - startTime, - null, - null, - renderStartTime, - yieldedFiber - ); - else { - if ( - (lanes & 62914560) === lanes && - startTime === RootSuspended && - ((exitStatus = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - forceSync, - lanes, - workInProgressDeferredLane, - !workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(forceSync, 0, !0)) break a; - pendingEffectsLanes = lanes; - forceSync.timeoutHandle = scheduleTimeout( - completeRootWhenReady.bind( - null, - forceSync, - yieldEndTime, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - startTime, - "Throttled", - renderStartTime, - yieldedFiber - ), - exitStatus - ); - break a; - } - completeRootWhenReady( - forceSync, - yieldEndTime, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - startTime, - null, - renderStartTime, - yieldedFiber + break; + case 12: + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + finishedWork.stateNode.effectDuration += + bubbleNestedEffectDurations(flags); + break; + case 31: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); + break; + case 13: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + finishedWork.child.flags & 8192 && + ((root = null !== current && null !== current.memoizedState), + null === finishedWork.memoizedState || + root || + (globalMostRecentFallbackTime = now$1())); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); + break; + case 22: + ii = null !== finishedWork.memoizedState; + _eventPayloads$ii = + null !== current && null !== current.memoizedState; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || _eventPayloads$ii; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + _eventPayloads$ii && + !ii && + !prevOffscreenSubtreeIsHidden && + !prevOffscreenSubtreeWasHidden && + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + ); + commitReconciliationEffects(finishedWork); + flags & 8192 && + ((root = finishedWork.stateNode), + (root._visibility = ii + ? root._visibility & ~OffscreenVisible + : root._visibility | OffscreenVisible), + !ii || + null === current || + _eventPayloads$ii || + offscreenSubtreeIsHidden || + offscreenSubtreeWasHidden || + ((root = _eventPayloads$ii || offscreenSubtreeWasHidden), + (lanes = offscreenSubtreeIsHidden), + (current = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = ii || offscreenSubtreeIsHidden), + (offscreenSubtreeWasHidden = root), + recursivelyTraverseDisappearLayoutEffects(finishedWork), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Disconnect" + ), + (offscreenSubtreeIsHidden = lanes), + (offscreenSubtreeWasHidden = current))); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((lanes = root.retryQueue), + null !== lanes && + ((root.retryQueue = null), + attachSuspenseRetryListeners(finishedWork, lanes)))); + break; + case 19: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); + break; + case 30: + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + flags = pushMutationContext(); + ii = inUpdateViewTransition; + _eventPayloads$ii = (lanes & 335544064) === lanes; + prevOffscreenSubtreeIsHidden = finishedWork.memoizedProps; + inUpdateViewTransition = + _eventPayloads$ii && + "none" !== + getViewTransitionClassName( + prevOffscreenSubtreeIsHidden.default, + prevOffscreenSubtreeIsHidden.update ); - } - } + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + _eventPayloads$ii && + null !== current && + viewTransitionMutationContext && + (finishedWork.flags |= 4); + inUpdateViewTransition = ii; + viewTransitionMutationContext = flags; + break; + case 21: + break; + case 7: + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)), + current && + null !== current.stateNode && + (current.stateNode._fragmentFiber = finishedWork); + default: + recursivelyTraverseMutationEffects(root, finishedWork, lanes), + commitReconciliationEffects(finishedWork); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ), + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + 0.05 < componentEffectEndTime - componentEffectStartTime && + (isHydratingParent( + finishedWork.return.alternate, + finishedWork.return + ) || + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Mount" + ))); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + } + function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + if (flags & 2) { + try { + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - break; - } while (1); - ensureRootIsScheduled(root); + finishedWork.flags &= -3; + } + flags & 4096 && (finishedWork.flags &= -4097); + } + function recursivelyTraverseAfterMutationEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 9270) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitAfterMutationEffectsOnFiber(parentFiber, root), + (parentFiber = parentFiber.sibling); + else measureNestedViewTransitions(parentFiber, !1); + } + function commitAfterMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate; + if (null === current) commitEnterViewTransitions(finishedWork, !1); + else + switch (finishedWork.tag) { + case 3: + viewTransitionContextChanged = !1; + pushViewTransitionCancelableScope(); + recursivelyTraverseAfterMutationEffects(root, finishedWork); + if ( + !viewTransitionContextChanged && + !rootViewTransitionAffected && + ((finishedWork = viewTransitionCancelableChildren), + null !== finishedWork) + ) + for (current = 0; current < finishedWork.length; current += 3) + console.warn("cancelViewTransitionName is not implemented"); + viewTransitionCancelableChildren = null; + break; + case 5: + recursivelyTraverseAfterMutationEffects(root, finishedWork); + break; + case 4: + current = viewTransitionContextChanged; + viewTransitionContextChanged = !1; + recursivelyTraverseAfterMutationEffects(root, finishedWork); + viewTransitionContextChanged && (rootViewTransitionAffected = !0); + viewTransitionContextChanged = current; + break; + case 22: + null === finishedWork.memoizedState && + (null !== current.memoizedState + ? commitEnterViewTransitions(finishedWork, !1) + : recursivelyTraverseAfterMutationEffects(root, finishedWork)); + break; + case 30: + var _prevContextChanged = viewTransitionContextChanged, + prevCancelableChildren = pushViewTransitionCancelableScope(); + viewTransitionContextChanged = !1; + recursivelyTraverseAfterMutationEffects(root, finishedWork); + viewTransitionContextChanged && (finishedWork.flags |= 4); + root = finishedWork.memoizedProps; + var state = finishedWork.stateNode; + getViewTransitionName(root, state); + getViewTransitionName(current.memoizedProps, state); + "none" !== getViewTransitionClassName(root.default, root.update) && + ((root = current.memoizedState), + (current.memoizedState = null), + (viewTransitionHostInstanceIdx = 0), + viewTransitionHostInstanceIdx !== + (null === root ? 0 : root.length) && + (finishedWork.flags |= 32)); + null !== prevCancelableChildren && + (prevCancelableChildren.push.apply( + prevCancelableChildren, + viewTransitionCancelableChildren + ), + (viewTransitionCancelableChildren = prevCancelableChildren)); + viewTransitionContextChanged = + 0 !== (finishedWork.flags & 32) ? !0 : _prevContextChanged; + break; + default: + recursivelyTraverseAfterMutationEffects(root, finishedWork); + } + } + function recursivelyTraverseLayoutEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 8772) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), + (parentFiber = parentFiber.sibling); + } + function disappearLayoutEffects(finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout + ); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 1: + safelyDetachRef(finishedWork, finishedWork.return); + var instance = finishedWork.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 27: + case 5: + safelyDetachRef(finishedWork, finishedWork.return); + (5 !== finishedWork.tag && 27 !== finishedWork.tag) || + commitFragmentInstanceDeletionEffects(finishedWork); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 6: + commitFragmentInstanceDeletionEffects(finishedWork); + break; + case 26: + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 30: + finishedWork.flags & 18874368 && + untrackNamedViewTransition(finishedWork); + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 7: + safelyDetachRef(finishedWork, finishedWork.return); + default: + recursivelyTraverseDisappearLayoutEffects(finishedWork); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } - function completeRootWhenReady( - root, + function recursivelyTraverseDisappearLayoutEffects(parentFiber) { + for (parentFiber = parentFiber.child; null !== parentFiber; ) + disappearLayoutEffects(parentFiber), + (parentFiber = parentFiber.sibling); + } + function reappearLayoutEffects( + finishedRoot, + current, finishedWork, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + layoutEffectTraversalFlags ) { - root.timeoutHandle = noTimeout; - var subtreeFlags = finishedWork.subtreeFlags, - isViewTransitionEligible = (lanes & 335544064) === lanes, - suspendedState = null; - if ( - isViewTransitionEligible || - subtreeFlags & 8192 || - 16785408 === (subtreeFlags & 16785408) - ) - (appearingViewTransitions = suspendedState = null), - accumulateSuspenseyCommitOnFiber(finishedWork), - isViewTransitionEligible && - null != fabricSuspendOnActiveViewTransition && - fabricSuspendOnActiveViewTransition(), - (lanes & 62914560) === lanes - ? globalMostRecentFallbackTime - now$1() - : (lanes & 4194048) === lanes - ? globalMostRecentTransitionTime - now$1() - : 0; - completeRoot$1( - root, - finishedWork, - lanes, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedState, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } - function isRenderConsistentWithExternalStores(finishedWork) { - for (var node = finishedWork; ; ) { - var tag = node.tag; - if ( - (0 === tag || 11 === tag || 15 === tag) && - node.flags & 16384 && - ((tag = node.updateQueue), - null !== tag && ((tag = tag.stores), null !== tag)) - ) - for (var i = 0; i < tag.length; i++) { - var check = tag[i], - getSnapshot = check.getSnapshot; - check = check.value; + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + flags = finishedWork.flags, + includeWorkInProgressEffects = + (layoutEffectTraversalFlags & IncludeWorkInProgressEffects) !== + NoLayoutEffectTraversalFlags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + commitHookLayoutEffects(finishedWork, Layout); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - if (!objectIs(getSnapshot(), check)) return !1; + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { - return !1; + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } - tag = node.child; - if (node.subtreeFlags & 16384 && null !== tag) - (tag.return = node), (node = tag); - else { - if (node === finishedWork) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === finishedWork) return !0; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 27: + case 5: + (5 !== finishedWork.tag && 27 !== finishedWork.tag) || + commitFragmentInstanceInsertionEffects(finishedWork); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 6: + commitFragmentInstanceInsertionEffects(finishedWork); + break; + case 26: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + if (includeWorkInProgressEffects && flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + includeWorkInProgressEffects = finishedWork.stateNode; + includeWorkInProgressEffects.effectDuration += + bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + includeWorkInProgressEffects.effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } else + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + break; + case 31: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + break; + case 13: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 30: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + flags & 18874368 && trackNamedViewTransition(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 7: + safelyAttachRef(finishedWork, finishedWork.return); + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); } - return !0; + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didAttemptEntireTree + function recursivelyTraverseReappearLayoutEffects( + finishedRoot, + parentFiber, + layoutEffectTraversalFlags ) { - suspendedLanes = getEntangledLanes(root, suspendedLanes); - suspendedLanes &= ~workInProgressRootPingedLanes; - suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; - root.suspendedLanes |= suspendedLanes; - root.pingedLanes &= ~suspendedLanes; - didAttemptEntireTree && (root.warmLanes |= suspendedLanes); - didAttemptEntireTree = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index = 31 - clz32(lanes), - lane = 1 << index; - didAttemptEntireTree[index] = -1; - lanes &= ~lane; - } - 0 !== spawnedLane && - markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); + layoutEffectTraversalFlags = + 0 !== (parentFiber.subtreeFlags & 8772) + ? layoutEffectTraversalFlags + : layoutEffectTraversalFlags & ~IncludeWorkInProgressEffects; + for (parentFiber = parentFiber.child; null !== parentFiber; ) + reappearLayoutEffects( + finishedRoot, + parentFiber.alternate, + parentFiber, + layoutEffectTraversalFlags + ), + (parentFiber = parentFiber.sibling); } - function flushSyncWork() { - return (executionContext & (RenderContext | CommitContext)) === NoContext - ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) - : !0; + function commitOffscreenPassiveMountEffects(current, finishedWork) { + var previousCache = null; + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (previousCache = current.memoizedState.cachePool.pool); + current = null; + null !== finishedWork.memoizedState && + null !== finishedWork.memoizedState.cachePool && + (current = finishedWork.memoizedState.cachePool.pool); + current !== previousCache && + (null != current && retainCache(current), + null != previousCache && releaseCache(previousCache)); } - function resetWorkInProgressStack() { - if (null !== workInProgress) { - if (workInProgressSuspendedReason === NotSuspended) - var interruptedWork = workInProgress.return; - else - (interruptedWork = workInProgress), - resetContextDependencies(), - resetHooksOnUnwind(interruptedWork), - (thenableState$1 = null), - (thenableIndexCounter$1 = 0), - (interruptedWork = workInProgress); - for (; null !== interruptedWork; ) - unwindInterruptedWork(interruptedWork.alternate, interruptedWork), - (interruptedWork = interruptedWork.return); - workInProgress = null; - } + function commitCachePassiveMountEffect(current, finishedWork) { + current = null; + null !== finishedWork.alternate && + (current = finishedWork.alternate.memoizedState.cache); + finishedWork = finishedWork.memoizedState.cache; + finishedWork !== current && + (retainCache(finishedWork), null != current && releaseCache(current)); } - function finalizeRender(lanes, finalizationTime) { - 0 !== (lanes & 127) && (blockingClampTime = finalizationTime); - 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); - 0 !== (lanes & 62914560) && (retryClampTime = finalizationTime); - 0 !== (lanes & 2080374784) && (idleClampTime = finalizationTime); + function recursivelyTraversePassiveMountEffects( + root, + parentFiber, + committedLanes, + committedTransitions, + endTime + ) { + if ( + parentFiber.subtreeFlags & + ((committedLanes & 335544064) === committedLanes ? 10262 : 10256) || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child)) + ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; + commitPassiveMountOnFiber( + root, + parentFiber, + committedLanes, + committedTransitions, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } } - function prepareFreshStack(root, lanes) { - supportsUserTiming && - (console.timeStamp( - "Blocking Track", - 0.003, - 0.003, - "Blocking", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Transition Track", - 0.003, - 0.003, - "Transition", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Suspense Track", - 0.003, - 0.003, - "Suspense", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Idle Track", - 0.003, - 0.003, - "Idle", - "Scheduler \u269b", - "primary-light" - )); - var previousRenderStartTime = renderStartTime; - renderStartTime = now(); - if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) { - setCurrentTrackFromLanes(workInProgressRootRenderLanes); - if ( - workInProgressRootExitStatus === RootSuspended || - workInProgressRootExitStatus === RootSuspendedWithDelay - ) - logSuspendedRenderPhase( - previousRenderStartTime, - renderStartTime, - lanes, - workInProgressUpdateTask + function commitPassiveMountOnFiber( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + prevDeepEquality = alreadyWarnedForDeepEquality, + isViewTransitionEligible = + (committedLanes & 335544064) === committedLanes; + isViewTransitionEligible && + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + restoreEnterOrExitViewTransitions(finishedWork); + var flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + 0 !== (finishedWork.mode & 2) && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree, + committedLanes + ); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime ); - else { - var endTime = renderStartTime, - debugTask = workInProgressUpdateTask; - if (supportsUserTiming && !(endTime <= previousRenderStartTime)) { - var color = - (lanes & 738197653) === lanes - ? "tertiary-dark" - : "primary-dark", - label = - (lanes & 536870912) === lanes - ? "Prewarm" - : (lanes & 201326741) === lanes - ? "Interrupted Hydration" - : "Interrupted Render"; - debugTask - ? debugTask.run( - console.timeStamp.bind( - console, - label, - previousRenderStartTime, - endTime, - currentTrack, - "Scheduler \u269b", - color - ) + flags & 2048 && + commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); + break; + case 1: + 0 !== (finishedWork.mode & 2) && + 0 < finishedWork.actualStartTime && + (0 !== (finishedWork.flags & 128) + ? logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime, + [] ) - : console.timeStamp( - label, - previousRenderStartTime, + : 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, endTime, - currentTrack, - "Scheduler \u269b", - color - ); - } - } - finalizeRender(workInProgressRootRenderLanes, renderStartTime); - } - previousRenderStartTime = workInProgressUpdateTask; - workInProgressUpdateTask = null; - if (0 !== (lanes & 127)) { - workInProgressUpdateTask = blockingUpdateTask; - debugTask = - 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime - ? blockingClampTime - : blockingUpdateTime; - endTime = - 0 <= blockingEventTime && blockingEventTime < blockingClampTime - ? blockingClampTime - : blockingEventTime; - color = - 0 <= endTime ? endTime : 0 <= debugTask ? debugTask : renderStartTime; - 0 <= blockingSuspendedTime - ? (setCurrentTrackFromLanes(2), - logSuspendedWithDelayPhase( - blockingSuspendedTime, - color, - lanes, - previousRenderStartTime - )) - : 0 !== (animatingLanes & 127) && - (setCurrentTrackFromLanes(2), - logAnimatingPhase(blockingClampTime, color, animatingTask)); - previousRenderStartTime = debugTask; - var eventTime = endTime, - eventType = blockingEventType, - eventIsRepeat = 0 < blockingEventRepeatTime, - isSpawnedUpdate = 1 === blockingUpdateType, - isPingedUpdate = 2 === blockingUpdateType; - debugTask = renderStartTime; - endTime = blockingUpdateTask; - color = blockingUpdateMethodName; - label = blockingUpdateComponentName; - if (supportsUserTiming) { - currentTrack = "Blocking"; - 0 < previousRenderStartTime - ? previousRenderStartTime > debugTask && - (previousRenderStartTime = debugTask) - : (previousRenderStartTime = debugTask); - 0 < eventTime - ? eventTime > previousRenderStartTime && - (eventTime = previousRenderStartTime) - : (eventTime = previousRenderStartTime); - if (null !== eventType && previousRenderStartTime > eventTime) { - var color$jscomp$0 = eventIsRepeat ? "secondary-light" : "warning"; + inHydratedSubtree, + committedLanes + )); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, endTime - ? endTime.run( - console.timeStamp.bind( - console, - eventIsRepeat ? "Consecutive" : "Event: " + eventType, - eventTime, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - color$jscomp$0 - ) - ) - : console.timeStamp( - eventIsRepeat ? "Consecutive" : "Event: " + eventType, - eventTime, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - color$jscomp$0 - ); - } - debugTask > previousRenderStartTime && - ((eventTime = isSpawnedUpdate - ? "error" - : (lanes & 738197653) === lanes - ? "tertiary-light" - : "primary-light"), - (isSpawnedUpdate = isPingedUpdate - ? "Promise Resolved" - : isSpawnedUpdate - ? "Cascading Update" - : 5 < debugTask - previousRenderStartTime - ? "Update Blocked" - : "Update"), - (isPingedUpdate = []), - null != label && isPingedUpdate.push(["Component name", label]), - null != color && isPingedUpdate.push(["Method name", color]), - (previousRenderStartTime = { - start: previousRenderStartTime, - end: debugTask, - detail: { - devtools: { - properties: isPingedUpdate, - track: currentTrack, - trackGroup: "Scheduler \u269b", - color: eventTime - } - } - }), + ); + break; + case 3: + var prevProfilerEffectDuration = pushNestedEffectDurations(); + isViewTransitionEligible = inHydratedSubtree; + inHydratedSubtree = + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, endTime - ? endTime.run( - performance.measure.bind( - performance, - isSpawnedUpdate, - previousRenderStartTime - ) - ) - : performance.measure(isSpawnedUpdate, previousRenderStartTime), - performance.clearMeasures(isSpawnedUpdate)); - } - blockingUpdateTime = -1.1; - blockingUpdateType = 0; - blockingUpdateComponentName = blockingUpdateMethodName = null; - blockingSuspendedTime = -1.1; - blockingEventRepeatTime = blockingEventTime; - blockingEventTime = -1.1; - blockingClampTime = now(); - } - 0 !== (lanes & 4194048) && - ((workInProgressUpdateTask = transitionUpdateTask), - (debugTask = - 0 <= transitionStartTime && transitionStartTime < transitionClampTime - ? transitionClampTime - : transitionStartTime), - (previousRenderStartTime = - 0 <= transitionUpdateTime && - transitionUpdateTime < transitionClampTime - ? transitionClampTime - : transitionUpdateTime), - (endTime = - 0 <= transitionEventTime && transitionEventTime < transitionClampTime - ? transitionClampTime - : transitionEventTime), - (color = - 0 <= endTime - ? endTime - : 0 <= previousRenderStartTime - ? previousRenderStartTime - : renderStartTime), - 0 <= transitionSuspendedTime - ? (setCurrentTrackFromLanes(256), - logSuspendedWithDelayPhase( - transitionSuspendedTime, - color, - lanes, - workInProgressUpdateTask - )) - : 0 !== (animatingLanes & 4194048) && - (setCurrentTrackFromLanes(256), - logAnimatingPhase(transitionClampTime, color, animatingTask)), - (isPingedUpdate = endTime), - (eventTime = transitionEventType), - (eventType = 0 < transitionEventRepeatTime), - (eventIsRepeat = 2 === transitionUpdateType), - (color = renderStartTime), - (endTime = transitionUpdateTask), - (label = transitionUpdateMethodName), - (isSpawnedUpdate = transitionUpdateComponentName), - supportsUserTiming && - ((currentTrack = "Transition"), - 0 < previousRenderStartTime - ? previousRenderStartTime > color && - (previousRenderStartTime = color) - : (previousRenderStartTime = color), - 0 < debugTask - ? debugTask > previousRenderStartTime && - (debugTask = previousRenderStartTime) - : (debugTask = previousRenderStartTime), - 0 < isPingedUpdate - ? isPingedUpdate > debugTask && (isPingedUpdate = debugTask) - : (isPingedUpdate = debugTask), - debugTask > isPingedUpdate && - null !== eventTime && - ((color$jscomp$0 = eventType ? "secondary-light" : "warning"), + ); + inHydratedSubtree = isViewTransitionEligible; + flags & 2048 && + ((committedLanes = null), + null !== finishedWork.alternate && + (committedLanes = finishedWork.alternate.memoizedState.cache), + (committedTransitions = finishedWork.memoizedState.cache), + committedTransitions !== committedLanes && + (retainCache(committedTransitions), + null != committedLanes && releaseCache(committedLanes))); + finishedRoot.passiveEffectDuration += popNestedEffectDurations( + prevProfilerEffectDuration + ); + break; + case 12: + if (flags & 2048) { + flags = pushNestedEffectDurations(); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + finishedRoot = finishedWork.stateNode; + finishedRoot.passiveEffectDuration += + bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + finishedWork.alternate, + commitStartTime, + finishedRoot.passiveEffectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } else + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + break; + case 31: + flags = inHydratedSubtree; + prevProfilerEffectDuration = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + isViewTransitionEligible = finishedWork.memoizedState; + null !== prevProfilerEffectDuration && + null === isViewTransitionEligible + ? ((isViewTransitionEligible = finishedWork.deletions), + null !== isViewTransitionEligible && + 0 < isViewTransitionEligible.length && + 18 === isViewTransitionEligible[0].tag + ? ((inHydratedSubtree = !1), + (prevProfilerEffectDuration = + prevProfilerEffectDuration.hydrationErrors), + null !== prevProfilerEffectDuration && + logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime, + prevProfilerEffectDuration + )) + : (inHydratedSubtree = !0)) + : (inHydratedSubtree = !1); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, endTime - ? endTime.run( - console.timeStamp.bind( - console, - eventType ? "Consecutive" : "Event: " + eventTime, - isPingedUpdate, - debugTask, - currentTrack, - "Scheduler \u269b", - color$jscomp$0 - ) - ) - : console.timeStamp( - eventType ? "Consecutive" : "Event: " + eventTime, - isPingedUpdate, - debugTask, - currentTrack, - "Scheduler \u269b", - color$jscomp$0 - )), - previousRenderStartTime > debugTask && - (endTime - ? endTime.run( - console.timeStamp.bind( - console, - "Action", - debugTask, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - "primary-dark" - ) - ) - : console.timeStamp( - "Action", - debugTask, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - "primary-dark" - )), - color > previousRenderStartTime && - ((debugTask = eventIsRepeat - ? "Promise Resolved" - : 5 < color - previousRenderStartTime - ? "Update Blocked" - : "Update"), - (isPingedUpdate = []), - null != isSpawnedUpdate && - isPingedUpdate.push(["Component name", isSpawnedUpdate]), - null != label && isPingedUpdate.push(["Method name", label]), - (previousRenderStartTime = { - start: previousRenderStartTime, - end: color, - detail: { - devtools: { - properties: isPingedUpdate, - track: currentTrack, - trackGroup: "Scheduler \u269b", - color: "primary-light" - } - } - }), + ); + inHydratedSubtree = flags; + break; + case 13: + flags = inHydratedSubtree; + prevProfilerEffectDuration = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + isViewTransitionEligible = finishedWork.memoizedState; + null === prevProfilerEffectDuration || + null === prevProfilerEffectDuration.dehydrated || + (null !== isViewTransitionEligible && + null !== isViewTransitionEligible.dehydrated) + ? (inHydratedSubtree = !1) + : ((isViewTransitionEligible = finishedWork.deletions), + null !== isViewTransitionEligible && + 0 < isViewTransitionEligible.length && + 18 === isViewTransitionEligible[0].tag + ? ((inHydratedSubtree = !1), + (prevProfilerEffectDuration = + prevProfilerEffectDuration.hydrationErrors), + null !== prevProfilerEffectDuration && + logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime, + prevProfilerEffectDuration + )) + : (inHydratedSubtree = !0)); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, endTime - ? endTime.run( - performance.measure.bind( - performance, - debugTask, - previousRenderStartTime + ); + inHydratedSubtree = flags; + break; + case 23: + break; + case 22: + var _instance3 = finishedWork.stateNode; + prevProfilerEffectDuration = finishedWork.alternate; + null !== finishedWork.memoizedState + ? (isViewTransitionEligible && + null !== prevProfilerEffectDuration && + null === prevProfilerEffectDuration.memoizedState && + restoreEnterOrExitViewTransitions(prevProfilerEffectDuration), + _instance3._visibility & OffscreenPassiveEffectsConnected + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime ) - ) - : performance.measure(debugTask, previousRenderStartTime), - performance.clearMeasures(debugTask))), - (transitionUpdateTime = transitionStartTime = -1.1), - (transitionUpdateType = 0), - (transitionSuspendedTime = -1.1), - (transitionEventRepeatTime = transitionEventTime), - (transitionEventTime = -1.1), - (transitionClampTime = now())); - 0 !== (lanes & 62914560) && - 0 !== (animatingLanes & 62914560) && - (setCurrentTrackFromLanes(4194304), - logAnimatingPhase(retryClampTime, renderStartTime, animatingTask)); - 0 !== (lanes & 2080374784) && - 0 !== (animatingLanes & 2080374784) && - (setCurrentTrackFromLanes(268435456), - logAnimatingPhase(idleClampTime, renderStartTime, animatingTask)); - previousRenderStartTime = root.timeoutHandle; - previousRenderStartTime !== noTimeout && - ((root.timeoutHandle = noTimeout), - cancelTimeout(previousRenderStartTime)); - previousRenderStartTime = root.cancelPendingCommit; - null !== previousRenderStartTime && - ((root.cancelPendingCommit = null), previousRenderStartTime()); - pendingEffectsLanes = 0; - resetWorkInProgressStack(); - workInProgressRoot = root; - workInProgress = previousRenderStartTime = createWorkInProgress( - root.current, - null - ); - workInProgressRootRenderLanes = lanes; - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; - workInProgressRootExitStatus = RootInProgress; - workInProgressSuspendedRetryLanes = - workInProgressDeferredLane = - workInProgressRootPingedLanes = - workInProgressRootInterleavedUpdatedLanes = - workInProgressRootSkippedLanes = - 0; - workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = - null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - entangledRenderLanes = getEntangledLanes(root, lanes); - finishQueueingConcurrentUpdates(); - root = getCurrentTime(); - 1e3 < root - lastResetTime && - ((ReactSharedInternals.recentlyCreatedOwnerStacks = 0), - (lastResetTime = root)); - ReactStrictModeWarnings.discardPendingWarnings(); - return previousRenderStartTime; - } - function handleThrow(root, thrownValue) { - currentlyRenderingFiber = null; - ReactSharedInternals.H = ContextOnlyDispatcher; - ReactSharedInternals.getCurrentStack = null; - isRendering = !1; - current = null; - thrownValue === SuspenseException || - thrownValue === SuspenseActionException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = SuspendedOnImmediate)) - : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = SuspendedOnInstance)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? SuspendedOnHydration - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); - workInProgressThrownValue = thrownValue; - var erroredWork = workInProgress; - null === erroredWork - ? ((workInProgressRootExitStatus = RootFatalErrored), - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - )) - : erroredWork.mode & 2 && - stopProfilerTimerIfRunningAndRecordDuration(erroredWork); - } - function pushDispatcher() { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = ContextOnlyDispatcher; - return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; - } - function pushAsyncDispatcher() { - var prevAsyncDispatcher = ReactSharedInternals.A; - ReactSharedInternals.A = DefaultAsyncDispatcher; - return prevAsyncDispatcher; - } - function markRenderDerivedCause(fiber) { - null === workInProgressUpdateTask && - (workInProgressUpdateTask = - null == fiber._debugTask ? null : fiber._debugTask); + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + )) + : (isViewTransitionEligible && + null !== prevProfilerEffectDuration && + null !== prevProfilerEffectDuration.memoizedState && + restoreEnterOrExitViewTransitions(finishedWork), + _instance3._visibility & OffscreenPassiveEffectsConnected + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) + : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) || + (0 !== finishedWork.actualDuration && + (null === finishedWork.alternate || + finishedWork.alternate.child !== finishedWork.child)), + endTime + ), + 0 === (finishedWork.mode & 2) || + inHydratedSubtree || + ((finishedRoot = finishedWork.actualStartTime), + 0 <= finishedRoot && + 0.05 < endTime - finishedRoot && + logComponentReappeared( + finishedWork, + finishedRoot, + endTime + ), + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < + componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + )))); + flags & 2048 && + commitOffscreenPassiveMountEffects( + prevProfilerEffectDuration, + finishedWork + ); + break; + case 24: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + case 30: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + break; + default: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + } + if (0 !== (finishedWork.mode & 2)) { + if ( + (finishedRoot = + !inHydratedSubtree && + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate) + ) + (committedLanes = finishedWork.actualStartTime), + 0 <= committedLanes && + 0.05 < endTime - committedLanes && + logComponentTrigger( + finishedWork, + committedLanes, + endTime, + "Mount" + ); + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ), + finishedRoot && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Mount" + )); + } + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + alreadyWarnedForDeepEquality = prevDeepEquality; } - function renderDidSuspendDelayIfPossible() { - workInProgressRootExitStatus = RootSuspendedWithDelay; - workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194048) !== - workInProgressRootRenderLanes && - null !== suspenseHandlerStackCursor.current) || - (workInProgressRootIsPrerendering = !0); - (0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || - null === workInProgressRoot || - markRootSuspended( - workInProgressRoot, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 + function recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + parentFiber, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ) { + includeWorkInProgressEffects = + includeWorkInProgressEffects && + (0 !== (parentFiber.subtreeFlags & 10256) || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child))); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; + reconnectPassiveEffects( + finishedRoot, + parentFiber, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + null !== nextSibling ? nextSibling.actualStartTime : endTime ); - } - function renderRootSync(root, lanes, shouldYieldForPrerendering) { - var prevExecutionContext = executionContext; - executionContext |= RenderContext; - var prevDispatcher = pushDispatcher(), - prevAsyncDispatcher = pushAsyncDispatcher(); - if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== lanes - ) { - if (isDevToolsPresent) { - var memoizedUpdaters = root.memoizedUpdaters; - 0 < memoizedUpdaters.size && - (restorePendingUpdaters(root, workInProgressRootRenderLanes), - memoizedUpdaters.clear()); - movePendingFibersToMemoized(root, lanes); - } - workInProgressTransitions = null; - prepareFreshStack(root, lanes); + parentFiber = nextSibling; } - lanes = !1; - memoizedUpdaters = workInProgressRootExitStatus; - a: do - try { - if ( - workInProgressSuspendedReason !== NotSuspended && - null !== workInProgress - ) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; - switch (workInProgressSuspendedReason) { - case SuspendedOnHydration: - resetWorkInProgressStack(); - memoizedUpdaters = RootSuspendedAtTheShell; - break a; - case SuspendedOnImmediate: - case SuspendedOnData: - case SuspendedOnAction: - case SuspendedOnDeprecatedThrowPromise: - null === suspenseHandlerStackCursor.current && (lanes = !0); - var reason = workInProgressSuspendedReason; - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - if ( - shouldYieldForPrerendering && - workInProgressRootIsPrerendering - ) { - memoizedUpdaters = RootInProgress; - break a; - } - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - } - } - workLoopSync(); - memoizedUpdaters = workInProgressRootExitStatus; + } + function reconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + prevDeepEquality = alreadyWarnedForDeepEquality; + includeWorkInProgressEffects && + 0 !== (finishedWork.mode & 2) && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree, + committedLanes + ); + var flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ); + commitHookPassiveMountEffects(finishedWork, Passive); break; - } catch (thrownValue$5) { - handleThrow(root, thrownValue$5); - } - while (1); - lanes && root.shellSuspendCounter++; - resetContextDependencies(); - executionContext = prevExecutionContext; - ReactSharedInternals.H = prevDispatcher; - ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return memoizedUpdaters; - } - function workLoopSync() { - for (; null !== workInProgress; ) performUnitOfWork(workInProgress); + case 23: + break; + case 22: + var _instance4 = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) + : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + alreadyWarnedForDeepEquality = prevDeepEquality; } - function renderRootConcurrent(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= RenderContext; - var prevDispatcher = pushDispatcher(), - prevAsyncDispatcher = pushAsyncDispatcher(); + function recursivelyTraverseAtomicPassiveEffects( + finishedRoot$jscomp$0, + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 + ) { if ( - workInProgressRoot !== root || - workInProgressRootRenderLanes !== lanes - ) { - if (isDevToolsPresent) { - var memoizedUpdaters = root.memoizedUpdaters; - 0 < memoizedUpdaters.size && - (restorePendingUpdaters(root, workInProgressRootRenderLanes), - memoizedUpdaters.clear()); - movePendingFibersToMemoized(root, lanes); - } - workInProgressTransitions = null; - workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; - prepareFreshStack(root, lanes); - } else - workInProgressRootIsPrerendering = checkIfRootIsPrerendering( - root, - lanes - ); - a: do - try { - if ( - workInProgressSuspendedReason !== NotSuspended && - null !== workInProgress - ) - b: switch ( - ((lanes = workInProgress), - (memoizedUpdaters = workInProgressThrownValue), - workInProgressSuspendedReason) - ) { - case SuspendedOnError: - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - lanes, - memoizedUpdaters, - SuspendedOnError - ); - break; - case SuspendedOnData: - case SuspendedOnAction: - if (isThenableResolved(memoizedUpdaters)) { - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - replaySuspendedUnitOfWork(lanes); - break; - } - lanes = function () { - (workInProgressSuspendedReason !== SuspendedOnData && - workInProgressSuspendedReason !== SuspendedOnAction) || - workInProgressRoot !== root || - (workInProgressSuspendedReason = - SuspendedAndReadyToContinue); - ensureRootIsScheduled(root); - }; - memoizedUpdaters.then(lanes, lanes); - break a; - case SuspendedOnImmediate: - workInProgressSuspendedReason = SuspendedAndReadyToContinue; - break a; - case SuspendedOnInstance: - workInProgressSuspendedReason = - SuspendedOnInstanceAndReadyToContinue; - break a; - case SuspendedAndReadyToContinue: - isThenableResolved(memoizedUpdaters) - ? ((workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - replaySuspendedUnitOfWork(lanes)) - : ((workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop( - root, - lanes, - memoizedUpdaters, - SuspendedAndReadyToContinue - )); - break; - case SuspendedOnInstanceAndReadyToContinue: - var resource = null; - switch (workInProgress.tag) { - case 26: - resource = workInProgress.memoizedState; - case 5: - case 27: - var hostFiber = workInProgress; - if (resource ? preloadResource(resource) : 1) { - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - var sibling = hostFiber.sibling; - if (null !== sibling) workInProgress = sibling; - else { - var returnFiber = hostFiber.return; - null !== returnFiber - ? ((workInProgress = returnFiber), - completeUnitOfWork(returnFiber)) - : (workInProgress = null); - } - break b; - } - break; - default: - console.error( - "Unexpected type of fiber triggered a suspensey commit. This is a bug in React." - ); - } - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - lanes, - memoizedUpdaters, - SuspendedOnInstanceAndReadyToContinue - ); - break; - case SuspendedOnDeprecatedThrowPromise: - workInProgressSuspendedReason = NotSuspended; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - lanes, - memoizedUpdaters, - SuspendedOnDeprecatedThrowPromise - ); - break; - case SuspendedOnHydration: - resetWorkInProgressStack(); - workInProgressRootExitStatus = RootSuspendedAtTheShell; - break a; - default: - throw Error( - "Unexpected SuspendedReason. This is a bug in React." - ); - } - null !== ReactSharedInternals.actQueue - ? workLoopSync() - : workLoopConcurrentByScheduler(); - break; - } catch (thrownValue$6) { - handleThrow(root, thrownValue$6); + parentFiber.subtreeFlags & 10256 || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child)) + ) + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; + var finishedRoot = finishedRoot$jscomp$0, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber + ? parentFiber.actualStartTime + : endTime$jscomp$0, + prevDeepEquality = alreadyWarnedForDeepEquality; + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree, + committedLanes + ); + var flags = child.flags; + switch (child.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && + commitOffscreenPassiveMountEffects(child.alternate, child); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && + commitCachePassiveMountEffect(child.alternate, child); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + } + alreadyWarnedForDeepEquality = prevDeepEquality; + child = parentFiber; } - while (1); - resetContextDependencies(); - ReactSharedInternals.H = prevDispatcher; - ReactSharedInternals.A = prevAsyncDispatcher; - executionContext = prevExecutionContext; - if (null !== workInProgress) return RootInProgress; - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; } - function workLoopConcurrentByScheduler() { - for (; null !== workInProgress && !shouldYield(); ) - performUnitOfWork(workInProgress); + function recursivelyAccumulateSuspenseyCommit(parentFiber) { + if (parentFiber.subtreeFlags & suspenseyCommitFlag) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + accumulateSuspenseyCommitOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); } - function performUnitOfWork(unitOfWork) { - var current = unitOfWork.alternate; - 0 !== (unitOfWork.mode & 2) - ? (startProfilerTimer(unitOfWork), - (current = runWithFiberInDEV( - unitOfWork, - beginWork, - current, - unitOfWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) - : (current = runWithFiberInDEV( - unitOfWork, - beginWork, - current, - unitOfWork, - entangledRenderLanes - )); - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === current - ? completeUnitOfWork(unitOfWork) - : (workInProgress = current); + function accumulateSuspenseyCommitOnFiber(fiber) { + switch (fiber.tag) { + case 26: + recursivelyAccumulateSuspenseyCommit(fiber); + fiber.flags & suspenseyCommitFlag && + null !== fiber.memoizedState && + suspendResource(); + break; + case 5: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 3: + case 4: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 22: + if (null === fiber.memoizedState) { + var current = fiber.alternate; + null !== current && null !== current.memoizedState + ? ((current = suspenseyCommitFlag), + (suspenseyCommitFlag = 16777216), + recursivelyAccumulateSuspenseyCommit(fiber), + (suspenseyCommitFlag = current)) + : recursivelyAccumulateSuspenseyCommit(fiber); + } + break; + case 30: + if ( + 0 !== (fiber.flags & suspenseyCommitFlag) && + ((current = fiber.memoizedProps.name), + null != current && "auto" !== current) + ) { + var state = fiber.stateNode; + state.paired = null; + null === appearingViewTransitions && + (appearingViewTransitions = new Map()); + appearingViewTransitions.set(current, state); + } + recursivelyAccumulateSuspenseyCommit(fiber); + break; + default: + recursivelyAccumulateSuspenseyCommit(fiber); + } } - function replaySuspendedUnitOfWork(unitOfWork) { - var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); + function detachAlternateSiblings(parentFiber) { + var previousFiber = parentFiber.alternate; + if ( + null !== previousFiber && + ((parentFiber = previousFiber.child), null !== parentFiber) + ) { + previousFiber.child = null; + do + (previousFiber = parentFiber.sibling), + (parentFiber.sibling = null), + (parentFiber = previousFiber); + while (null !== parentFiber); + } + } + function recursivelyTraversePassiveUnmountEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i], + prevEffectStart = pushComponentEffectStart(); + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber + ); + 0 !== (childToDelete.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + childToDelete, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + } + detachAlternateSiblings(parentFiber); + } + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveUnmountOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); + } + function commitPassiveUnmountOnFiber(finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.flags & 2048 && + commitHookPassiveUnmountEffects( + finishedWork, + finishedWork.return, + Passive | HasEffect + ); + break; + case 3: + var prevProfilerEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + popNestedEffectDurations(prevProfilerEffectDuration); + break; + case 12: + prevProfilerEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + bubbleNestedEffectDurations(prevProfilerEffectDuration); + break; + case 22: + prevProfilerEffectDuration = finishedWork.stateNode; + null !== finishedWork.memoizedState && + prevProfilerEffectDuration._visibility & + OffscreenPassiveEffectsConnected && + (null === finishedWork.return || 13 !== finishedWork.return.tag) + ? ((prevProfilerEffectDuration._visibility &= + ~OffscreenPassiveEffectsConnected), + recursivelyTraverseDisconnectPassiveEffects(finishedWork), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Disconnect" + )) + : recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + default: + recursivelyTraversePassiveUnmountEffects(finishedWork); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectErrors; + } + function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i], + prevEffectStart = pushComponentEffectStart(); + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber + ); + 0 !== (childToDelete.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + childToDelete, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + } + detachAlternateSiblings(parentFiber); + } + for (parentFiber = parentFiber.child; null !== parentFiber; ) + disconnectPassiveEffect(parentFiber), + (parentFiber = parentFiber.sibling); } - function replayBeginWork(unitOfWork) { - var current = unitOfWork.alternate, - isProfilingMode = 0 !== (unitOfWork.mode & 2); - isProfilingMode && startProfilerTimer(unitOfWork); - switch (unitOfWork.tag) { - case 15: + function disconnectPassiveEffect(finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (finishedWork.tag) { case 0: - current = replayFunctionComponent( - current, - unitOfWork, - unitOfWork.pendingProps, - unitOfWork.type, - void 0, - workInProgressRootRenderLanes - ); - break; case 11: - current = replayFunctionComponent( - current, - unitOfWork, - unitOfWork.pendingProps, - unitOfWork.type.render, - unitOfWork.ref, - workInProgressRootRenderLanes + case 15: + commitHookPassiveUnmountEffects( + finishedWork, + finishedWork.return, + Passive ); + recursivelyTraverseDisconnectPassiveEffects(finishedWork); + break; + case 22: + var instance = finishedWork.stateNode; + instance._visibility & OffscreenPassiveEffectsConnected && + ((instance._visibility &= ~OffscreenPassiveEffectsConnected), + recursivelyTraverseDisconnectPassiveEffects(finishedWork)); break; - case 5: - resetHooksOnUnwind(unitOfWork); default: - unwindInterruptedWork(current, unitOfWork), - (unitOfWork = workInProgress = - resetWorkInProgress(unitOfWork, entangledRenderLanes)), - (current = beginWork(current, unitOfWork, entangledRenderLanes)); + recursivelyTraverseDisconnectPassiveEffects(finishedWork); } - isProfilingMode && - stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); - return current; + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectErrors; } - function throwAndUnwindWorkLoop( - root, - unitOfWork, - thrownValue, - suspendedReason + function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + deletedSubtreeRoot, + nearestMountedAncestor$jscomp$0 ) { - resetContextDependencies(); - resetHooksOnUnwind(unitOfWork); - thenableState$1 = null; - thenableIndexCounter$1 = 0; - var returnFiber = unitOfWork.return; - try { - if ( - throwException( - root, - returnFiber, - unitOfWork, - thrownValue, - workInProgressRootRenderLanes - ) - ) { - workInProgressRootExitStatus = RootFatalErrored; - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - ); - workInProgress = null; - return; + for (; null !== nextEffect; ) { + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((nearestMountedAncestor = current.memoizedState.cachePool.pool), + null != nearestMountedAncestor && + retainCache(nearestMountedAncestor)); + break; + case 24: + releaseCache(current.memoizedState.cache); } - } catch (error) { - if (null !== returnFiber) throw ((workInProgress = returnFiber), error); - workInProgressRootExitStatus = RootFatalErrored; - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - ); - workInProgress = null; - return; + 0 !== (current.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + current, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectErrors; + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + prevEffectStart = current.sibling; + prevEffectDuration = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== prevEffectStart) { + prevEffectStart.return = prevEffectDuration; + nextEffect = prevEffectStart; + break a; + } + nextEffect = prevEffectDuration; + } } - if (unitOfWork.flags & 32768) { - if (suspendedReason === SuspendedOnError) root = !0; - else if ( - workInProgressRootIsPrerendering || - 0 !== (workInProgressRootRenderLanes & 536870912) - ) - root = !1; - else if ( - ((workInProgressRootDidSkipSuspendedSiblings = root = !0), - suspendedReason === SuspendedOnData || - suspendedReason === SuspendedOnAction || - suspendedReason === SuspendedOnImmediate || - suspendedReason === SuspendedOnDeprecatedThrowPromise) - ) - (suspendedReason = suspenseHandlerStackCursor.current), - null !== suspendedReason && - 13 === suspendedReason.tag && - (suspendedReason.flags |= 16384); - unwindUnitOfWork(unitOfWork, root); - } else completeUnitOfWork(unitOfWork); } - function completeUnitOfWork(unitOfWork) { - var completedWork = unitOfWork; - do { - if (0 !== (completedWork.flags & 32768)) { - unwindUnitOfWork( - completedWork, - workInProgressRootDidSkipSuspendedSiblings - ); - return; - } - var current = completedWork.alternate; - unitOfWork = completedWork.return; - startProfilerTimer(completedWork); - current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes + function isConcurrentActEnvironment() { + var isReactActEnvironmentGlobal = + "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT + ? IS_REACT_ACT_ENVIRONMENT + : void 0; + isReactActEnvironmentGlobal || + null === ReactSharedInternals.actQueue || + console.error( + "The current testing environment is not configured to support act(...)" ); - 0 !== (completedWork.mode & 2) && - stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); - if (null !== current) { - workInProgress = current; - return; - } - completedWork = completedWork.sibling; - if (null !== completedWork) { - workInProgress = completedWork; - return; - } - workInProgress = completedWork = unitOfWork; - } while (null !== completedWork); - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootCompleted); + return isReactActEnvironmentGlobal; } - function unwindUnitOfWork(unitOfWork, skipSiblings) { - do { - var next = unwindWork(unitOfWork.alternate, unitOfWork); - if (null !== next) { - next.flags &= 32767; - workInProgress = next; - return; - } - if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); - next = unitOfWork.actualDuration; - for (var child = unitOfWork.child; null !== child; ) - (next += child.actualDuration), (child = child.sibling); - unitOfWork.actualDuration = next; - } - next = unitOfWork.return; - null !== next && - ((next.flags |= 32768), - (next.subtreeFlags = 0), - (next.deletions = null)); - if ( - !skipSiblings && - ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) - ) { - workInProgress = unitOfWork; - return; + function requestUpdateLane(fiber) { + if ( + (executionContext & RenderContext) !== NoContext && + 0 !== workInProgressRootRenderLanes + ) + return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + var transition = ReactSharedInternals.T; + return null !== transition + ? (transition._updatedFibers || (transition._updatedFibers = new Set()), + transition._updatedFibers.add(fiber), + requestTransitionLane()) + : resolveUpdatePriority(); + } + function requestDeferredLane() { + if (0 === workInProgressDeferredLane) + if (0 !== (workInProgressRootRenderLanes & 536870912)) + workInProgressDeferredLane = 536870912; + else { + var lane = nextTransitionDeferredLane; + nextTransitionDeferredLane <<= 1; + 0 === (nextTransitionDeferredLane & 3932160) && + (nextTransitionDeferredLane = 262144); + workInProgressDeferredLane = lane; } - workInProgress = unitOfWork = next; - } while (null !== unitOfWork); - workInProgressRootExitStatus = RootSuspendedAtTheShell; - workInProgress = null; + lane = suspenseHandlerStackCursor.current; + null !== lane && (lane.flags |= 32); + return workInProgressDeferredLane; } - function completeRoot$1( - root, - finishedWork, - lanes, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedState, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - root.cancelPendingCommit = null; - do flushPendingEffects(); - while (pendingEffectsStatus !== NO_PENDING_EFFECTS); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - setCurrentTrackFromLanes(lanes); - if (exitStatus === RootErrored) - logErroredRenderPhase( - completedRenderStartTime, - completedRenderEndTime, - lanes, - workInProgressUpdateTask - ); - else if (null !== recoverableErrors) { - if ( - ((didSkipSuspendedSiblings = - null !== finishedWork && - null !== finishedWork.alternate && - finishedWork.alternate.memoizedState.isDehydrated && - 0 !== (finishedWork.flags & 256)), - (didIncludeRenderPhaseUpdate = workInProgressUpdateTask), - supportsUserTiming && - !(completedRenderEndTime <= completedRenderStartTime)) - ) { - exitStatus = []; - for (var i = 0; i < recoverableErrors.length; i++) { - var error = recoverableErrors[i].value; - exitStatus.push([ - "Recoverable Error", - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error) - ]); + function scheduleViewTransitionEvent(fiber, callback) { + if (null != callback) { + var state = fiber.stateNode, + instance = state.ref; + null === instance && + (instance = state.ref = + createViewTransitionInstance( + getViewTransitionName(fiber.memoizedProps, state) + )); + null === pendingViewTransitionEvents && + (pendingViewTransitionEvents = []); + pendingViewTransitionEvents.push(callback.bind(null, instance)); + } + } + function scheduleUpdateOnFiber(root, fiber, lane) { + isRunningInsertionEffect && + console.error("useInsertionEffect must not schedule updates."); + isFlushingPassiveEffects && (didScheduleUpdateDuringPassiveEffects = !0); + if ( + (root === workInProgressRoot && + (workInProgressSuspendedReason === SuspendedOnData || + workInProgressSuspendedReason === SuspendedOnAction)) || + null !== root.cancelPendingCommit + ) + prepareFreshStack(root, 0), + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 + ); + markRootUpdated$1(root, lane); + if ( + (executionContext & RenderContext) !== NoContext && + root === workInProgressRoot + ) { + if (isRendering) + switch (fiber.tag) { + case 0: + case 11: + case 15: + root = + (workInProgress && getComponentNameFromFiber(workInProgress)) || + "Unknown"; + didWarnAboutUpdateInRenderForAnotherComponent.has(root) || + (didWarnAboutUpdateInRenderForAnotherComponent.add(root), + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), + console.error( + "Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render", + fiber, + root, + root + )); + break; + case 1: + didWarnAboutUpdateInRender || + (console.error( + "Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state." + ), + (didWarnAboutUpdateInRender = !0)); } - completedRenderStartTime = { - start: completedRenderStartTime, - end: completedRenderEndTime, - detail: { - devtools: { - color: "primary-dark", - track: currentTrack, - trackGroup: "Scheduler \u269b", - tooltipText: didSkipSuspendedSiblings - ? "Hydration Failed" - : "Recovered after Error", - properties: exitStatus - } - } - }; - didIncludeRenderPhaseUpdate - ? didIncludeRenderPhaseUpdate.run( - performance.measure.bind( - performance, - "Recovered", - completedRenderStartTime - ) - ) - : performance.measure("Recovered", completedRenderStartTime); - performance.clearMeasures("Recovered"); - } } else - (didIncludeRenderPhaseUpdate = workInProgressUpdateTask), - !supportsUserTiming || - completedRenderEndTime <= completedRenderStartTime || - ((didSkipSuspendedSiblings = - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), - (exitStatus = - (lanes & 536870912) === lanes - ? "Prepared" - : (lanes & 201326741) === lanes - ? "Hydrated" - : "Render"), - didIncludeRenderPhaseUpdate - ? didIncludeRenderPhaseUpdate.run( - console.timeStamp.bind( - console, - exitStatus, - completedRenderStartTime, - completedRenderEndTime, - currentTrack, - "Scheduler \u269b", - didSkipSuspendedSiblings + isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), + warnIfUpdatesNotWrappedWithActDEV(fiber), + root === workInProgressRoot && + ((executionContext & RenderContext) === NoContext && + (workInProgressRootInterleavedUpdatedLanes |= lane), + workInProgressRootExitStatus === RootSuspendedWithDelay && + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 + )), + ensureRootIsScheduled(root); + } + function performWorkOnRoot(root, lanes, forceSync) { + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { + var yieldedFiber = workInProgress, + yieldEndTime = now$1(); + switch (yieldReason) { + case SuspendedOnImmediate: + case SuspendedOnData: + var startTime = yieldStartTime; + supportsUserTiming && + ((yieldedFiber = yieldedFiber._debugTask) + ? yieldedFiber.run( + console.timeStamp.bind( + console, + "Suspended", + startTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + ) + ) + : console.timeStamp( + "Suspended", + startTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + )); + break; + case SuspendedOnAction: + startTime = yieldStartTime; + supportsUserTiming && + ((yieldedFiber = yieldedFiber._debugTask) + ? yieldedFiber.run( + console.timeStamp.bind( + console, + "Action", + startTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + ) ) - ) - : console.timeStamp( - exitStatus, - completedRenderStartTime, - completedRenderEndTime, - currentTrack, - "Scheduler \u269b", - didSkipSuspendedSiblings + : console.timeStamp( + "Action", + startTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + )); + break; + default: + supportsUserTiming && + ((yieldedFiber = yieldEndTime - yieldStartTime), + 3 > yieldedFiber || + console.timeStamp( + "Blocked", + yieldStartTime, + yieldEndTime, + "Components \u269b", + void 0, + 5 > yieldedFiber + ? "primary-light" + : 10 > yieldedFiber + ? "primary" + : 100 > yieldedFiber + ? "primary-dark" + : "error" )); - if (null !== finishedWork) { - 0 === lanes && - console.error( - "finishedLanes should not be empty during a commit. This is a bug in React." - ); - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingDelayedCommitReason = IMMEDIATE_COMMIT; - pendingSuspendedViewTransitionReason = null; - commitRoot( - root, - finishedWork, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - suspendedState, - suspendedCommitReason, - completedRenderEndTime - ); + } } + startTime = (forceSync = + (!forceSync && + 0 === (lanes & 127) && + 0 === (lanes & root.expiredLanes)) || + checkIfRootIsPrerendering(root, lanes)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + var renderWasConcurrent = forceSync; + do { + if (startTime === RootInProgress) { + workInProgressRootIsPrerendering && + !forceSync && + markRootSuspended(root, lanes, 0, !1); + lanes = workInProgressSuspendedReason; + yieldStartTime = now(); + yieldReason = lanes; + break; + } else { + yieldedFiber = now$1(); + yieldEndTime = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(yieldEndTime) + ) { + setCurrentTrackFromLanes(lanes); + yieldEndTime = renderStartTime; + startTime = yieldedFiber; + !supportsUserTiming || + startTime <= yieldEndTime || + (workInProgressUpdateTask + ? workInProgressUpdateTask.run( + console.timeStamp.bind( + console, + "Teared Render", + yieldEndTime, + startTime, + currentTrack, + "Scheduler \u269b", + "error" + ) + ) + : console.timeStamp( + "Teared Render", + yieldEndTime, + startTime, + currentTrack, + "Scheduler \u269b", + "error" + )); + finalizeRender(lanes, yieldedFiber); + startTime = renderRootSync(root, lanes, !1); + renderWasConcurrent = !1; + continue; + } + if (startTime === RootErrored) { + var lanesThatJustErrored = lanes; + root.errorRecoveryDisabledLanes & lanesThatJustErrored + ? (renderWasConcurrent = 0) + : ((renderWasConcurrent = root.pendingLanes & -536870913), + (renderWasConcurrent = + 0 !== renderWasConcurrent + ? renderWasConcurrent + : renderWasConcurrent & 536870912 + ? 536870912 + : 0)); + if (0 !== renderWasConcurrent) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase( + renderStartTime, + yieldedFiber, + lanes, + workInProgressUpdateTask + ); + finalizeRender(lanes, yieldedFiber); + lanes = renderWasConcurrent; + a: { + yieldedFiber = root; + startTime = workInProgressRootConcurrentErrors; + renderWasConcurrent = renderRootSync( + yieldedFiber, + renderWasConcurrent, + !1 + ); + if (renderWasConcurrent === RootSuspendedAtTheShell) + yieldedFiber.errorRecoveryDisabledLanes = + yieldedFiber.errorRecoveryDisabledLanes | + lanesThatJustErrored | + workInProgressDeferredLane; + else if (renderWasConcurrent !== RootErrored) { + if (workInProgressRootDidAttachPingListener) { + yieldedFiber.errorRecoveryDisabledLanes |= + lanesThatJustErrored; + workInProgressRootInterleavedUpdatedLanes |= + lanesThatJustErrored; + startTime = RootSuspendedWithDelay; + break a; + } + yieldedFiber = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = startTime; + null !== yieldedFiber && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = yieldedFiber) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + yieldedFiber + )); + } + startTime = renderWasConcurrent; + } + renderWasConcurrent = !1; + if (startTime !== RootErrored) continue; + else yieldedFiber = now$1(); + } + } + if (startTime === RootFatalErrored) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase( + renderStartTime, + yieldedFiber, + lanes, + workInProgressUpdateTask + ); + finalizeRender(lanes, yieldedFiber); + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0, !0); + break; + } + a: { + forceSync = root; + switch (startTime) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194048) !== lanes && (lanes & 62914560) !== lanes) + break; + case RootSuspendedAtTheShell: + setCurrentTrackFromLanes(lanes); + logSuspendedRenderPhase( + renderStartTime, + yieldedFiber, + lanes, + workInProgressUpdateTask + ); + finalizeRender(lanes, yieldedFiber); + yieldEndTime = lanes; + 0 !== (yieldEndTime & 127) + ? (blockingSuspendedTime = yieldedFiber) + : 0 !== (yieldEndTime & 4194048) && + (transitionSuspendedTime = yieldedFiber); + markRootSuspended( + forceSync, + lanes, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + if (null !== ReactSharedInternals.actQueue) + completeRoot( + forceSync, + yieldEndTime, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + startTime, + null, + null, + renderStartTime, + yieldedFiber + ); + else { + if ( + (lanes & 62914560) === lanes && + startTime === RootSuspended && + ((renderWasConcurrent = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + forceSync, + lanes, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(forceSync, 0, !0)) break a; + pendingEffectsLanes = lanes; + forceSync.timeoutHandle = scheduleTimeout( + completeRootWhenReady.bind( + null, + forceSync, + yieldEndTime, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + startTime, + "Throttled", + renderStartTime, + yieldedFiber + ), + renderWasConcurrent + ); + break a; + } + completeRootWhenReady( + forceSync, + yieldEndTime, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + startTime, + null, + renderStartTime, + yieldedFiber + ); + } + } + } + break; + } while (1); + ensureRootIsScheduled(root); } - function commitRoot( + function completeRootWhenReady( root, finishedWork, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, - suspendedState, + didSkipSuspendedSiblings, + exitStatus, suspendedCommitReason, + completedRenderStartTime, completedRenderEndTime ) { - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - pendingEffectsRemainingLanes = remainingLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags, + isViewTransitionEligible = (lanes & 335544064) === lanes, + suspendedState = null; + if ( + isViewTransitionEligible || + subtreeFlags & 8192 || + 16785408 === (subtreeFlags & 16785408) + ) + (appearingViewTransitions = suspendedState = null), + accumulateSuspenseyCommitOnFiber(finishedWork), + isViewTransitionEligible && + null != fabricSuspendOnActiveViewTransition && + fabricSuspendOnActiveViewTransition(), + (lanes & 62914560) === lanes + ? globalMostRecentFallbackTime - now$1() + : (lanes & 4194048) === lanes + ? globalMostRecentTransitionTime - now$1() + : 0; + completeRoot( root, + finishedWork, lanes, - remainingLanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes - ); - pendingViewTransitionEvents = null; - (lanes & 335544064) === lanes - ? ((pendingTransitionTypes = claimQueuedTransitionTypes(root)), - (spawnedLane = 10262)) - : ((pendingTransitionTypes = null), (spawnedLane = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & spawnedLane) || - 0 !== (finishedWork.flags & spawnedLane) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback(NormalPriority$1, function () { - schedulerEvent = global.event; - pendingDelayedCommitReason === IMMEDIATE_COMMIT && - (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT); - flushPassiveEffects(); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - null !== suspendedCommitReason && - logSuspendedCommitPhase( - completedRenderEndTime, - commitStartTime, - suspendedCommitReason, - workInProgressUpdateTask - ); - shouldStartViewTransition = !1; - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - spawnedLane = executionContext; - executionContext |= CommitContext; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = spawnedLane), - (currentUpdatePriority = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); - } - } - pendingEffectsStatus = PENDING_MUTATION_PHASE; - shouldStartViewTransition - ? ((animatingLanes |= lanes), - (animatingTask = null), - (pendingViewTransition = startViewTransition( - suspendedState, - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects, - reportViewTransitionError, - suspendedViewTransition, - finishedViewTransition.bind(null, lanes) - ))) - : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); - } - function reportViewTransitionError(error) { - if (pendingEffectsStatus !== NO_PENDING_EFFECTS) { - var onRecoverableError = pendingEffectsRoot.onRecoverableError; - onRecoverableError(error, makeErrorInfo(null)); - } - } - function suspendedViewTransition(reason) { - commitEndTime = now(); - logCommitPhase( - null === pendingSuspendedCommitReason - ? pendingEffectsRenderEndTime - : commitStartTime, - commitEndTime, - commitErrors, - pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT, - workInProgressUpdateTask + suspendedRetryLanes, + didSkipSuspendedSiblings, + exitStatus, + suspendedState, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); - pendingSuspendedCommitReason = pendingSuspendedViewTransitionReason = - reason; - } - function finishedViewTransition(lanes) { - if (0 !== (animatingLanes & lanes)) { - var task = animatingTask; - animatingLanes &= ~lanes; - animatingTask = null; - 0 !== (lanes & 4194048) && - 0 === (workInProgressRootRenderLanes & 4194048) && - 0 === (pendingEffectsLanes & 4194048) && - (setCurrentTrackFromLanes(256), - logAnimatingPhase(transitionClampTime, now$1(), task)); - 0 !== (lanes & 62914560) && - 0 === (workInProgressRootRenderLanes & 62914560) && - 0 === (pendingEffectsLanes & 62914560) && - (setCurrentTrackFromLanes(4194304), - logAnimatingPhase(retryClampTime, now$1(), task)); - 0 !== (lanes & 2080374784) && - 0 === (workInProgressRootRenderLanes & 2080374784) && - 0 === (pendingEffectsLanes & 2080374784) && - (setCurrentTrackFromLanes(268435456), - logAnimatingPhase(idleClampTime, now$1(), task)); - } - } - function flushAfterMutationEffects() { - pendingEffectsStatus === PENDING_AFTER_MUTATION_PHASE && - ((pendingEffectsStatus = NO_PENDING_EFFECTS), - commitAfterMutationEffectsOnFiber( - pendingFinishedWork, - pendingEffectsRoot - ), - (pendingEffectsStatus = PENDING_SPAWNED_WORK)); } - function flushMutationEffects() { - if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { - pendingEffectsStatus = NO_PENDING_EFFECTS; - var root = pendingEffectsRoot, - finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork; ; ) { + var tag = node.tag; if ( - 0 !== (finishedWork.subtreeFlags & 13878) || - rootMutationHasEffect - ) { - rootMutationHasEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var previousPriority = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - try { - (inProgressLanes = lanes), - (inProgressRoot = root), - (inUpdateViewTransition = rootViewTransitionAffected = !1), - resetComponentEffectTimers(), - commitMutationEffectsOnFiber(finishedWork, root, lanes), - (inProgressRoot = inProgressLanes = null); - } finally { - (executionContext = prevExecutionContext), - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = rootMutationHasEffect); + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); + else { + if (node === finishedWork) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; } + node.sibling.return = node.return; + node = node.sibling; } - root.current = finishedWork; - pendingEffectsStatus = PENDING_LAYOUT_PHASE; } + return !0; } - function flushLayoutEffects() { - if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { - pendingEffectsStatus = NO_PENDING_EFFECTS; - var suspendedViewTransitionReason = - pendingSuspendedViewTransitionReason; - if (null !== suspendedViewTransitionReason) { - commitStartTime = now(); - var startTime = commitEndTime, - endTime = commitStartTime; - !supportsUserTiming || - endTime <= startTime || - (animatingTask - ? animatingTask.run( + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didAttemptEntireTree + ) { + var entangledLanes = getEntangledLanes(root, suspendedLanes), + prewarmedLanes = 0; + 0 !== (entangledLanes & 1073741824) + ? (prewarmedLanes = entangledLanes & ~(suspendedLanes | 1073741824)) + : (suspendedLanes = entangledLanes); + entangledLanes = + workInProgressRootPingedLanes | + workInProgressRootInterleavedUpdatedLanes; + suspendedLanes &= ~entangledLanes; + prewarmedLanes &= ~entangledLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + didAttemptEntireTree && + (root.warmLanes = root.warmLanes | suspendedLanes | prewarmedLanes); + didAttemptEntireTree = root.expirationTimes; + for (prewarmedLanes = suspendedLanes; 0 < prewarmedLanes; ) { + entangledLanes = 31 - clz32(prewarmedLanes); + var lane = 1 << entangledLanes; + didAttemptEntireTree[entangledLanes] = -1; + prewarmedLanes &= ~lane; + } + 0 !== spawnedLane && + 0 !== (suspendedLanes & 261930) && + markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); + } + function flushSyncWork() { + return (executionContext & (RenderContext | CommitContext)) === NoContext + ? (flushSyncWorkAcrossRoots_impl(0), !1) + : !0; + } + function resetWorkInProgressStack() { + if (null !== workInProgress) { + if (workInProgressSuspendedReason === NotSuspended) + var interruptedWork = workInProgress.return; + else + (interruptedWork = workInProgress), + resetContextDependencies(), + resetHooksOnUnwind(interruptedWork), + (thenableState$1 = null), + (thenableIndexCounter$1 = 0), + (interruptedWork = workInProgress); + for (; null !== interruptedWork; ) + unwindInterruptedWork(interruptedWork.alternate, interruptedWork), + (interruptedWork = interruptedWork.return); + workInProgress = null; + } + } + function finalizeRender(lanes, finalizationTime) { + 0 !== (lanes & 127) && (blockingClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 62914560) && (retryClampTime = finalizationTime); + 0 !== (lanes & 2080374784) && (idleClampTime = finalizationTime); + } + function prepareFreshStack(root, lanes) { + supportsUserTiming && + (console.timeStamp( + "Blocking Track", + 0.003, + 0.003, + "Blocking", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Transition Track", + 0.003, + 0.003, + "Transition", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Suspense Track", + 0.003, + 0.003, + "Suspense", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Idle Track", + 0.003, + 0.003, + "Idle", + "Scheduler \u269b", + "primary-light" + )); + var previousRenderStartTime = renderStartTime; + renderStartTime = now(); + if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) { + setCurrentTrackFromLanes(workInProgressRootRenderLanes); + if ( + workInProgressRootExitStatus === RootSuspended || + workInProgressRootExitStatus === RootSuspendedWithDelay + ) + logSuspendedRenderPhase( + previousRenderStartTime, + renderStartTime, + lanes, + workInProgressUpdateTask + ); + else { + var endTime = renderStartTime, + debugTask = workInProgressUpdateTask; + if (supportsUserTiming && !(endTime <= previousRenderStartTime)) { + var color = + (lanes & 738197653) === lanes + ? "tertiary-dark" + : "primary-dark", + label = + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326741) === lanes + ? "Interrupted Hydration" + : "Interrupted Render"; + debugTask + ? debugTask.run( console.timeStamp.bind( console, - suspendedViewTransitionReason, - startTime, + label, + previousRenderStartTime, endTime, currentTrack, "Scheduler \u269b", - "secondary-light" + color ) ) : console.timeStamp( - suspendedViewTransitionReason, - startTime, + label, + previousRenderStartTime, endTime, currentTrack, "Scheduler \u269b", - "secondary-light" - )); - } - suspendedViewTransitionReason = pendingEffectsRoot; - startTime = pendingFinishedWork; - endTime = pendingEffectsLanes; - var rootHasLayoutEffect = 0 !== (startTime.flags & 8772); - if (0 !== (startTime.subtreeFlags & 8772) || rootHasLayoutEffect) { - rootHasLayoutEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var _previousPriority = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - var _prevExecutionContext = executionContext; - executionContext |= CommitContext; - try { - (inProgressLanes = endTime), - (inProgressRoot = suspendedViewTransitionReason), - resetComponentEffectTimers(), - commitLayoutEffectOnFiber( - suspendedViewTransitionReason, - startTime.alternate, - startTime - ), - (inProgressRoot = inProgressLanes = null); - } finally { - (executionContext = _prevExecutionContext), - (currentUpdatePriority = _previousPriority), - (ReactSharedInternals.T = rootHasLayoutEffect); + color + ); } } - suspendedViewTransitionReason = pendingEffectsRenderEndTime; - startTime = pendingSuspendedCommitReason; - commitEndTime = now(); - logCommitPhase( - null === startTime ? suspendedViewTransitionReason : commitStartTime, - commitEndTime, - commitErrors, - pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT, - workInProgressUpdateTask - ); - pendingEffectsStatus = PENDING_AFTER_MUTATION_PHASE; + finalizeRender(workInProgressRootRenderLanes, renderStartTime); } - } - function flushSpawnedWork() { - if ( - pendingEffectsStatus === PENDING_SPAWNED_WORK || - pendingEffectsStatus === PENDING_AFTER_MUTATION_PHASE - ) { - if (pendingEffectsStatus === PENDING_SPAWNED_WORK) { - var startViewTransitionStartTime = commitEndTime; - commitEndTime = now(); - var endTime = commitEndTime, - abortedViewTransition = - pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT; - !supportsUserTiming || - endTime <= startViewTransitionStartTime || - (animatingTask - ? animatingTask.run( + previousRenderStartTime = workInProgressUpdateTask; + workInProgressUpdateTask = null; + if (0 !== (lanes & 127)) { + workInProgressUpdateTask = blockingUpdateTask; + debugTask = + 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime + ? blockingClampTime + : blockingUpdateTime; + endTime = + 0 <= blockingEventTime && blockingEventTime < blockingClampTime + ? blockingClampTime + : blockingEventTime; + color = + 0 <= endTime ? endTime : 0 <= debugTask ? debugTask : renderStartTime; + 0 <= blockingSuspendedTime + ? (setCurrentTrackFromLanes(2), + logSuspendedWithDelayPhase( + blockingSuspendedTime, + color, + lanes, + previousRenderStartTime + )) + : 0 !== (animatingLanes & 127) && + (setCurrentTrackFromLanes(2), + logAnimatingPhase(blockingClampTime, color, animatingTask)); + previousRenderStartTime = debugTask; + var eventTime = endTime, + eventType = blockingEventType, + eventIsRepeat = 0 < blockingEventRepeatTime, + isSpawnedUpdate = 1 === blockingUpdateType, + isPingedUpdate = 2 === blockingUpdateType; + debugTask = renderStartTime; + endTime = blockingUpdateTask; + color = blockingUpdateMethodName; + label = blockingUpdateComponentName; + if (supportsUserTiming) { + currentTrack = "Blocking"; + 0 < previousRenderStartTime + ? previousRenderStartTime > debugTask && + (previousRenderStartTime = debugTask) + : (previousRenderStartTime = debugTask); + 0 < eventTime + ? eventTime > previousRenderStartTime && + (eventTime = previousRenderStartTime) + : (eventTime = previousRenderStartTime); + if (null !== eventType && previousRenderStartTime > eventTime) { + var color$jscomp$0 = eventIsRepeat ? "secondary-light" : "warning"; + endTime + ? endTime.run( console.timeStamp.bind( console, - abortedViewTransition - ? "Interrupted View Transition" - : "Starting Animation", - startViewTransitionStartTime, - endTime, + eventIsRepeat ? "Consecutive" : "Event: " + eventType, + eventTime, + previousRenderStartTime, currentTrack, "Scheduler \u269b", - abortedViewTransition ? "error" : "secondary-light" + color$jscomp$0 ) - ) - : console.timeStamp( - abortedViewTransition - ? "Interrupted View Transition" - : "Starting Animation", - startViewTransitionStartTime, - endTime, + ) + : console.timeStamp( + eventIsRepeat ? "Consecutive" : "Event: " + eventType, + eventTime, + previousRenderStartTime, currentTrack, "Scheduler \u269b", - abortedViewTransition ? " error" : "secondary-light" - )); - pendingDelayedCommitReason !== ABORTED_VIEW_TRANSITION_COMMIT && - (pendingDelayedCommitReason = ANIMATION_STARTED_COMMIT); - } - pendingEffectsStatus = NO_PENDING_EFFECTS; - startViewTransitionStartTime = pendingViewTransition; - pendingViewTransition = null; - requestPaint(); - endTime = pendingEffectsRoot; - var finishedWork = pendingFinishedWork; - abortedViewTransition = pendingEffectsLanes; - var recoverableErrors = pendingRecoverableErrors, - passiveSubtreeMask = - (abortedViewTransition & 335544064) === abortedViewTransition - ? 10262 - : 10256; - (passiveSubtreeMask = - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || - 0 !== (finishedWork.flags & passiveSubtreeMask)) - ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) - : ((pendingEffectsStatus = NO_PENDING_EFFECTS), - (pendingFinishedWork = pendingEffectsRoot = null), - releaseRootPooledCache(endTime, endTime.pendingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - var remainingLanes = endTime.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - passiveSubtreeMask || commitDoubleInvokeEffectsInDEV(endTime, !1); - remainingLanes = lanesToEventPriority(abortedViewTransition); - finishedWork = finishedWork.stateNode; - if ( - injectedHook && - "function" === typeof injectedHook.onCommitFiberRoot - ) - try { - var didError = 128 === (finishedWork.current.flags & 128); - switch (remainingLanes) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - finishedWork, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %o", - err - )); - } - isDevToolsPresent && endTime.memoizedUpdaters.clear(); - if (null !== recoverableErrors) { - didError = ReactSharedInternals.T; - schedulerPriority = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - ReactSharedInternals.T = null; - try { - var onRecoverableError = endTime.onRecoverableError; - for ( - finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) { - var recoverableError = recoverableErrors[finishedWork], - errorInfo = makeErrorInfo(recoverableError.stack); - runWithFiberInDEV( - recoverableError.source, - onRecoverableError, - recoverableError.value, - errorInfo - ); - } - } finally { - (ReactSharedInternals.T = didError), - (currentUpdatePriority = schedulerPriority); + color$jscomp$0 + ); } + debugTask > previousRenderStartTime && + ((eventTime = isSpawnedUpdate + ? "error" + : (lanes & 738197653) === lanes + ? "tertiary-light" + : "primary-light"), + (isSpawnedUpdate = isPingedUpdate + ? "Promise Resolved" + : isSpawnedUpdate + ? "Cascading Update" + : 5 < debugTask - previousRenderStartTime + ? "Update Blocked" + : "Update"), + (isPingedUpdate = []), + null != label && isPingedUpdate.push(["Component name", label]), + null != color && isPingedUpdate.push(["Method name", color]), + (previousRenderStartTime = { + start: previousRenderStartTime, + end: debugTask, + detail: { + devtools: { + properties: isPingedUpdate, + track: currentTrack, + trackGroup: "Scheduler \u269b", + color: eventTime + } + } + }), + endTime + ? endTime.run( + performance.measure.bind( + performance, + isSpawnedUpdate, + previousRenderStartTime + ) + ) + : performance.measure(isSpawnedUpdate, previousRenderStartTime), + performance.clearMeasures(isSpawnedUpdate)); } - onRecoverableError = pendingViewTransitionEvents; - recoverableError = pendingTransitionTypes; - pendingTransitionTypes = null; - if ( - null !== onRecoverableError && - ((pendingViewTransitionEvents = null), - null === recoverableError && (recoverableError = []), - null !== startViewTransitionStartTime) - ) - for ( - errorInfo = 0; - errorInfo < onRecoverableError.length; - errorInfo++ - ) - (recoverableErrors = (0, onRecoverableError[errorInfo])( - recoverableError - )), - void 0 !== recoverableErrors && - startViewTransitionStartTime.finished.finally( - recoverableErrors - ); - 0 !== (pendingEffectsLanes & 3) && - 0 !== endTime.tag && - flushPendingEffects(); - ensureRootIsScheduled(endTime); - remainingLanes = endTime.pendingLanes; - 0 !== (abortedViewTransition & 261930) && 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - endTime === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = endTime))) - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); - passiveSubtreeMask || - finalizeRender(abortedViewTransition, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); + blockingUpdateTime = -1.1; + blockingUpdateType = 0; + blockingUpdateComponentName = blockingUpdateMethodName = null; + blockingSuspendedTime = -1.1; + blockingEventRepeatTime = blockingEventTime; + blockingEventTime = -1.1; + blockingClampTime = now(); } - } - function makeErrorInfo(componentStack) { - componentStack = { componentStack: componentStack }; - Object.defineProperty(componentStack, "digest", { - get: function () { - console.error( - 'You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.' - ); - } - }); - return componentStack; - } - function releaseRootPooledCache(root, remainingLanes) { - 0 === (root.pooledCacheLanes &= remainingLanes) && - ((remainingLanes = root.pooledCache), - null != remainingLanes && - ((root.pooledCache = null), releaseCache(remainingLanes))); - } - function flushPendingEffects() { - null !== pendingViewTransition && - (console.warn("stopViewTransition is not implemented"), - didWarnAboutInterruptedViewTransitions || - ((didWarnAboutInterruptedViewTransitions = !0), - console.warn( - "A flushSync update cancelled a View Transition because it was called while the View Transition was still preparing. To preserve the synchronous semantics, React had to skip the View Transition. If you can, try to avoid flushSync() in a scenario that's likely to interfere." - )), - (pendingViewTransition = null), - (pendingDelayedCommitReason = ABORTED_VIEW_TRANSITION_COMMIT)); - flushMutationEffects(); - flushLayoutEffects(); - flushSpawnedWork(); - return flushPassiveEffects(); - } - function flushPassiveEffects() { - if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; - var root = pendingEffectsRoot, - remainingLanes = pendingEffectsRemainingLanes; - pendingEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingEffectsLanes), - priority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - renderPriority = ReactSharedInternals.T; - var previousPriority = currentUpdatePriority; - try { - currentUpdatePriority = priority; - ReactSharedInternals.T = null; - var transitions = pendingPassiveTransitions; - pendingPassiveTransitions = null; - priority = pendingEffectsRoot; - var lanes = pendingEffectsLanes; - pendingEffectsStatus = NO_PENDING_EFFECTS; - pendingFinishedWork = pendingEffectsRoot = null; - pendingEffectsLanes = 0; - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Cannot flush passive effects while already rendering."); - setCurrentTrackFromLanes(lanes); - isFlushingPassiveEffects = !0; - didScheduleUpdateDuringPassiveEffects = !1; - var passiveEffectStartTime = 0; - commitErrors = null; - passiveEffectStartTime = now$1(); - if (pendingDelayedCommitReason === ANIMATION_STARTED_COMMIT) - logAnimatingPhase( - commitEndTime, - passiveEffectStartTime, - animatingTask - ); - else { - var startTime = commitEndTime, - endTime = passiveEffectStartTime, - delayedUntilPaint = - pendingDelayedCommitReason === DELAYED_PASSIVE_COMMIT; - !supportsUserTiming || - endTime <= startTime || - (workInProgressUpdateTask - ? workInProgressUpdateTask.run( + 0 !== (lanes & 4194048) && + ((workInProgressUpdateTask = transitionUpdateTask), + (debugTask = + 0 <= transitionStartTime && transitionStartTime < transitionClampTime + ? transitionClampTime + : transitionStartTime), + (previousRenderStartTime = + 0 <= transitionUpdateTime && + transitionUpdateTime < transitionClampTime + ? transitionClampTime + : transitionUpdateTime), + (endTime = + 0 <= transitionEventTime && transitionEventTime < transitionClampTime + ? transitionClampTime + : transitionEventTime), + (color = + 0 <= endTime + ? endTime + : 0 <= previousRenderStartTime + ? previousRenderStartTime + : renderStartTime), + 0 <= transitionSuspendedTime + ? (setCurrentTrackFromLanes(256), + logSuspendedWithDelayPhase( + transitionSuspendedTime, + color, + lanes, + workInProgressUpdateTask + )) + : 0 !== (animatingLanes & 4194048) && + (setCurrentTrackFromLanes(256), + logAnimatingPhase(transitionClampTime, color, animatingTask)), + (isPingedUpdate = endTime), + (eventTime = transitionEventType), + (eventType = 0 < transitionEventRepeatTime), + (eventIsRepeat = 2 === transitionUpdateType), + (color = renderStartTime), + (endTime = transitionUpdateTask), + (label = transitionUpdateMethodName), + (isSpawnedUpdate = transitionUpdateComponentName), + supportsUserTiming && + ((currentTrack = "Transition"), + 0 < previousRenderStartTime + ? previousRenderStartTime > color && + (previousRenderStartTime = color) + : (previousRenderStartTime = color), + 0 < debugTask + ? debugTask > previousRenderStartTime && + (debugTask = previousRenderStartTime) + : (debugTask = previousRenderStartTime), + 0 < isPingedUpdate + ? isPingedUpdate > debugTask && (isPingedUpdate = debugTask) + : (isPingedUpdate = debugTask), + debugTask > isPingedUpdate && + null !== eventTime && + ((color$jscomp$0 = eventType ? "secondary-light" : "warning"), + endTime + ? endTime.run( console.timeStamp.bind( console, - delayedUntilPaint ? "Waiting for Paint" : "Waiting", - startTime, - endTime, + eventType ? "Consecutive" : "Event: " + eventTime, + isPingedUpdate, + debugTask, currentTrack, "Scheduler \u269b", - "secondary-light" + color$jscomp$0 ) ) : console.timeStamp( - delayedUntilPaint ? "Waiting for Paint" : "Waiting", - startTime, - endTime, + eventType ? "Consecutive" : "Event: " + eventTime, + isPingedUpdate, + debugTask, currentTrack, "Scheduler \u269b", - "secondary-light" - )); - } - startTime = executionContext; - executionContext |= CommitContext; - var finishedWork = priority.current; - resetComponentEffectTimers(); - commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = priority.current; - finishedWork = pendingEffectsRenderEndTime; - resetComponentEffectTimers(); - commitPassiveMountOnFiber( - priority, - finishedWork$jscomp$0, - lanes, - transitions, - finishedWork - ); - commitDoubleInvokeEffectsInDEV(priority, !0); - executionContext = startTime; - var passiveEffectsEndTime = now$1(); - finishedWork$jscomp$0 = passiveEffectStartTime; - finishedWork = workInProgressUpdateTask; - null !== commitErrors - ? logCommitErrored( - finishedWork$jscomp$0, - passiveEffectsEndTime, - commitErrors, - !0, - finishedWork - ) - : !supportsUserTiming || - passiveEffectsEndTime <= finishedWork$jscomp$0 || - (finishedWork - ? finishedWork.run( + color$jscomp$0 + )), + previousRenderStartTime > debugTask && + (endTime + ? endTime.run( console.timeStamp.bind( console, - "Remaining Effects", - finishedWork$jscomp$0, - passiveEffectsEndTime, + "Action", + debugTask, + previousRenderStartTime, currentTrack, "Scheduler \u269b", - "secondary-dark" + "primary-dark" ) ) : console.timeStamp( - "Remaining Effects", - finishedWork$jscomp$0, - passiveEffectsEndTime, + "Action", + debugTask, + previousRenderStartTime, currentTrack, "Scheduler \u269b", - "secondary-dark" - )); - finalizeRender(lanes, passiveEffectsEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - didScheduleUpdateDuringPassiveEffects - ? priority === rootWithPassiveNestedUpdates - ? nestedPassiveUpdateCount++ - : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = priority)) - : (nestedPassiveUpdateCount = 0); - didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; - if ( - injectedHook && - "function" === typeof injectedHook.onPostCommitFiberRoot - ) - try { - injectedHook.onPostCommitFiberRoot(rendererID, priority); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %o", - err - )); - } - var stateNode = priority.current.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - return !0; - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = renderPriority), - releaseRootPooledCache(root, remainingLanes); - } + "primary-dark" + )), + color > previousRenderStartTime && + ((debugTask = eventIsRepeat + ? "Promise Resolved" + : 5 < color - previousRenderStartTime + ? "Update Blocked" + : "Update"), + (isPingedUpdate = []), + null != isSpawnedUpdate && + isPingedUpdate.push(["Component name", isSpawnedUpdate]), + null != label && isPingedUpdate.push(["Method name", label]), + (previousRenderStartTime = { + start: previousRenderStartTime, + end: color, + detail: { + devtools: { + properties: isPingedUpdate, + track: currentTrack, + trackGroup: "Scheduler \u269b", + color: "primary-light" + } + } + }), + endTime + ? endTime.run( + performance.measure.bind( + performance, + debugTask, + previousRenderStartTime + ) + ) + : performance.measure(debugTask, previousRenderStartTime), + performance.clearMeasures(debugTask))), + (transitionUpdateTime = transitionStartTime = -1.1), + (transitionUpdateType = 0), + (transitionSuspendedTime = -1.1), + (transitionEventRepeatTime = transitionEventTime), + (transitionEventTime = -1.1), + (transitionClampTime = now())); + 0 !== (lanes & 62914560) && + 0 !== (animatingLanes & 62914560) && + (setCurrentTrackFromLanes(4194304), + logAnimatingPhase(retryClampTime, renderStartTime, animatingTask)); + 0 !== (lanes & 2080374784) && + 0 !== (animatingLanes & 2080374784) && + (setCurrentTrackFromLanes(268435456), + logAnimatingPhase(idleClampTime, renderStartTime, animatingTask)); + previousRenderStartTime = root.timeoutHandle; + -1 !== previousRenderStartTime && + ((root.timeoutHandle = -1), + cancelTimeout(previousRenderStartTime), + (previousRenderStartTime = pendingEffectsLanes), + (root.pingedLanes |= root.suspendedLanes & previousRenderStartTime), + (root.warmLanes &= ~previousRenderStartTime)); + previousRenderStartTime = root.cancelPendingCommit; + null !== previousRenderStartTime && + ((root.cancelPendingCommit = null), previousRenderStartTime()); + pendingEffectsLanes = 0; + resetWorkInProgressStack(); + workInProgressRoot = root; + workInProgress = previousRenderStartTime = createWorkInProgress( + root.current, + null + ); + workInProgressRootRenderLanes = lanes; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; + workInProgressRootExitStatus = RootInProgress; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = + workInProgressRootPingedLanes = + workInProgressRootInterleavedUpdatedLanes = + workInProgressRootSkippedLanes = + 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = + null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; + entangledRenderLanes = getEntangledLanes(root, lanes); + finishQueueingConcurrentUpdates(); + root = getCurrentTime(); + 1e3 < root - lastResetTime && + ((ReactSharedInternals.recentlyCreatedOwnerStacks = 0), + (lastResetTime = root)); + ReactStrictModeWarnings.discardPendingWarnings(); + return previousRenderStartTime; + } + function handleThrow(root, thrownValue) { + currentlyRenderingFiber = null; + ReactSharedInternals.H = ContextOnlyDispatcher; + ReactSharedInternals.getCurrentStack = null; + isRendering = !1; + current = null; + thrownValue === SuspenseException || + thrownValue === SuspenseActionException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = SuspendedOnImmediate)) + : thrownValue === SuspenseyCommitException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = SuspendedOnInstance)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? SuspendedOnHydration + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); + workInProgressThrownValue = thrownValue; + var erroredWork = workInProgress; + null === erroredWork + ? ((workInProgressRootExitStatus = RootFatalErrored), + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + )) + : erroredWork.mode & 2 && + stopProfilerTimerIfRunningAndRecordDuration(erroredWork); } - function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - recordEffectError(sourceFiber); - sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); - null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + function pushDispatcher() { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; } - function captureCommitPhaseError( - sourceFiber, - nearestMountedAncestor, - error - ) { - isRunningInsertionEffect = !1; - if (3 === sourceFiber.tag) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); - else { - for (; null !== nearestMountedAncestor; ) { - if (3 === nearestMountedAncestor.tag) { - captureCommitPhaseErrorOnRoot( - nearestMountedAncestor, - sourceFiber, - error - ); - return; + function pushAsyncDispatcher() { + var prevAsyncDispatcher = ReactSharedInternals.A; + ReactSharedInternals.A = DefaultAsyncDispatcher; + return prevAsyncDispatcher; + } + function markRenderDerivedCause(fiber) { + null === workInProgressUpdateTask && + (workInProgressUpdateTask = + null == fiber._debugTask ? null : fiber._debugTask); + } + function renderDidSuspendDelayIfPossible() { + workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194048) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); + (0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || + null === workInProgressRoot || + markRootSuspended( + workInProgressRoot, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 + ); + } + function renderRootSync(root, lanes, shouldYieldForPrerendering) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(), + prevAsyncDispatcher = pushAsyncDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== lanes + ) { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + 0 < memoizedUpdaters.size && + (restorePendingUpdaters(root, workInProgressRootRenderLanes), + memoizedUpdaters.clear()); + movePendingFibersToMemoized(root, lanes); + } + workInProgressTransitions = null; + prepareFreshStack(root, lanes); + } + lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; + a: do + try { + if ( + workInProgressSuspendedReason !== NotSuspended && + null !== workInProgress + ) { + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; + switch (workInProgressSuspendedReason) { + case SuspendedOnHydration: + resetWorkInProgressStack(); + memoizedUpdaters = RootSuspendedAtTheShell; + break a; + case SuspendedOnImmediate: + case SuspendedOnData: + case SuspendedOnAction: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = RootInProgress; + break a; + } + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + } } - if (1 === nearestMountedAncestor.tag) { - var instance = nearestMountedAncestor.stateNode; - if ( - "function" === - typeof nearestMountedAncestor.type.getDerivedStateFromError || - ("function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; + break; + } catch (thrownValue$5) { + handleThrow(root, thrownValue$5); + } + while (1); + lanes && root.shellSuspendCounter++; + resetContextDependencies(); + executionContext = prevExecutionContext; + ReactSharedInternals.H = prevDispatcher; + ReactSharedInternals.A = prevAsyncDispatcher; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; + } + function workLoopSync() { + for (; null !== workInProgress; ) performUnitOfWork(workInProgress); + } + function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(), + prevAsyncDispatcher = pushAsyncDispatcher(); + if ( + workInProgressRoot !== root || + workInProgressRootRenderLanes !== lanes + ) { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + 0 < memoizedUpdaters.size && + (restorePendingUpdaters(root, workInProgressRootRenderLanes), + memoizedUpdaters.clear()); + movePendingFibersToMemoized(root, lanes); + } + workInProgressTransitions = null; + workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; + prepareFreshStack(root, lanes); + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering( + root, + lanes + ); + a: do + try { + if ( + workInProgressSuspendedReason !== NotSuspended && + null !== workInProgress + ) + b: switch ( + ((lanes = workInProgress), + (memoizedUpdaters = workInProgressThrownValue), + workInProgressSuspendedReason) ) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - recordEffectError(sourceFiber); - error = createClassErrorUpdate(2); - instance = enqueueUpdate(nearestMountedAncestor, error, 2); - null !== instance && - (initializeClassErrorUpdate( - error, - instance, - nearestMountedAncestor, - sourceFiber - ), - markRootUpdated$1(instance, 2), - ensureRootIsScheduled(instance)); - return; + case SuspendedOnError: + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); + break; + case SuspendedOnData: + case SuspendedOnAction: + if (isThenableResolved(memoizedUpdaters)) { + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + replaySuspendedUnitOfWork(lanes); + break; + } + lanes = function () { + (workInProgressSuspendedReason !== SuspendedOnData && + workInProgressSuspendedReason !== SuspendedOnAction) || + workInProgressRoot !== root || + (workInProgressSuspendedReason = + SuspendedAndReadyToContinue); + ensureRootIsScheduled(root); + }; + memoizedUpdaters.then(lanes, lanes); + break a; + case SuspendedOnImmediate: + workInProgressSuspendedReason = SuspendedAndReadyToContinue; + break a; + case SuspendedOnInstance: + workInProgressSuspendedReason = + SuspendedOnInstanceAndReadyToContinue; + break a; + case SuspendedAndReadyToContinue: + isThenableResolved(memoizedUpdaters) + ? ((workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + replaySuspendedUnitOfWork(lanes)) + : ((workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); + break; + case SuspendedOnInstanceAndReadyToContinue: + var resource = null; + switch (workInProgress.tag) { + case 26: + resource = workInProgress.memoizedState; + case 5: + case 27: + var hostFiber = workInProgress; + if (resource ? preloadResource(resource) : 1) { + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + var sibling = hostFiber.sibling; + if (null !== sibling) workInProgress = sibling; + else { + var returnFiber = hostFiber.return; + null !== returnFiber + ? ((workInProgress = returnFiber), + completeUnitOfWork(returnFiber)) + : (workInProgress = null); + } + break b; + } + break; + default: + console.error( + "Unexpected type of fiber triggered a suspensey commit. This is a bug in React." + ); + } + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); + break; + case SuspendedOnDeprecatedThrowPromise: + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); + break; + case SuspendedOnHydration: + resetWorkInProgressStack(); + workInProgressRootExitStatus = RootSuspendedAtTheShell; + break a; + default: + throw Error( + "Unexpected SuspendedReason. This is a bug in React." + ); } - } - nearestMountedAncestor = nearestMountedAncestor.return; + null !== ReactSharedInternals.actQueue + ? workLoopSync() + : workLoopConcurrentByScheduler(); + break; + } catch (thrownValue$6) { + handleThrow(root, thrownValue$6); } - console.error( - "Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", - error - ); - } - } - function attachPingListener(root, wakeable, lanes) { - var pingCache = root.pingCache; - if (null === pingCache) { - pingCache = root.pingCache = new PossiblyWeakMap(); - var threadIDs = new Set(); - pingCache.set(wakeable, threadIDs); - } else - (threadIDs = pingCache.get(wakeable)), - void 0 === threadIDs && - ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); - threadIDs.has(lanes) || - ((workInProgressRootDidAttachPingListener = !0), - threadIDs.add(lanes), - (pingCache = pingSuspendedRoot.bind(null, root, wakeable, lanes)), - isDevToolsPresent && restorePendingUpdaters(root, lanes), - wakeable.then(pingCache, pingCache)); + while (1); + resetContextDependencies(); + ReactSharedInternals.H = prevDispatcher; + ReactSharedInternals.A = prevAsyncDispatcher; + executionContext = prevExecutionContext; + if (null !== workInProgress) return RootInProgress; + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } - function pingSuspendedRoot(root, wakeable, pingedLanes) { - var pingCache = root.pingCache; - null !== pingCache && pingCache.delete(wakeable); - root.pingedLanes |= root.suspendedLanes & pingedLanes; - root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 127) - ? 0 > blockingUpdateTime && - ((blockingClampTime = blockingUpdateTime = now()), - (blockingUpdateTask = createTask("Promise Resolved")), - (blockingUpdateType = 2)) - : 0 !== (pingedLanes & 4194048) && - 0 > transitionUpdateTime && - ((transitionClampTime = transitionUpdateTime = now()), - (transitionUpdateTask = createTask("Promise Resolved")), - (transitionUpdateType = 2)); - 0 !== root.tag && - isConcurrentActEnvironment() && - null === ReactSharedInternals.actQueue && - console.error( - "A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act" - ); - workInProgressRoot === root && - (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && - (workInProgressRootExitStatus === RootSuspendedWithDelay || - (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes && - now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) - ? (executionContext & RenderContext) === NoContext - ? prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes) - : (workInProgressRootPingedLanes |= pingedLanes), - workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && - (workInProgressSuspendedRetryLanes = 0)); - ensureRootIsScheduled(root); + function workLoopConcurrentByScheduler() { + for (; null !== workInProgress && !shouldYield(); ) + performUnitOfWork(workInProgress); } - function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && - (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); - boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); - null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), - ensureRootIsScheduled(boundaryFiber)); + function performUnitOfWork(unitOfWork) { + var current = unitOfWork.alternate; + 0 !== (unitOfWork.mode & 2) + ? (startProfilerTimer(unitOfWork), + (current = runWithFiberInDEV( + unitOfWork, + beginWork, + current, + unitOfWork, + entangledRenderLanes + )), + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) + : (current = runWithFiberInDEV( + unitOfWork, + beginWork, + current, + unitOfWork, + entangledRenderLanes + )); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === current + ? completeUnitOfWork(unitOfWork) + : (workInProgress = current); } - function retryDehydratedSuspenseBoundary(boundaryFiber) { - var suspenseState = boundaryFiber.memoizedState, - retryLane = 0; - null !== suspenseState && (retryLane = suspenseState.retryLane); - retryTimedOutBoundary(boundaryFiber, retryLane); + function replaySuspendedUnitOfWork(unitOfWork) { + var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } - function resolveRetryWakeable(boundaryFiber, wakeable) { - var retryLane = 0; - switch (boundaryFiber.tag) { - case 31: - case 13: - var retryCache = boundaryFiber.stateNode; - var suspenseState = boundaryFiber.memoizedState; - null !== suspenseState && (retryLane = suspenseState.retryLane); - break; - case 19: - retryCache = boundaryFiber.stateNode; + function replayBeginWork(unitOfWork) { + var current = unitOfWork.alternate, + isProfilingMode = 0 !== (unitOfWork.mode & 2); + isProfilingMode && startProfilerTimer(unitOfWork); + switch (unitOfWork.tag) { + case 15: + case 0: + current = replayFunctionComponent( + current, + unitOfWork, + unitOfWork.pendingProps, + unitOfWork.type, + void 0, + workInProgressRootRenderLanes + ); break; - case 22: - retryCache = boundaryFiber.stateNode._retryCache; + case 11: + current = replayFunctionComponent( + current, + unitOfWork, + unitOfWork.pendingProps, + unitOfWork.type.render, + unitOfWork.ref, + workInProgressRootRenderLanes + ); break; + case 5: + resetHooksOnUnwind(unitOfWork); default: - throw Error( - "Pinged unknown suspense boundary type. This is probably a bug in React." - ); + unwindInterruptedWork(current, unitOfWork), + (unitOfWork = workInProgress = + resetWorkInProgress(unitOfWork, entangledRenderLanes)), + (current = beginWork(current, unitOfWork, entangledRenderLanes)); } - null !== retryCache && retryCache.delete(wakeable); - retryTimedOutBoundary(boundaryFiber, retryLane); - } - function recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root$jscomp$0, - parentFiber, - isInStrictMode - ) { - if (0 !== (parentFiber.subtreeFlags & 134225920)) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var root = root$jscomp$0, - fiber = parentFiber, - isStrictModeFiber = fiber.type === REACT_STRICT_MODE_TYPE; - isStrictModeFiber = isInStrictMode || isStrictModeFiber; - 22 !== fiber.tag - ? fiber.flags & 134217728 - ? isStrictModeFiber && - runWithFiberInDEV( - fiber, - doubleInvokeEffectsOnFiber, - root, - fiber - ) - : recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root, - fiber, - isStrictModeFiber - ) - : null === fiber.memoizedState && - (isStrictModeFiber && fiber.flags & 134225920 - ? runWithFiberInDEV( - fiber, - doubleInvokeEffectsOnFiber, - root, - fiber - ) - : fiber.subtreeFlags & 134217728 && - runWithFiberInDEV( - fiber, - recursivelyTraverseAndDoubleInvokeEffectsInDEV, - root, - fiber, - isStrictModeFiber - )); - parentFiber = parentFiber.sibling; - } + isProfilingMode && + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); + return current; } - function doubleInvokeEffectsOnFiber(root, fiber) { - setIsStrictModeForDevtools(!0); + function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason + ) { + resetContextDependencies(); + resetHooksOnUnwind(unitOfWork); + thenableState$1 = null; + thenableIndexCounter$1 = 0; + var returnFiber = unitOfWork.return; try { - disappearLayoutEffects(fiber), - disconnectPassiveEffect(fiber), - reappearLayoutEffects( + if ( + throwException( root, - fiber.alternate, - fiber, - NoLayoutEffectTraversalFlags - ), - reconnectPassiveEffects(root, fiber, 0, null, !1, 0); - } finally { - setIsStrictModeForDevtools(!1); - } - } - function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { - 0 !== root.tag - ? ((hasPassiveEffects = !0), - 1 !== root.tag || root.current.mode & 24 || (hasPassiveEffects = !1), - recursivelyTraverseAndDoubleInvokeEffectsInDEV( + returnFiber, + unitOfWork, + thrownValue, + workInProgressRootRenderLanes + ) + ) { + workInProgressRootExitStatus = RootFatalErrored; + logUncaughtError( root, - root.current, - hasPassiveEffects - )) - : runWithFiberInDEV( - root.current, - legacyCommitDoubleInvokeEffectsInDEV, - root.current, - hasPassiveEffects + createCapturedValueAtFiber(thrownValue, root.current) ); - } - function legacyCommitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { - invokeEffectsInDev(fiber, 268435456, invokeLayoutEffectUnmountInDEV); - hasPassiveEffects && - invokeEffectsInDev(fiber, 536870912, invokePassiveEffectUnmountInDEV); - invokeEffectsInDev(fiber, 268435456, invokeLayoutEffectMountInDEV); - hasPassiveEffects && - invokeEffectsInDev(fiber, 536870912, invokePassiveEffectMountInDEV); - } - function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { - for (var subtreeRoot = null; null != firstChild; ) { - var primarySubtreeFlag = firstChild.subtreeFlags & fiberFlags; - firstChild !== subtreeRoot && - null != firstChild.child && - 0 !== primarySubtreeFlag - ? (firstChild = firstChild.child) - : (0 !== (firstChild.flags & fiberFlags) && - invokeEffectFn(firstChild), - (firstChild = - null !== firstChild.sibling - ? firstChild.sibling - : (subtreeRoot = firstChild.return))); + workInProgress = null; + return; + } + } catch (error) { + if (null !== returnFiber) throw ((workInProgress = returnFiber), error); + workInProgressRootExitStatus = RootFatalErrored; + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + ); + workInProgress = null; + return; } + if (unitOfWork.flags & 32768) { + if (suspendedReason === SuspendedOnError) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + suspendedReason === SuspendedOnData || + suspendedReason === SuspendedOnAction || + suspendedReason === SuspendedOnImmediate || + suspendedReason === SuspendedOnDeprecatedThrowPromise) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + unwindUnitOfWork(unitOfWork, root); + } else completeUnitOfWork(unitOfWork); } - function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { - if ((executionContext & RenderContext) === NoContext && fiber.mode & 1) { - var tag = fiber.tag; + function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } + var current = completedWork.alternate; + unitOfWork = completedWork.return; + startProfilerTimer(completedWork); + current = runWithFiberInDEV( + completedWork, + completeWork, + current, + completedWork, + entangledRenderLanes + ); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); + if (null !== current) { + workInProgress = current; + return; + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootCompleted); + } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); if ( - 3 === tag || - 1 === tag || - 0 === tag || - 11 === tag || - 14 === tag || - 15 === tag + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) ) { - tag = getComponentNameFromFiber(fiber) || "ReactComponent"; - if (null !== didWarnStateUpdateForNotYetMountedComponent) { - if (didWarnStateUpdateForNotYetMountedComponent.has(tag)) return; - didWarnStateUpdateForNotYetMountedComponent.add(tag); - } else didWarnStateUpdateForNotYetMountedComponent = new Set([tag]); - runWithFiberInDEV(fiber, function () { - console.error( - "Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead." - ); - }); + workInProgress = unitOfWork; + return; } - } - } - function restorePendingUpdaters(root, lanes) { - isDevToolsPresent && - root.memoizedUpdaters.forEach(function (schedulingFiber) { - addFiberToLanesMap(root, schedulingFiber, lanes); - }); - } - function scheduleCallback(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode) - : scheduleCallback$3(priorityLevel, callback); + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootSuspendedAtTheShell; + workInProgress = null; } - function warnIfUpdatesNotWrappedWithActDEV(fiber) { - if (fiber.mode & 1) { - if (!isConcurrentActEnvironment()) return; - } else { - "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT - ? IS_REACT_ACT_ENVIRONMENT - : void 0; - var JSCompiler_inline_result = warnsIfNotActing; + function completeRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + exitStatus, + suspendedState, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ) { + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + setCurrentTrackFromLanes(lanes); + if (exitStatus === RootErrored) + logErroredRenderPhase( + completedRenderStartTime, + completedRenderEndTime, + lanes, + workInProgressUpdateTask + ); + else if (null !== recoverableErrors) { if ( - !JSCompiler_inline_result || - executionContext !== NoContext || - (0 !== fiber.tag && 11 !== fiber.tag && 15 !== fiber.tag) - ) - return; - } - null === ReactSharedInternals.actQueue && - runWithFiberInDEV(fiber, function () { + ((didSkipSuspendedSiblings = + null !== finishedWork && + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 !== (finishedWork.flags & 256)), + (didIncludeRenderPhaseUpdate = workInProgressUpdateTask), + supportsUserTiming && + !(completedRenderEndTime <= completedRenderStartTime)) + ) { + exitStatus = []; + for (var i = 0; i < recoverableErrors.length; i++) { + var error = recoverableErrors[i].value; + exitStatus.push([ + "Recoverable Error", + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error) + ]); + } + completedRenderStartTime = { + start: completedRenderStartTime, + end: completedRenderEndTime, + detail: { + devtools: { + color: "primary-dark", + track: currentTrack, + trackGroup: "Scheduler \u269b", + tooltipText: didSkipSuspendedSiblings + ? "Hydration Failed" + : "Recovered after Error", + properties: exitStatus + } + } + }; + didIncludeRenderPhaseUpdate + ? didIncludeRenderPhaseUpdate.run( + performance.measure.bind( + performance, + "Recovered", + completedRenderStartTime + ) + ) + : performance.measure("Recovered", completedRenderStartTime); + performance.clearMeasures("Recovered"); + } + } else + (didIncludeRenderPhaseUpdate = workInProgressUpdateTask), + !supportsUserTiming || + completedRenderEndTime <= completedRenderStartTime || + ((didSkipSuspendedSiblings = + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), + (exitStatus = + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326741) === lanes + ? "Hydrated" + : "Render"), + didIncludeRenderPhaseUpdate + ? didIncludeRenderPhaseUpdate.run( + console.timeStamp.bind( + console, + exitStatus, + completedRenderStartTime, + completedRenderEndTime, + currentTrack, + "Scheduler \u269b", + didSkipSuspendedSiblings + ) + ) + : console.timeStamp( + exitStatus, + completedRenderStartTime, + completedRenderEndTime, + currentTrack, + "Scheduler \u269b", + didSkipSuspendedSiblings + )); + if (null !== finishedWork) { + 0 === lanes && console.error( - "An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act", - getComponentNameFromFiber(fiber) + "finishedLanes should not be empty during a commit. This is a bug in React." ); - }); - } - function resolveTypeForHotReloading(type) { - if (null === resolveFamily) return type; - var family = resolveFamily(type); - return void 0 === family ? type : family.current; - } - function isCompatibleFamilyForHotReloading(fiber, element) { - if (null === resolveFamily) return !1; - var resolve = resolveFamily, - prevType = fiber.elementType; - element = element.type; - var needsCompareFamilies = !1, - $$typeofNextType = - "object" === typeof element && null !== element - ? element.$$typeof - : null; - switch (fiber.tag) { - case 1: - "function" === typeof element && (needsCompareFamilies = !0); - break; - case 0: - "function" === typeof element - ? (needsCompareFamilies = !0) - : $$typeofNextType === REACT_LAZY_TYPE && - (needsCompareFamilies = !0); - break; - case 11: - $$typeofNextType === REACT_FORWARD_REF_TYPE - ? (needsCompareFamilies = !0) - : $$typeofNextType === REACT_LAZY_TYPE && - (needsCompareFamilies = !0); - break; - case 14: - case 15: - $$typeofNextType === REACT_MEMO_TYPE - ? (needsCompareFamilies = !0) - : $$typeofNextType === REACT_LAZY_TYPE && - (needsCompareFamilies = !0); - break; - default: - return !1; + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingDelayedCommitReason = IMMEDIATE_COMMIT; + pendingSuspendedViewTransitionReason = null; + commitRoot( + root, + finishedWork, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedState, + suspendedCommitReason, + completedRenderEndTime + ); } - return needsCompareFamilies && - ((fiber = resolve(prevType)), - void 0 !== fiber && fiber === resolve(element)) - ? !0 - : !1; - } - function markFailedErrorBoundaryForHotReloading(fiber) { - null !== resolveFamily && - "function" === typeof WeakSet && - (null === failedBoundaries && (failedBoundaries = new WeakSet()), - failedBoundaries.add(fiber)); } - function scheduleFibersWithFamiliesRecursively( - fiber, - updatedFamilies, - staleFamilies + function commitRoot( + root, + finishedWork, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedState, + suspendedCommitReason, + completedRenderEndTime ) { - do { - var _fiber = fiber, - alternate = _fiber.alternate, - child = _fiber.child, - sibling = _fiber.sibling, - tag = _fiber.tag, - type = _fiber.type, - elementType = _fiber.elementType, - candidateType = null; - _fiber = null; - switch (tag) { - case 0: - case 1: - candidateType = type; - break; - case 15: - candidateType = type; - _fiber = elementType; - break; - case 14: - _fiber = elementType; - break; - case 11: - (candidateType = type.render), (_fiber = elementType); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + pendingEffectsRemainingLanes = remainingLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = claimQueuedTransitionTypes(root)), + (spawnedLane = 10262)) + : ((pendingTransitionTypes = null), (spawnedLane = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & spawnedLane) || + 0 !== (finishedWork.flags & spawnedLane) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + schedulerEvent = global.event; + pendingDelayedCommitReason === IMMEDIATE_COMMIT && + (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT); + flushPassiveEffects(); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + null !== suspendedCommitReason && + logSuspendedCommitPhase( + completedRenderEndTime, + commitStartTime, + suspendedCommitReason, + workInProgressUpdateTask + ); + shouldStartViewTransition = !1; + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + spawnedLane = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = spawnedLane), + (currentUpdatePriority = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); } - if (null === resolveFamily) - throw Error("Expected resolveFamily to be set during hot reload."); - var resolve = resolveFamily; - type = elementType = !1; - null !== candidateType && - ((candidateType = resolve(candidateType)), - void 0 !== candidateType && - (staleFamilies.has(candidateType) - ? (type = !0) - : updatedFamilies.has(candidateType) && - (1 === tag ? (type = !0) : (elementType = !0)))); - type || - null === _fiber || - ((tag = resolve(_fiber)), - void 0 !== tag && staleFamilies.has(tag) - ? (type = !0) - : "object" === typeof _fiber && - _fiber.$$typeof === REACT_LAZY_TYPE && - ((tag = _fiber._payload), - 1 === tag._status && - ((tag = resolve(tag._result.default)), - void 0 !== tag && staleFamilies.has(tag) && (type = !0)))); - null !== failedBoundaries && - (failedBoundaries.has(fiber) || - (null !== alternate && failedBoundaries.has(alternate))) && - (type = !0); - type && (fiber._debugNeedsRemount = !0); - if (type || elementType) - (alternate = enqueueConcurrentRenderForLane(fiber, 2)), - null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); - null === child || - type || - scheduleFibersWithFamiliesRecursively( - child, - updatedFamilies, - staleFamilies - ); - if (null === sibling) break; - fiber = sibling; - } while (1); + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + shouldStartViewTransition + ? ((animatingLanes |= lanes), + (animatingTask = null), + (pendingViewTransition = startViewTransition( + suspendedState, + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects, + reportViewTransitionError, + suspendedViewTransition, + finishedViewTransition.bind(null, lanes) + ))) + : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - function FiberNode(tag, pendingProps, key, mode) { - this.tag = tag; - this.key = key; - this.sibling = - this.child = - this.return = - this.stateNode = - this.type = - this.elementType = - null; - this.index = 0; - this.refCleanup = this.ref = null; - this.pendingProps = pendingProps; - this.dependencies = - this.memoizedState = - this.updateQueue = - this.memoizedProps = - null; - this.mode = mode; - this.subtreeFlags = this.flags = 0; - this.deletions = null; - this.childLanes = this.lanes = 0; - this.alternate = null; - this.actualDuration = -0; - this.actualStartTime = -1.1; - this.treeBaseDuration = this.selfBaseDuration = -0; - this._debugTask = - this._debugStack = - this._debugOwner = - this._debugInfo = - null; - this._debugNeedsRemount = !1; - this._debugHookTypes = null; - hasBadMapPolyfill || - "function" !== typeof Object.preventExtensions || - Object.preventExtensions(this); + function reportViewTransitionError(error) { + if (pendingEffectsStatus !== NO_PENDING_EFFECTS) { + var onRecoverableError = pendingEffectsRoot.onRecoverableError; + onRecoverableError(error, makeErrorInfo(null)); + } } - function shouldConstruct(Component) { - Component = Component.prototype; - return !(!Component || !Component.isReactComponent); + function suspendedViewTransition(reason) { + commitEndTime = now(); + logCommitPhase( + null === pendingSuspendedCommitReason + ? pendingEffectsRenderEndTime + : commitStartTime, + commitEndTime, + commitErrors, + pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT, + workInProgressUpdateTask + ); + pendingSuspendedCommitReason = pendingSuspendedViewTransitionReason = + reason; } - function createWorkInProgress(current, pendingProps) { - var workInProgress = current.alternate; - null === workInProgress - ? ((workInProgress = createFiber( - current.tag, - pendingProps, - current.key, - current.mode - )), - (workInProgress.elementType = current.elementType), - (workInProgress.type = current.type), - (workInProgress.stateNode = current.stateNode), - (workInProgress._debugOwner = current._debugOwner), - (workInProgress._debugStack = current._debugStack), - (workInProgress._debugTask = current._debugTask), - (workInProgress._debugHookTypes = current._debugHookTypes), - (workInProgress.alternate = current), - (current.alternate = workInProgress)) - : ((workInProgress.pendingProps = pendingProps), - (workInProgress.type = current.type), - (workInProgress.flags = 0), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null), - (workInProgress.actualDuration = -0), - (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 1206910976; - workInProgress.childLanes = current.childLanes; - workInProgress.lanes = current.lanes; - workInProgress.child = current.child; - workInProgress.memoizedProps = current.memoizedProps; - workInProgress.memoizedState = current.memoizedState; - workInProgress.updateQueue = current.updateQueue; - pendingProps = current.dependencies; - workInProgress.dependencies = - null === pendingProps - ? null - : { - lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext, - _debugThenableState: pendingProps._debugThenableState - }; - workInProgress.sibling = current.sibling; - workInProgress.index = current.index; - workInProgress.ref = current.ref; - workInProgress.refCleanup = current.refCleanup; - workInProgress.selfBaseDuration = current.selfBaseDuration; - workInProgress.treeBaseDuration = current.treeBaseDuration; - workInProgress._debugInfo = current._debugInfo; - workInProgress._debugNeedsRemount = current._debugNeedsRemount; - switch (workInProgress.tag) { - case 0: - case 15: - case 14: - case 1: - case 11: - workInProgress.type = resolveTypeForHotReloading(current.type); + function finishedViewTransition(lanes) { + if (0 !== (animatingLanes & lanes)) { + var task = animatingTask; + animatingLanes &= ~lanes; + animatingTask = null; + 0 !== (lanes & 4194048) && + 0 === (workInProgressRootRenderLanes & 4194048) && + 0 === (pendingEffectsLanes & 4194048) && + (setCurrentTrackFromLanes(256), + logAnimatingPhase(transitionClampTime, now$1(), task)); + 0 !== (lanes & 62914560) && + 0 === (workInProgressRootRenderLanes & 62914560) && + 0 === (pendingEffectsLanes & 62914560) && + (setCurrentTrackFromLanes(4194304), + logAnimatingPhase(retryClampTime, now$1(), task)); + 0 !== (lanes & 2080374784) && + 0 === (workInProgressRootRenderLanes & 2080374784) && + 0 === (pendingEffectsLanes & 2080374784) && + (setCurrentTrackFromLanes(268435456), + logAnimatingPhase(idleClampTime, now$1(), task)); + } + } + function flushAfterMutationEffects() { + pendingEffectsStatus === PENDING_AFTER_MUTATION_PHASE && + ((pendingEffectsStatus = NO_PENDING_EFFECTS), + commitAfterMutationEffectsOnFiber( + pendingFinishedWork, + pendingEffectsRoot + ), + (pendingEffectsStatus = PENDING_SPAWNED_WORK)); + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + (inUpdateViewTransition = rootViewTransitionAffected = !1), + resetComponentEffectTimers(), + commitMutationEffectsOnFiber(finishedWork, root, lanes), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var suspendedViewTransitionReason = + pendingSuspendedViewTransitionReason; + if (null !== suspendedViewTransitionReason) { + commitStartTime = now(); + var startTime = commitEndTime, + endTime = commitStartTime; + !supportsUserTiming || + endTime <= startTime || + (animatingTask + ? animatingTask.run( + console.timeStamp.bind( + console, + suspendedViewTransitionReason, + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + ) + ) + : console.timeStamp( + suspendedViewTransitionReason, + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + )); + } + suspendedViewTransitionReason = pendingEffectsRoot; + startTime = pendingFinishedWork; + endTime = pendingEffectsLanes; + var rootHasLayoutEffect = 0 !== (startTime.flags & 8772); + if (0 !== (startTime.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var _previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var _prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = endTime), + (inProgressRoot = suspendedViewTransitionReason), + resetComponentEffectTimers(), + commitLayoutEffectOnFiber( + suspendedViewTransitionReason, + startTime.alternate, + startTime + ), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = _prevExecutionContext), + (currentUpdatePriority = _previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + suspendedViewTransitionReason = pendingEffectsRenderEndTime; + startTime = pendingSuspendedCommitReason; + commitEndTime = now(); + logCommitPhase( + null === startTime ? suspendedViewTransitionReason : commitStartTime, + commitEndTime, + commitErrors, + pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT, + workInProgressUpdateTask + ); + pendingEffectsStatus = PENDING_AFTER_MUTATION_PHASE; } - return workInProgress; - } - function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 1206910978; - var current = workInProgress.alternate; - null === current - ? ((workInProgress.childLanes = 0), - (workInProgress.lanes = renderLanes), - (workInProgress.child = null), - (workInProgress.subtreeFlags = 0), - (workInProgress.memoizedProps = null), - (workInProgress.memoizedState = null), - (workInProgress.updateQueue = null), - (workInProgress.dependencies = null), - (workInProgress.stateNode = null), - (workInProgress.selfBaseDuration = 0), - (workInProgress.treeBaseDuration = 0)) - : ((workInProgress.childLanes = current.childLanes), - (workInProgress.lanes = current.lanes), - (workInProgress.child = current.child), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null), - (workInProgress.memoizedProps = current.memoizedProps), - (workInProgress.memoizedState = current.memoizedState), - (workInProgress.updateQueue = current.updateQueue), - (workInProgress.type = current.type), - (renderLanes = current.dependencies), - (workInProgress.dependencies = - null === renderLanes - ? null - : { - lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext, - _debugThenableState: renderLanes._debugThenableState - }), - (workInProgress.selfBaseDuration = current.selfBaseDuration), - (workInProgress.treeBaseDuration = current.treeBaseDuration)); - return workInProgress; } - function createFiberFromTypeAndProps( - type, - key, - pendingProps, - owner, - mode, - lanes - ) { - var fiberTag = 0; - var resolvedType = resolveTypeForHotReloading(type); - if ("function" === typeof resolvedType) - shouldConstruct(resolvedType) && (fiberTag = 1); - else if ("string" === typeof resolvedType) fiberTag = 5; - else - a: switch (resolvedType) { - case REACT_ACTIVITY_TYPE: - return ( - (key = createFiber(31, pendingProps, key, mode)), - (key.elementType = REACT_ACTIVITY_TYPE), - (key.lanes = lanes), - key - ); - case REACT_FRAGMENT_TYPE: - return createFiberFromFragment( - pendingProps.children, - mode, - lanes, - key - ); - case REACT_STRICT_MODE_TYPE: - fiberTag = 8; - mode |= 8; - 0 !== (mode & 1) && (mode |= 16); - break; - case REACT_PROFILER_TYPE: - return ( - (type = pendingProps), - (owner = mode), - "string" !== typeof type.id && - console.error( - 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', - typeof type.id - ), - (key = createFiber(12, type, key, owner | 2)), - (key.elementType = REACT_PROFILER_TYPE), - (key.lanes = lanes), - (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), - key - ); - case REACT_SUSPENSE_TYPE: - return ( - (key = createFiber(13, pendingProps, key, mode)), - (key.elementType = REACT_SUSPENSE_TYPE), - (key.lanes = lanes), - key - ); - case REACT_SUSPENSE_LIST_TYPE: - return ( - (key = createFiber(19, pendingProps, key, mode)), - (key.elementType = REACT_SUSPENSE_LIST_TYPE), - (key.lanes = lanes), - key - ); - case REACT_LEGACY_HIDDEN_TYPE: - case REACT_VIEW_TRANSITION_TYPE: - return ( - (type = mode | 32), - (key = createFiber(30, pendingProps, key, type)), - (key.elementType = REACT_VIEW_TRANSITION_TYPE), - (key.lanes = lanes), - (key.stateNode = { - autoName: null, - paired: null, - clones: null, - ref: null - }), - key - ); - default: - if ("object" === typeof resolvedType && null !== resolvedType) - switch (resolvedType.$$typeof) { - case REACT_CONTEXT_TYPE: - fiberTag = 10; - break a; - case REACT_CONSUMER_TYPE: - fiberTag = 9; - break a; - case REACT_FORWARD_REF_TYPE: - fiberTag = 11; - break a; - case REACT_MEMO_TYPE: - fiberTag = 14; - break a; - case REACT_LAZY_TYPE: - fiberTag = 16; - resolvedType = null; - break a; - } - pendingProps = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - pendingProps += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - null === type - ? (resolvedType = "null") - : isArrayImpl(type) - ? (resolvedType = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((resolvedType = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (pendingProps = - " Did you accidentally export a JSX literal instead of a component?")) - : (resolvedType = typeof type); - fiberTag = owner - ? "number" === typeof owner.tag - ? getComponentNameFromFiber(owner) - : "string" === typeof owner.name - ? owner.name - : null - : null; - fiberTag && - (pendingProps += - "\n\nCheck the render method of `" + fiberTag + "`."); - fiberTag = 29; - pendingProps = Error( - "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - (resolvedType + "." + pendingProps) + function flushSpawnedWork() { + if ( + pendingEffectsStatus === PENDING_SPAWNED_WORK || + pendingEffectsStatus === PENDING_AFTER_MUTATION_PHASE + ) { + if (pendingEffectsStatus === PENDING_SPAWNED_WORK) { + var startViewTransitionStartTime = commitEndTime; + commitEndTime = now(); + var endTime = commitEndTime, + abortedViewTransition = + pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT; + !supportsUserTiming || + endTime <= startViewTransitionStartTime || + (animatingTask + ? animatingTask.run( + console.timeStamp.bind( + console, + abortedViewTransition + ? "Interrupted View Transition" + : "Starting Animation", + startViewTransitionStartTime, + endTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? "error" : "secondary-light" + ) + ) + : console.timeStamp( + abortedViewTransition + ? "Interrupted View Transition" + : "Starting Animation", + startViewTransitionStartTime, + endTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? " error" : "secondary-light" + )); + pendingDelayedCommitReason !== ABORTED_VIEW_TRANSITION_COMMIT && + (pendingDelayedCommitReason = ANIMATION_STARTED_COMMIT); + } + pendingEffectsStatus = NO_PENDING_EFFECTS; + startViewTransitionStartTime = pendingViewTransition; + pendingViewTransition = null; + requestPaint(); + endTime = pendingEffectsRoot; + var finishedWork = pendingFinishedWork; + abortedViewTransition = pendingEffectsLanes; + var recoverableErrors = pendingRecoverableErrors, + passiveSubtreeMask = + (abortedViewTransition & 335544064) === abortedViewTransition + ? 10262 + : 10256; + (passiveSubtreeMask = + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || + 0 !== (finishedWork.flags & passiveSubtreeMask)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingFinishedWork = pendingEffectsRoot = null), + releaseRootPooledCache(endTime, endTime.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + var remainingLanes = endTime.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + passiveSubtreeMask || commitDoubleInvokeEffectsInDEV(endTime); + remainingLanes = lanesToEventPriority(abortedViewTransition); + finishedWork = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (remainingLanes) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError ); - resolvedType = null; + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %o", + err + )); + } + isDevToolsPresent && endTime.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = endTime.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } } - key = createFiber(fiberTag, pendingProps, key, mode); - key.elementType = type; - key.type = resolvedType; - key.lanes = lanes; - key._debugOwner = owner; - return key; + onRecoverableError = pendingViewTransitionEvents; + recoverableError = pendingTransitionTypes; + pendingTransitionTypes = null; + if ( + null !== onRecoverableError && + ((pendingViewTransitionEvents = null), + null === recoverableError && (recoverableError = []), + null !== startViewTransitionStartTime) + ) + for ( + errorInfo = 0; + errorInfo < onRecoverableError.length; + errorInfo++ + ) + (recoverableErrors = (0, onRecoverableError[errorInfo])( + recoverableError + )), + void 0 !== recoverableErrors && + startViewTransitionStartTime.finished.finally( + recoverableErrors + ); + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(endTime); + remainingLanes = endTime.pendingLanes; + 0 !== (abortedViewTransition & 261930) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + endTime === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = endTime))) + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); + passiveSubtreeMask || + finalizeRender(abortedViewTransition, commitEndTime); + flushSyncWorkAcrossRoots_impl(0); + } } - function createFiberFromElement(element, mode, lanes) { - mode = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - element._owner, - mode, - lanes - ); - mode._debugOwner = element._owner; - mode._debugStack = element._debugStack; - mode._debugTask = element._debugTask; - return mode; + function makeErrorInfo(componentStack) { + componentStack = { componentStack: componentStack }; + Object.defineProperty(componentStack, "digest", { + get: function () { + console.error( + 'You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.' + ); + } + }); + return componentStack; } - function createFiberFromFragment(elements, mode, lanes, key) { - elements = createFiber(7, elements, key, mode); - elements.lanes = lanes; - return elements; + function releaseRootPooledCache(root, remainingLanes) { + 0 === (root.pooledCacheLanes &= remainingLanes) && + ((remainingLanes = root.pooledCache), + null != remainingLanes && + ((root.pooledCache = null), releaseCache(remainingLanes))); } - function createFiberFromText(content, mode, lanes) { - content = createFiber(6, content, null, mode); - content.lanes = lanes; - return content; + function flushPendingEffects() { + null !== pendingViewTransition && + (console.warn("stopViewTransition is not implemented"), + didWarnAboutInterruptedViewTransitions || + ((didWarnAboutInterruptedViewTransitions = !0), + console.warn( + "A flushSync update cancelled a View Transition because it was called while the View Transition was still preparing. To preserve the synchronous semantics, React had to skip the View Transition. If you can, try to avoid flushSync() in a scenario that's likely to interfere." + )), + (pendingViewTransition = null), + (pendingDelayedCommitReason = ABORTED_VIEW_TRANSITION_COMMIT)); + flushMutationEffects(); + flushLayoutEffects(); + flushSpawnedWork(); + return flushPassiveEffects(); + } + function flushPassiveEffects() { + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + priority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + renderPriority = ReactSharedInternals.T; + var previousPriority = currentUpdatePriority; + try { + currentUpdatePriority = priority; + ReactSharedInternals.T = null; + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + priority = pendingEffectsRoot; + var lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingFinishedWork = pendingEffectsRoot = null; + pendingEffectsLanes = 0; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Cannot flush passive effects while already rendering."); + setCurrentTrackFromLanes(lanes); + isFlushingPassiveEffects = !0; + didScheduleUpdateDuringPassiveEffects = !1; + var passiveEffectStartTime = 0; + commitErrors = null; + passiveEffectStartTime = now$1(); + if (pendingDelayedCommitReason === ANIMATION_STARTED_COMMIT) + logAnimatingPhase( + commitEndTime, + passiveEffectStartTime, + animatingTask + ); + else { + var startTime = commitEndTime, + endTime = passiveEffectStartTime, + delayedUntilPaint = + pendingDelayedCommitReason === DELAYED_PASSIVE_COMMIT; + !supportsUserTiming || + endTime <= startTime || + (workInProgressUpdateTask + ? workInProgressUpdateTask.run( + console.timeStamp.bind( + console, + delayedUntilPaint ? "Waiting for Paint" : "Waiting", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + ) + ) + : console.timeStamp( + delayedUntilPaint ? "Waiting for Paint" : "Waiting", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + )); + } + startTime = executionContext; + executionContext |= CommitContext; + var finishedWork = priority.current; + resetComponentEffectTimers(); + commitPassiveUnmountOnFiber(finishedWork); + var finishedWork$jscomp$0 = priority.current; + finishedWork = pendingEffectsRenderEndTime; + resetComponentEffectTimers(); + commitPassiveMountOnFiber( + priority, + finishedWork$jscomp$0, + lanes, + transitions, + finishedWork + ); + commitDoubleInvokeEffectsInDEV(priority); + executionContext = startTime; + var passiveEffectsEndTime = now$1(); + finishedWork$jscomp$0 = passiveEffectStartTime; + finishedWork = workInProgressUpdateTask; + null !== commitErrors + ? logCommitErrored( + finishedWork$jscomp$0, + passiveEffectsEndTime, + commitErrors, + !0, + finishedWork + ) + : !supportsUserTiming || + passiveEffectsEndTime <= finishedWork$jscomp$0 || + (finishedWork + ? finishedWork.run( + console.timeStamp.bind( + console, + "Remaining Effects", + finishedWork$jscomp$0, + passiveEffectsEndTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + ) + ) + : console.timeStamp( + "Remaining Effects", + finishedWork$jscomp$0, + passiveEffectsEndTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + )); + finalizeRender(lanes, passiveEffectsEndTime); + flushSyncWorkAcrossRoots_impl(0); + didScheduleUpdateDuringPassiveEffects + ? priority === rootWithPassiveNestedUpdates + ? nestedPassiveUpdateCount++ + : ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = priority)) + : (nestedPassiveUpdateCount = 0); + didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, priority); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %o", + err + )); + } + var stateNode = priority.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + return !0; + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = renderPriority), + releaseRootPooledCache(root, remainingLanes); + } } - function createFiberFromPortal(portal, mode, lanes) { - mode = createFiber( - 4, - null !== portal.children ? portal.children : [], - portal.key, - mode - ); - mode.lanes = lanes; - mode.stateNode = { - containerInfo: portal.containerInfo, - pendingChildren: null, - implementation: portal.implementation - }; - return mode; + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + recordEffectError(sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); + null !== rootFiber && + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } - function FiberRootNode( - containerInfo, - tag, - hydrate, - identifierPrefix, - onUncaughtError, - onCaughtError, - onRecoverableError, - onDefaultTransitionIndicator, - formState + function captureCommitPhaseError( + sourceFiber, + nearestMountedAncestor, + error ) { - this.tag = tag; - this.containerInfo = containerInfo; - this.pingCache = this.current = this.pendingChildren = null; - this.timeoutHandle = noTimeout; - this.callbackNode = - this.next = - this.pendingContext = - this.context = - this.cancelPendingCommit = - null; - this.callbackPriority = 0; - this.expirationTimes = createLaneMap(-1); - this.entangledLanes = - this.shellSuspendCounter = - this.errorRecoveryDisabledLanes = - this.expiredLanes = - this.warmLanes = - this.pingedLanes = - this.suspendedLanes = - this.pendingLanes = - 0; - this.entanglements = createLaneMap(0); - this.hiddenUpdates = createLaneMap(null); - this.identifierPrefix = identifierPrefix; - this.onUncaughtError = onUncaughtError; - this.onCaughtError = onCaughtError; - this.onRecoverableError = onRecoverableError; - this.pooledCache = null; - this.pooledCacheLanes = 0; - this.formState = formState; - this.transitionTypes = null; - this.incompleteTransitions = new Map(); - this.passiveEffectDuration = this.effectDuration = -0; - this.memoizedUpdaters = new Set(); - containerInfo = this.pendingUpdatersLaneMap = []; - for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) - containerInfo.push(new Set()); - switch (tag) { - case 1: - this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; - break; - case 0: - this._debugRootType = hydrate ? "hydrate()" : "render()"; + isRunningInsertionEffect = !1; + if (3 === sourceFiber.tag) + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + else { + for (; null !== nearestMountedAncestor; ) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot( + nearestMountedAncestor, + sourceFiber, + error + ); + return; + } + if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + if ( + "function" === + typeof nearestMountedAncestor.type.getDerivedStateFromError || + ("function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + ) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + recordEffectError(sourceFiber); + error = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error, 2); + null !== instance && + (initializeClassErrorUpdate( + error, + instance, + nearestMountedAncestor, + sourceFiber + ), + markRootUpdated$1(instance, 2), + ensureRootIsScheduled(instance)); + return; + } + } + nearestMountedAncestor = nearestMountedAncestor.return; + } + console.error( + "Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", + error + ); } } - function testStringCoercion(value) { - return "" + value; + function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else + (threadIDs = pingCache.get(wakeable)), + void 0 === threadIDs && + ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || + ((workInProgressRootDidAttachPingListener = !0), + threadIDs.add(lanes), + (pingCache = pingSuspendedRoot.bind(null, root, wakeable, lanes)), + isDevToolsPresent && restorePendingUpdaters(root, lanes), + attachContextPreservingListener(wakeable, pingCache)); } - function createPortal$1(children, containerInfo, implementation) { - var key = - 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - if (null == key) key = null; - else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY; + function attachContextPreservingListener(wakeable, listener) { + if ( + "function" !== typeof Promise || + null !== ReactSharedInternals.actQueue || + isConcurrentActEnvironment() + ) + wakeable.then(listener, listener); else { - try { - testStringCoercion(key); - var JSCompiler_inline_result = !1; - } catch (e$7) { - JSCompiler_inline_result = !0; - } - JSCompiler_inline_result && - (console.error( - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - ("function" === typeof Symbol && - Symbol.toStringTag && - key[Symbol.toStringTag]) || - key.constructor.name || - "Object" - ), - testStringCoercion(key)); - key = "" + key; + var resolve = noop; + new Promise(function (r) { + resolve = r; + }).then(listener); + listener = function () { + return resolve(); + }; + wakeable.then(listener, listener); } - return { - $$typeof: REACT_PORTAL_TYPE, - key: key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; } - function findHostInstanceWithWarning(component, methodName) { - var fiber = component._reactInternals; - if (void 0 === fiber) { - if ("function" === typeof component.render) - throw Error("Unable to find node on an unmounted component."); - component = Object.keys(component).join(","); - throw Error( - "Argument appears to not be a ReactComponent. Keys: " + component + function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; + 0 !== (pingedLanes & 127) + ? 0 > blockingUpdateTime && + ((blockingClampTime = blockingUpdateTime = now()), + (blockingUpdateTask = createTask("Promise Resolved")), + (blockingUpdateType = 2)) + : 0 !== (pingedLanes & 4194048) && + 0 > transitionUpdateTime && + ((transitionClampTime = transitionUpdateTime = now()), + (transitionUpdateTask = createTask("Promise Resolved")), + (transitionUpdateType = 2)); + isConcurrentActEnvironment() && + null === ReactSharedInternals.actQueue && + console.error( + "A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act" ); + workInProgressRoot === root && + (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && + (workInProgressRootExitStatus === RootSuspendedWithDelay || + (workInProgressRootExitStatus === RootSuspended && + (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes && + now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) + ? (executionContext & RenderContext) === NoContext + ? prepareFreshStack(root, 0) + : (workInProgressRootPingedLanes |= pingedLanes) + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); + ensureRootIsScheduled(root); + } + function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && (retryLane = claimNextRetryLane()); + boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + null !== boundaryFiber && + (markRootUpdated$1(boundaryFiber, retryLane), + ensureRootIsScheduled(boundaryFiber)); + } + function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 31: + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + case 22: + retryCache = boundaryFiber.stateNode; + if (null === retryCache) return; + retryCache = retryCache._retryCache; + break; + default: + throw Error( + "Pinged unknown suspense boundary type. This is probably a bug in React." + ); } - component = findCurrentHostFiber(fiber); - if (null === component) return null; - if (component.mode & 8) { - var componentName = getComponentNameFromFiber(fiber) || "Component"; - didWarnAboutFindNodeInStrictMode[componentName] || - ((didWarnAboutFindNodeInStrictMode[componentName] = !0), - runWithFiberInDEV(component, function () { - fiber.mode & 8 - ? console.error( - "%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", - methodName, - methodName, - componentName + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root$jscomp$0, + parentFiber, + isInStrictMode + ) { + if (0 !== (parentFiber.subtreeFlags & 134225920)) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var root = root$jscomp$0, + fiber = parentFiber, + isStrictModeFiber = fiber.type === REACT_STRICT_MODE_TYPE; + isStrictModeFiber = isInStrictMode || isStrictModeFiber; + 22 !== fiber.tag + ? fiber.flags & 134217728 + ? isStrictModeFiber && + runWithFiberInDEV( + fiber, + doubleInvokeEffectsOnFiber, + root, + fiber ) - : console.error( - "%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", - methodName, - methodName, - componentName - ); - })); + : recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + fiber, + isStrictModeFiber + ) + : null === fiber.memoizedState && + (isStrictModeFiber && fiber.flags & 134225920 + ? runWithFiberInDEV( + fiber, + doubleInvokeEffectsOnFiber, + root, + fiber + ) + : fiber.subtreeFlags & 134217728 && + runWithFiberInDEV( + fiber, + recursivelyTraverseAndDoubleInvokeEffectsInDEV, + root, + fiber, + isStrictModeFiber + )); + parentFiber = parentFiber.sibling; + } + } + function doubleInvokeEffectsOnFiber(root, fiber) { + setIsStrictModeForDevtools(!0); + try { + disappearLayoutEffects(fiber), + disconnectPassiveEffect(fiber), + reappearLayoutEffects( + root, + fiber.alternate, + fiber, + NoLayoutEffectTraversalFlags + ), + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); + } finally { + setIsStrictModeForDevtools(!1); } - return getPublicInstance(component.stateNode); } - function updateContainer(element, container, parentComponent, callback) { - var current = container.current, - lane = requestUpdateLane(current); - updateContainerImpl( - current, - lane, - element, - container, - parentComponent, - callback + function commitDoubleInvokeEffectsInDEV(root) { + recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + root.current, + 0 !== (root.current.mode & (StrictLegacyMode | 16)) ); - return lane; } - function updateContainerImpl( - rootFiber, - lane, - element, - container, - parentComponent, - callback - ) { - if ( - injectedHook && - "function" === typeof injectedHook.onScheduleFiberRoot - ) - try { - injectedHook.onScheduleFiberRoot(rendererID, container, element); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), + function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { + if ((executionContext & RenderContext) === NoContext) { + var tag = fiber.tag; + if ( + 3 === tag || + 1 === tag || + 0 === tag || + 11 === tag || + 14 === tag || + 15 === tag + ) { + tag = getComponentNameFromFiber(fiber) || "ReactComponent"; + if (null !== didWarnStateUpdateForNotYetMountedComponent) { + if (didWarnStateUpdateForNotYetMountedComponent.has(tag)) return; + didWarnStateUpdateForNotYetMountedComponent.add(tag); + } else didWarnStateUpdateForNotYetMountedComponent = new Set([tag]); + runWithFiberInDEV(fiber, function () { console.error( - "React instrumentation encountered an error: %o", - err - )); + "Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead." + ); + }); } - parentComponent = emptyContextObject; - null === container.context - ? (container.context = parentComponent) - : (container.pendingContext = parentComponent); - isRendering && - null !== current && - !didWarnAboutNestedUpdates && - ((didWarnAboutNestedUpdates = !0), - console.error( - "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", - getComponentNameFromFiber(current) || "Unknown" - )); - container = createUpdate(lane); - container.payload = { element: element }; - callback = void 0 === callback ? null : callback; - null !== callback && - ("function" !== typeof callback && - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - ), - (container.callback = callback)); - element = enqueueUpdate(rootFiber, container, lane); - null !== element && - (startUpdateTimerByLane(lane, "root.render()", null), - scheduleUpdateOnFiber(element, rootFiber, lane), - entangleTransitions(element, rootFiber, lane)); - } - function getCurrentFiberForDevTools() { - return current; - } - function getNodeFromInternalInstanceHandle(internalInstanceHandle) { - return ( - internalInstanceHandle && - internalInstanceHandle.stateNode && - internalInstanceHandle.stateNode.node - ); + } } - function shim$1() { - throw Error( - "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." - ); + function restorePendingUpdaters(root, lanes) { + isDevToolsPresent && + root.memoizedUpdaters.forEach(function (schedulingFiber) { + addFiberToLanesMap(root, schedulingFiber, lanes); + }); } - function shim() { - throw Error( - "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." - ); + function scheduleCallback(priorityLevel, callback) { + var actQueue = ReactSharedInternals.actQueue; + return null !== actQueue + ? (actQueue.push(callback), fakeActCallbackNode) + : scheduleCallback$3(priorityLevel, callback); } - function ViewTransitionPseudoElement(pseudo, name) { - this._pseudo = pseudo; - this._name = name; + function warnIfUpdatesNotWrappedWithActDEV(fiber) { + isConcurrentActEnvironment() && + null === ReactSharedInternals.actQueue && + runWithFiberInDEV(fiber, function () { + console.error( + "An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act", + getComponentNameFromFiber(fiber) + ); + }); } - function measureClonedInstance() { - console.warn("measureClonedInstance is not implemented"); - return { - rect: { x: 0, y: 0, width: 0, height: 0 }, - abs: !1, - clip: !1, - view: !0 - }; + function resolveTypeForHotReloading(type) { + if (null === resolveFamily) return type; + var family = resolveFamily(type); + return void 0 === family ? type : family.current; } - function createViewTransitionInstance(name) { - var tag = allocateTag(); - fabricCreateViewTransitionInstance(name, tag); - return { - name: name, - old: new ViewTransitionPseudoElement("old", name), - new: new ViewTransitionPseudoElement("new", name) - }; + function isCompatibleFamilyForHotReloading(fiber, element) { + if (null === resolveFamily) return !1; + var resolve = resolveFamily, + prevType = fiber.elementType; + element = element.type; + var needsCompareFamilies = !1, + $$typeofNextType = + "object" === typeof element && null !== element + ? element.$$typeof + : null; + switch (fiber.tag) { + case 1: + "function" === typeof element && (needsCompareFamilies = !0); + break; + case 0: + "function" === typeof element + ? (needsCompareFamilies = !0) + : $$typeofNextType === REACT_LAZY_TYPE && + (needsCompareFamilies = !0); + break; + case 11: + $$typeofNextType === REACT_FORWARD_REF_TYPE + ? (needsCompareFamilies = !0) + : $$typeofNextType === REACT_LAZY_TYPE && + (needsCompareFamilies = !0); + break; + case 14: + case 15: + $$typeofNextType === REACT_MEMO_TYPE + ? (needsCompareFamilies = !0) + : $$typeofNextType === REACT_LAZY_TYPE && + (needsCompareFamilies = !0); + break; + default: + return !1; + } + return needsCompareFamilies && + ((fiber = resolve(prevType)), + void 0 !== fiber && fiber === resolve(element)) + ? !0 + : !1; } - function startViewTransition( - suspendedState, - rootContainer, - transitionTypes, - mutationCallback, - layoutCallback, - afterMutationCallback, - spawnedWorkCallback, - passiveCallback + function markFailedErrorBoundaryForHotReloading(fiber) { + null !== resolveFamily && + "function" === typeof WeakSet && + (null === failedBoundaries && (failedBoundaries = new WeakSet()), + failedBoundaries.add(fiber)); + } + function scheduleFibersWithFamiliesRecursively( + fiber, + updatedFamilies, + staleFamilies ) { - suspendedState = fabricStartViewTransition(function () { - mutationCallback(); - layoutCallback(); - afterMutationCallback(); - }); - if (null == suspendedState) - return ( - console.warn( - "startViewTransition didn't kick off transition in Fabric, the ViewTransition ReactNativeFeatureFlag might not be enabled." - ), - mutationCallback(), - layoutCallback(), - spawnedWorkCallback(), - null - ); - suspendedState.ready.then(function () { - spawnedWorkCallback(); - fabricStartViewTransitionReadyFinished(); - }); - suspendedState.finished.finally(function () { - passiveCallback(); - }); - return suspendedState; + do { + var _fiber = fiber, + alternate = _fiber.alternate, + child = _fiber.child, + sibling = _fiber.sibling, + tag = _fiber.tag, + type = _fiber.type, + elementType = _fiber.elementType, + candidateType = null; + _fiber = null; + switch (tag) { + case 0: + case 1: + candidateType = type; + break; + case 15: + candidateType = type; + _fiber = elementType; + break; + case 14: + _fiber = elementType; + break; + case 11: + (candidateType = type.render), (_fiber = elementType); + } + if (null === resolveFamily) + throw Error("Expected resolveFamily to be set during hot reload."); + var resolve = resolveFamily; + type = elementType = !1; + null !== candidateType && + ((candidateType = resolve(candidateType)), + void 0 !== candidateType && + (staleFamilies.has(candidateType) + ? (type = !0) + : updatedFamilies.has(candidateType) && + (1 === tag ? (type = !0) : (elementType = !0)))); + type || + null === _fiber || + ((tag = resolve(_fiber)), + void 0 !== tag && staleFamilies.has(tag) + ? (type = !0) + : "object" === typeof _fiber && + _fiber.$$typeof === REACT_LAZY_TYPE && + ((tag = _fiber._payload), + 1 === tag._status && + ((tag = resolve(tag._result.default)), + void 0 !== tag && staleFamilies.has(tag) && (type = !0)))); + null !== failedBoundaries && + (failedBoundaries.has(fiber) || + (null !== alternate && failedBoundaries.has(alternate))) && + (type = !0); + type && (fiber._debugNeedsRemount = !0); + if (type || elementType) + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); + null === child || + type || + scheduleFibersWithFamiliesRecursively( + child, + updatedFamilies, + staleFamilies + ); + if (null === sibling) break; + fiber = sibling; + } while (1); } - function allocateTag() { - var tag = nextReactTag; - nextReactTag += 2; - return tag; + function FiberNode(tag, pendingProps, key, mode) { + this.tag = tag; + this.key = key; + this.sibling = + this.child = + this.return = + this.stateNode = + this.type = + this.elementType = + null; + this.index = 0; + this.refCleanup = this.ref = null; + this.pendingProps = pendingProps; + this.dependencies = + this.memoizedState = + this.updateQueue = + this.memoizedProps = + null; + this.mode = mode; + this.subtreeFlags = this.flags = 0; + this.deletions = null; + this.childLanes = this.lanes = 0; + this.alternate = null; + this.actualDuration = -0; + this.actualStartTime = -1.1; + this.treeBaseDuration = this.selfBaseDuration = -0; + this._debugTask = + this._debugStack = + this._debugOwner = + this._debugInfo = + null; + this._debugNeedsRemount = !1; + this._debugHookTypes = null; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(this); } - function createTextInstance( - text, - rootContainerInstance, - hostContext, - internalInstanceHandle - ) { - hostContext.isInAParentText || - console.error( - "Text strings must be rendered within a component." - ); - hostContext = allocateTag(); - return { - node: createNode( - hostContext, - "RCTRawText", - rootContainerInstance.containerTag, - { text: text }, - internalInstanceHandle - ) - }; + function shouldConstruct(Component) { + Component = Component.prototype; + return !(!Component || !Component.isReactComponent); + } + function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + null === workInProgress + ? ((workInProgress = createFiber( + current.tag, + pendingProps, + current.key, + current.mode + )), + (workInProgress.elementType = current.elementType), + (workInProgress.type = current.type), + (workInProgress.stateNode = current.stateNode), + (workInProgress._debugOwner = current._debugOwner), + (workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask), + (workInProgress._debugHookTypes = current._debugHookTypes), + (workInProgress.alternate = current), + (current.alternate = workInProgress)) + : ((workInProgress.pendingProps = pendingProps), + (workInProgress.type = current.type), + (workInProgress.flags = 0), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null), + (workInProgress.actualDuration = -0), + (workInProgress.actualStartTime = -1.1)); + workInProgress.flags = current.flags & 1206910976; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + pendingProps = current.dependencies; + workInProgress.dependencies = + null === pendingProps + ? null + : { + lanes: pendingProps.lanes, + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState + }; + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + workInProgress.refCleanup = current.refCleanup; + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + workInProgress._debugInfo = current._debugInfo; + workInProgress._debugNeedsRemount = current._debugNeedsRemount; + switch (workInProgress.tag) { + case 0: + case 15: + case 14: + case 1: + case 11: + workInProgress.type = resolveTypeForHotReloading(current.type); + } + return workInProgress; + } + function resetWorkInProgress(workInProgress, renderLanes) { + workInProgress.flags &= 1206910978; + var current = workInProgress.alternate; + null === current + ? ((workInProgress.childLanes = 0), + (workInProgress.lanes = renderLanes), + (workInProgress.child = null), + (workInProgress.subtreeFlags = 0), + (workInProgress.memoizedProps = null), + (workInProgress.memoizedState = null), + (workInProgress.updateQueue = null), + (workInProgress.dependencies = null), + (workInProgress.stateNode = null), + (workInProgress.selfBaseDuration = 0), + (workInProgress.treeBaseDuration = 0)) + : ((workInProgress.childLanes = current.childLanes), + (workInProgress.lanes = current.lanes), + (workInProgress.child = current.child), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null), + (workInProgress.memoizedProps = current.memoizedProps), + (workInProgress.memoizedState = current.memoizedState), + (workInProgress.updateQueue = current.updateQueue), + (workInProgress.type = current.type), + (renderLanes = current.dependencies), + (workInProgress.dependencies = + null === renderLanes + ? null + : { + lanes: renderLanes.lanes, + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState + }), + (workInProgress.selfBaseDuration = current.selfBaseDuration), + (workInProgress.treeBaseDuration = current.treeBaseDuration)); + return workInProgress; } - function getPublicInstance(instance) { - if (null != instance.canonical) { - if (null == instance.canonical.publicInstance) { - var $jscomp$nullish$tmp0; - instance.canonical.publicInstance = - reactPrivateInterface.createPublicInstance( - instance.canonical.nativeTag, - instance.canonical.viewConfig, - instance.canonical.internalInstanceHandle, - null != - ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) - ? $jscomp$nullish$tmp0 - : null + function createFiberFromTypeAndProps( + type, + key, + pendingProps, + owner, + mode, + lanes + ) { + var fiberTag = 0; + var resolvedType = resolveTypeForHotReloading(type); + if ("function" === typeof resolvedType) + shouldConstruct(resolvedType) && (fiberTag = 1); + else if ("string" === typeof resolvedType) fiberTag = 5; + else + a: switch (resolvedType) { + case REACT_ACTIVITY_TYPE: + return ( + (key = createFiber(31, pendingProps, key, mode)), + (key.elementType = REACT_ACTIVITY_TYPE), + (key.lanes = lanes), + key ); - instance.canonical.publicRootInstance = null; + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment( + pendingProps.children, + mode, + lanes, + key + ); + case REACT_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= StrictLegacyMode | 16; + break; + case REACT_PROFILER_TYPE: + return ( + (type = pendingProps), + (owner = mode), + "string" !== typeof type.id && + console.error( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', + typeof type.id + ), + (key = createFiber(12, type, key, owner | 2)), + (key.elementType = REACT_PROFILER_TYPE), + (key.lanes = lanes), + (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), + key + ); + case REACT_SUSPENSE_TYPE: + return ( + (key = createFiber(13, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_TYPE), + (key.lanes = lanes), + key + ); + case REACT_SUSPENSE_LIST_TYPE: + return ( + (key = createFiber(19, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_LIST_TYPE), + (key.lanes = lanes), + key + ); + case REACT_LEGACY_HIDDEN_TYPE: + case REACT_VIEW_TRANSITION_TYPE: + return ( + (type = mode | 32), + (key = createFiber(30, pendingProps, key, type)), + (key.elementType = REACT_VIEW_TRANSITION_TYPE), + (key.lanes = lanes), + (key.stateNode = { + autoName: null, + paired: null, + clones: null, + ref: null + }), + key + ); + default: + if ("object" === typeof resolvedType && null !== resolvedType) + switch (resolvedType.$$typeof) { + case REACT_CONTEXT_TYPE: + fiberTag = 10; + break a; + case REACT_CONSUMER_TYPE: + fiberTag = 9; + break a; + case REACT_FORWARD_REF_TYPE: + fiberTag = 11; + break a; + case REACT_MEMO_TYPE: + fiberTag = 14; + break a; + case REACT_LAZY_TYPE: + fiberTag = 16; + resolvedType = null; + break a; + } + pendingProps = ""; + if ( + void 0 === type || + ("object" === typeof type && + null !== type && + 0 === Object.keys(type).length) + ) + pendingProps += + " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; + null === type + ? (resolvedType = "null") + : isArrayImpl(type) + ? (resolvedType = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((resolvedType = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (pendingProps = + " Did you accidentally export a JSX literal instead of a component?")) + : (resolvedType = typeof type); + fiberTag = owner + ? "number" === typeof owner.tag + ? getComponentNameFromFiber(owner) + : "string" === typeof owner.name + ? owner.name + : null + : null; + fiberTag && + (pendingProps += + "\n\nCheck the render method of `" + fiberTag + "`."); + fiberTag = 29; + pendingProps = Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + + (resolvedType + "." + pendingProps) + ); + resolvedType = null; } - return instance.canonical.publicInstance; - } - return null != instance.containerInfo - ? instance.containerInfo.publicInstance - : null; - } - function getPublicInstanceFromHostFiber(fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null === fiber) - throw Error("Expected to find a host node. This is a bug in React."); - return fiber; + key = createFiber(fiberTag, pendingProps, key, mode); + key.elementType = type; + key.type = resolvedType; + key.lanes = lanes; + key._debugOwner = owner; + return key; } - function resolveUpdatePriority() { - if (0 !== currentUpdatePriority) return currentUpdatePriority; - var currentEventPriority = fabricGetCurrentEventPriority - ? fabricGetCurrentEventPriority() - : null; - if (null != currentEventPriority) - switch (currentEventPriority) { - case FabricDiscretePriority: - return DiscreteEventPriority; - case FabricContinuousPriority: - return ContinuousEventPriority; - case FabricIdlePriority: - return IdleEventPriority; - } - return DefaultEventPriority; + function createFiberFromElement(element, mode, lanes) { + mode = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + element._owner, + mode, + lanes + ); + mode._debugOwner = element._owner; + mode._debugStack = element._debugStack; + mode._debugTask = element._debugTask; + return mode; } - function resolveEventType() { - var event = global.event; - event && event !== schedulerEvent - ? event.type - ? (event = event.type) - : ((event = event.dispatchConfig), - (event = - null == event || null == event.phasedRegistrationNames - ? null - : (event = - event.phasedRegistrationNames.bubbled || - event.phasedRegistrationNames.captured) - ? event.startsWith("on") - ? event.slice(2).toLowerCase() - : event.toLowerCase() - : null)) - : (event = null); - return event; + function createFiberFromFragment(elements, mode, lanes, key) { + elements = createFiber(7, elements, key, mode); + elements.lanes = lanes; + return elements; } - function resolveEventTimeStamp() { - var event = global.event; - return event && event !== schedulerEvent ? event.timeStamp : -1.1; + function createFiberFromText(content, mode, lanes) { + content = createFiber(6, content, null, mode); + content.lanes = lanes; + return content; } - function cloneHiddenInstance(instance) { - var node = instance.node, - updatePayload = reactPrivateInterface.createAttributePayload( - { style: { display: "none" } }, - instance.canonical.viewConfig.validAttributes - ); - return { - node: cloneNodeWithNewProps(node, updatePayload), - canonical: instance.canonical + function createFiberFromPortal(portal, mode, lanes) { + mode = createFiber( + 4, + null !== portal.children ? portal.children : [], + portal.key, + mode + ); + mode.lanes = lanes; + mode.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + implementation: portal.implementation }; + return mode; } - function replaceContainerChildren(container, newChildren) { - completeRoot(container.containerTag, newChildren); - } - function FragmentInstance(fragmentFiber) { - this._fragmentFiber = fragmentFiber; - this._observers = null; - } - function observeChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.observe(child); - return !1; - } - function unobserveChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.unobserve(child); - return !1; + function FiberRootNode( + containerInfo, + hydrate, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + onDefaultTransitionIndicator, + formState + ) { + this.tag = 1; + this.containerInfo = containerInfo; + this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.callbackNode = + this.next = + this.pendingContext = + this.context = + this.cancelPendingCommit = + null; + this.callbackPriority = 0; + this.expirationTimes = createLaneMap(-1); + this.entangledLanes = + this.shellSuspendCounter = + this.errorRecoveryDisabledLanes = + this.expiredLanes = + this.warmLanes = + this.pingedLanes = + this.suspendedLanes = + this.pendingLanes = + 0; + this.entanglements = createLaneMap(0); + this.hiddenUpdates = createLaneMap(null); + this.identifierPrefix = identifierPrefix; + this.onUncaughtError = onUncaughtError; + this.onCaughtError = onCaughtError; + this.onRecoverableError = onRecoverableError; + this.pooledCache = null; + this.pooledCacheLanes = 0; + this.formState = formState; + this.transitionTypes = null; + this.incompleteTransitions = new Map(); + this.passiveEffectDuration = this.effectDuration = -0; + this.memoizedUpdaters = new Set(); + containerInfo = this.pendingUpdatersLaneMap = []; + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) + containerInfo.push(new Set()); + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; } - function collectChildren(child, collection) { - collection.push(child); - return !1; + function testStringCoercion(value) { + return "" + value; } - function collectClientRects(child, rects) { - child = getPublicInstanceFromHostFiber(child); - rects.push(child.getBoundingClientRect()); - return !1; + function createPortal$1(children, containerInfo, implementation) { + var key = + 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; + if (null == key) key = null; + else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY; + else { + try { + testStringCoercion(key); + var JSCompiler_inline_result = !1; + } catch (e$7) { + JSCompiler_inline_result = !0; + } + JSCompiler_inline_result && + (console.error( + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + ("function" === typeof Symbol && + Symbol.toStringTag && + key[Symbol.toStringTag]) || + key.constructor.name || + "Object" + ), + testStringCoercion(key)); + key = "" + key; + } + return { + $$typeof: REACT_PORTAL_TYPE, + key: key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; } - function addFragmentHandleToFiber(child, fragmentInstance) { - child = getPublicInstanceFromHostFiber(child); - null != child && addFragmentHandleToInstance(child, fragmentInstance); - return !1; + function findHostInstanceWithWarning(component, methodName) { + var fiber = component._reactInternals; + if (void 0 === fiber) { + if ("function" === typeof component.render) + throw Error("Unable to find node on an unmounted component."); + component = Object.keys(component).join(","); + throw Error( + "Argument appears to not be a ReactComponent. Keys: " + component + ); + } + component = findCurrentHostFiber(fiber); + if (null === component) return null; + if (component.mode & StrictLegacyMode) { + var componentName = getComponentNameFromFiber(fiber) || "Component"; + didWarnAboutFindNodeInStrictMode[componentName] || + ((didWarnAboutFindNodeInStrictMode[componentName] = !0), + runWithFiberInDEV(component, function () { + fiber.mode & StrictLegacyMode + ? console.error( + "%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", + methodName, + methodName, + componentName + ) + : console.error( + "%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", + methodName, + methodName, + componentName + ); + })); + } + return getPublicInstance(component.stateNode); } - function addFragmentHandleToInstance(instance, fragmentInstance) { - null == instance.reactFragments && (instance.reactFragments = new Set()); - instance.reactFragments.add(fragmentInstance); + function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; } - function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { - if (null != childInstance.canonical) { - var publicInstance = getPublicInstance(childInstance); - if (null !== fragmentInstance._observers) { - if (null == publicInstance) - throw Error( - "Expected to find a host node. This is a bug in React." - ); - fragmentInstance._observers.forEach(function (observer) { - observer.observe(publicInstance); - }); + function updateContainerImpl( + rootFiber, + lane, + element, + container, + parentComponent, + callback + ) { + if ( + injectedHook && + "function" === typeof injectedHook.onScheduleFiberRoot + ) + try { + injectedHook.onScheduleFiberRoot(rendererID, container, element); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %o", + err + )); } - addFragmentHandleToInstance(publicInstance, fragmentInstance); - } + parentComponent = emptyContextObject; + null === container.context + ? (container.context = parentComponent) + : (container.pendingContext = parentComponent); + isRendering && + null !== current && + !didWarnAboutNestedUpdates && + ((didWarnAboutNestedUpdates = !0), + console.error( + "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", + getComponentNameFromFiber(current) || "Unknown" + )); + container = createUpdate(lane); + container.payload = { element: element }; + callback = void 0 === callback ? null : callback; + null !== callback && + ("function" !== typeof callback && + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + ), + (container.callback = callback)); + element = enqueueUpdate(rootFiber, container, lane); + null !== element && + (startUpdateTimerByLane(lane, "root.render()", null), + scheduleUpdateOnFiber(element, rootFiber, lane), + entangleTransitions(element, rootFiber, lane)); + } + function getCurrentFiberForDevTools() { + return current; } function nativeOnUncaughtError(error, errorInfo) { !1 !== @@ -17384,14 +16516,62 @@ __DEV__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - require("react-native/setup-env"); var React = require("react"), reactPrivateInterface = require("react-native/react-private-interface"), Scheduler = require("scheduler"), + assign = Object.assign, + REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); + Symbol.for("react.scope"); + var REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); + Symbol.for("react.tracing_marker"); + var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), + REACT_RECOVERABLE_TYPE = Symbol.for("react.recoverable"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator, + REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - assign = Object.assign, + isInsideEventHandler = !1, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + cancelCallback$1 = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now$1 = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority$1 = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority, + log$1 = Scheduler.log, + unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + rendererID = null, + injectedHook = null, + hasLoggedError = !1, + isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, + clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2, + nextTransitionUpdateLane = 256, + nextTransitionDeferredLane = 262144, + nextRetryLane = 4194304, + DiscreteEventPriority = 2, + ContinuousEventPriority = 8, + DefaultEventPriority = 32, + IdleEventPriority = 268435456, disabledDepth = 0, prevLog, prevInfo, @@ -17407,689 +16587,286 @@ __DEV__ && var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map )(); - var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"); - Symbol.for("react.scope"); - var REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); - Symbol.for("react.tracing_marker"); - var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), - REACT_RECOVERABLE_TYPE = Symbol.for("react.recoverable"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"), - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - current = null, + var current = null, isRendering = !1, - hasError = !1, - caughtError = null, - getFiberCurrentPropsFromNode$1 = null, - getInstanceFromNode$1 = null, - getNodeFromInstance$1 = null; - assign(SyntheticEvent.prototype, { - preventDefault: function () { - this.defaultPrevented = !0; - var event = this.nativeEvent; - event && - (event.preventDefault - ? event.preventDefault() - : "unknown" !== typeof event.returnValue && - (event.returnValue = !1), - (this.isDefaultPrevented = functionThatReturnsTrue)); - }, - stopPropagation: function () { - var event = this.nativeEvent; - event && - (event.stopPropagation - ? event.stopPropagation() - : "unknown" !== typeof event.cancelBubble && - (event.cancelBubble = !0), - (this.isPropagationStopped = functionThatReturnsTrue)); - }, - persist: function () { - this.isPersistent = functionThatReturnsTrue; - }, - isPersistent: functionThatReturnsFalse, - destructor: function () { - var Interface = this.constructor.Interface, - propName; - for (propName in Interface) - Object.defineProperty( - this, - propName, - getPooledWarningPropertyDefinition(propName, Interface[propName]) - ); - this.nativeEvent = this._targetInst = this.dispatchConfig = null; - this.isPropagationStopped = this.isDefaultPrevented = - functionThatReturnsFalse; - this._dispatchInstances = this._dispatchListeners = null; - Object.defineProperty( - this, - "nativeEvent", - getPooledWarningPropertyDefinition("nativeEvent", null) - ); - Object.defineProperty( - this, - "isDefaultPrevented", - getPooledWarningPropertyDefinition( - "isDefaultPrevented", - functionThatReturnsFalse - ) - ); - Object.defineProperty( - this, - "isPropagationStopped", - getPooledWarningPropertyDefinition( - "isPropagationStopped", - functionThatReturnsFalse - ) - ); - Object.defineProperty( - this, - "preventDefault", - getPooledWarningPropertyDefinition("preventDefault", function () {}) - ); - Object.defineProperty( - this, - "stopPropagation", - getPooledWarningPropertyDefinition("stopPropagation", function () {}) - ); - } - }); - SyntheticEvent.Interface = { - type: null, - target: null, - currentTarget: function () { - return null; - }, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function (event) { - return event.timeStamp || event.timestamp || currentTimeStamp(); - }, - defaultPrevented: null, - isTrusted: null - }; - SyntheticEvent.extend = function (Interface) { - function E() {} - function Class() { - return Super.apply(this, arguments); + emptyObject = Object.freeze({}); + var getInspectorDataForInstance = function (closestInstance) { + if (!closestInstance) + return { + hierarchy: [], + props: emptyObject, + selectedIndex: null, + componentStack: "" + }; + closestInstance = findCurrentFiberUsingSlowPath(closestInstance); + if (null === closestInstance) + return { + hierarchy: [], + props: emptyObject, + selectedIndex: null, + componentStack: "" + }; + var hierarchy = []; + traverseOwnerTreeUp(hierarchy, closestInstance); + var instance; + a: { + for (instance = hierarchy.length - 1; 1 < instance; instance--) { + var instance$jscomp$0 = hierarchy[instance]; + if (5 !== instance$jscomp$0.tag) { + instance = instance$jscomp$0; + break a; + } + } + instance = hierarchy[0]; } - var Super = this; - E.prototype = Super.prototype; - var prototype = new E(); - assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - Class.Interface = assign({}, Super.Interface, Interface); - Class.extend = Super.extend; - addEventPoolingTo(Class); - return Class; + instance$jscomp$0 = createHierarchy(hierarchy); + var props = getHostProps(instance); + hierarchy = hierarchy.indexOf(instance); + closestInstance = getStackByFiberInDevAndProd(closestInstance); + return { + closestInstance: instance, + hierarchy: instance$jscomp$0, + props: props, + selectedIndex: hierarchy, + componentStack: closestInstance + }; }; - addEventPoolingTo(SyntheticEvent); - var ResponderSyntheticEvent = SyntheticEvent.extend({ - touchHistory: function () { - return null; - } - }), - startDependencies = ["topTouchStart"], - moveDependencies = ["topTouchMove"], - endDependencies = ["topTouchCancel", "topTouchEnd"], - touchBank = [], - touchHistory = { - touchBank: touchBank, - numberActiveTouches: 0, - indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 - }, - instrumentationCallback, - ResponderTouchHistoryStore = { - instrument: function (callback) { - instrumentationCallback = callback; - }, - recordTouchTrack: function (topLevelType, nativeEvent) { - null != instrumentationCallback && - instrumentationCallback(topLevelType, nativeEvent); - if (isMoveish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchMove); - else if (isStartish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchStart), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches && - (touchHistory.indexOfSingleActiveTouch = - nativeEvent.touches[0].identifier); - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if ( - (nativeEvent.changedTouches.forEach(recordTouchEnd), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches) - ) { - for ( - topLevelType = 0; - topLevelType < touchBank.length; - topLevelType++ - ) - if ( - ((nativeEvent = touchBank[topLevelType]), - null != nativeEvent && nativeEvent.touchActive) - ) { - touchHistory.indexOfSingleActiveTouch = topLevelType; - break; - } - topLevelType = touchBank[touchHistory.indexOfSingleActiveTouch]; - (null != topLevelType && topLevelType.touchActive) || - console.error("Cannot find single active touch."); - } - }, - touchHistory: touchHistory - }, - responderInst = null, - trackedTouchCount = 0, - eventTypes = { - startShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onStartShouldSetResponder", - captured: "onStartShouldSetResponderCapture" - }, - dependencies: startDependencies - }, - scrollShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onScrollShouldSetResponder", - captured: "onScrollShouldSetResponderCapture" - }, - dependencies: ["topScroll"] - }, - selectionChangeShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onSelectionChangeShouldSetResponder", - captured: "onSelectionChangeShouldSetResponderCapture" - }, - dependencies: ["topSelectionChange"] - }, - moveShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onMoveShouldSetResponder", - captured: "onMoveShouldSetResponderCapture" - }, - dependencies: moveDependencies - }, - responderStart: { - registrationName: "onResponderStart", - dependencies: startDependencies - }, - responderMove: { - registrationName: "onResponderMove", - dependencies: moveDependencies - }, - responderEnd: { - registrationName: "onResponderEnd", - dependencies: endDependencies - }, - responderRelease: { - registrationName: "onResponderRelease", - dependencies: endDependencies - }, - responderTerminationRequest: { - registrationName: "onResponderTerminationRequest", - dependencies: [] - }, - responderGrant: { - registrationName: "onResponderGrant", - dependencies: [] - }, - responderReject: { - registrationName: "onResponderReject", - dependencies: [] - }, - responderTerminate: { - registrationName: "onResponderTerminate", - dependencies: [] - } - }, - ResponderEventPlugin = { - _getResponder: function () { - return responderInst; - }, - eventTypes: eventTypes, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget + var isSuspenseInstancePending = shim$1, + isSuspenseInstanceFallback = shim$1, + getSuspenseInstanceFallbackErrorDetails = shim$1, + registerSuspenseInstanceRetry = shim$1, + commitHydratedInstance = shim$1, + preloadResource = shim, + suspendResource = shim, + fabricCreateViewTransitionInstance = + reactPrivateInterface.fabricUIManager.createViewTransitionInstance, + fabricStartViewTransition = + reactPrivateInterface.fabricUIManager.startViewTransition, + fabricStartViewTransitionReadyFinished = + reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished, + createNode = reactPrivateInterface.fabricUIManager.createNode, + cloneNodeWithNewChildren = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, + createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, + appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, + appendChildNodeToSet = + reactPrivateInterface.fabricUIManager.appendChildToSet, + completeRoot$1 = reactPrivateInterface.fabricUIManager.completeRoot, + registerEventHandler = + reactPrivateInterface.fabricUIManager.registerEventHandler, + FabricDiscretePriority = + reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, + FabricContinuousPriority = + reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, + FabricIdlePriority = + reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, + fabricGetCurrentEventPriority = + reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, + fabricSuspendOnActiveViewTransition = + reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, + extraDevToolsConfig = { + getInspectorDataForInstance: getInspectorDataForInstance, + getInspectorDataForViewAtPoint: function ( + inspectedView, + locationX, + locationY, + callback ) { - if (isStartish(topLevelType)) trackedTouchCount += 1; - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if (0 <= trackedTouchCount) --trackedTouchCount; - else - return ( - console.warn( - "Ended a touch event which was not counted in `trackedTouchCount`." - ), - null - ); - ResponderTouchHistoryStore.recordTouchTrack( - topLevelType, - nativeEvent - ); - if ( - targetInst && - (("topScroll" === topLevelType && - !nativeEvent.responderIgnoreScroll) || - (0 < trackedTouchCount && - "topSelectionChange" === topLevelType) || - isStartish(topLevelType) || - isMoveish(topLevelType)) - ) { - var shouldSetEventType = isStartish(topLevelType) - ? eventTypes.startShouldSetResponder - : isMoveish(topLevelType) - ? eventTypes.moveShouldSetResponder - : "topSelectionChange" === topLevelType - ? eventTypes.selectionChangeShouldSetResponder - : eventTypes.scrollShouldSetResponder; - if (responderInst) - b: { - var JSCompiler_temp = responderInst; - for ( - var depthA = 0, tempA = JSCompiler_temp; - tempA; - tempA = getParent$1(tempA) - ) - depthA++; - tempA = 0; - for (var tempB = targetInst; tempB; tempB = getParent$1(tempB)) - tempA++; - for (; 0 < depthA - tempA; ) - (JSCompiler_temp = getParent$1(JSCompiler_temp)), depthA--; - for (; 0 < tempA - depthA; ) - (targetInst = getParent$1(targetInst)), tempA--; - for (; depthA--; ) { - if ( - JSCompiler_temp === targetInst || - JSCompiler_temp === targetInst.alternate - ) - break b; - JSCompiler_temp = getParent$1(JSCompiler_temp); - targetInst = getParent$1(targetInst); - } - JSCompiler_temp = null; - } - else JSCompiler_temp = targetInst; - targetInst = JSCompiler_temp === responderInst; - JSCompiler_temp = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - JSCompiler_temp, - nativeEvent, - nativeEventTarget - ); - JSCompiler_temp.touchHistory = - ResponderTouchHistoryStore.touchHistory; - targetInst - ? forEachAccumulated( - JSCompiler_temp, - accumulateTwoPhaseDispatchesSingleSkipTarget - ) - : forEachAccumulated( - JSCompiler_temp, - accumulateTwoPhaseDispatchesSingle$1 - ); - b: { - shouldSetEventType = JSCompiler_temp._dispatchListeners; - targetInst = JSCompiler_temp._dispatchInstances; - validateEventDispatches(JSCompiler_temp); - if (isArrayImpl(shouldSetEventType)) - for ( - depthA = 0; - depthA < shouldSetEventType.length && - !JSCompiler_temp.isPropagationStopped(); - depthA++ - ) { - if ( - shouldSetEventType[depthA]( - JSCompiler_temp, - targetInst[depthA] - ) - ) { - shouldSetEventType = targetInst[depthA]; - break b; - } - } - else if ( - shouldSetEventType && - shouldSetEventType(JSCompiler_temp, targetInst) - ) { - shouldSetEventType = targetInst; - break b; - } - shouldSetEventType = null; - } - JSCompiler_temp._dispatchInstances = null; - JSCompiler_temp._dispatchListeners = null; - JSCompiler_temp.isPersistent() || - JSCompiler_temp.constructor.release(JSCompiler_temp); - if (shouldSetEventType && shouldSetEventType !== responderInst) - if ( - ((JSCompiler_temp = ResponderSyntheticEvent.getPooled( - eventTypes.responderGrant, - shouldSetEventType, - nativeEvent, - nativeEventTarget - )), - (JSCompiler_temp.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - JSCompiler_temp, - accumulateDirectDispatchesSingle$1 - ), - (targetInst = !0 === executeDirectDispatch(JSCompiler_temp)), - responderInst) - ) - if ( - ((depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminationRequest, - responderInst, - nativeEvent, - nativeEventTarget - )), - (depthA.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - depthA, - accumulateDirectDispatchesSingle$1 - ), - (tempA = - !depthA._dispatchListeners || - executeDirectDispatch(depthA)), - depthA.isPersistent() || depthA.constructor.release(depthA), - tempA) - ) { - depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminate, - responderInst, - nativeEvent, - nativeEventTarget - ); - depthA.touchHistory = ResponderTouchHistoryStore.touchHistory; - forEachAccumulated( - depthA, - accumulateDirectDispatchesSingle$1 - ); - var JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - [JSCompiler_temp, depthA] - ); - changeResponder(shouldSetEventType, targetInst); - } else - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - eventTypes.responderReject, - shouldSetEventType, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - else - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - JSCompiler_temp - )), - changeResponder(shouldSetEventType, targetInst); - else JSCompiler_temp$jscomp$0 = null; - } else JSCompiler_temp$jscomp$0 = null; - shouldSetEventType = responderInst && isStartish(topLevelType); - JSCompiler_temp = responderInst && isMoveish(topLevelType); - targetInst = - responderInst && - ("topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType); - if ( - (shouldSetEventType = shouldSetEventType - ? eventTypes.responderStart - : JSCompiler_temp - ? eventTypes.responderMove - : targetInst - ? eventTypes.responderEnd - : null) - ) - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - shouldSetEventType = - responderInst && "topTouchCancel" === topLevelType; - if ( - (topLevelType = - responderInst && - !shouldSetEventType && - ("topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType)) - ) - a: { - if ( - (topLevelType = nativeEvent.touches) && - 0 !== topLevelType.length - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < topLevelType.length; - JSCompiler_temp++ - ) - if ( - ((targetInst = topLevelType[JSCompiler_temp].target), - null !== targetInst && - void 0 !== targetInst && - 0 !== targetInst) - ) { - depthA = getInstanceFromNode$1(targetInst); - b: { - for (targetInst = responderInst; depthA; ) { - if ( - targetInst === depthA || - targetInst === depthA.alternate - ) { - targetInst = !0; - break b; - } - depthA = getParent$1(depthA); + var closestInstance = null; + (inspectedView = + reactPrivateInterface.getNodeFromPublicInstance(inspectedView)) + ? reactPrivateInterface.fabricUIManager.findNodeAtPoint( + inspectedView, + locationX, + locationY, + function (internalInstanceHandle) { + var node = + null != internalInstanceHandle + ? getNodeFromInternalInstanceHandle( + internalInstanceHandle + ) + : null; + if (null == internalInstanceHandle || null == node) + callback( + assign( + { + pointerY: locationY, + frame: { left: 0, top: 0, width: 0, height: 0 } + }, + getInspectorDataForInstance(closestInstance) + ) + ); + else { + closestInstance = + internalInstanceHandle.stateNode.canonical + .internalInstanceHandle; + var closestPublicInstance = + internalInstanceHandle.stateNode.canonical + .publicInstance, + nativeViewTag = + internalInstanceHandle.stateNode.canonical.nativeTag; + reactPrivateInterface.fabricUIManager.measure( + node, + function (x, y, width, height, pageX, pageY) { + x = getInspectorDataForInstance(closestInstance); + callback( + assign({}, x, { + pointerY: locationY, + frame: { + left: pageX, + top: pageY, + width: width, + height: height + }, + touchedViewTag: nativeViewTag, + closestPublicInstance: closestPublicInstance + }) + ); } - targetInst = !1; - } - if (targetInst) { - topLevelType = !1; - break a; - } + ); } - topLevelType = !0; - } - if ( - (topLevelType = shouldSetEventType - ? eventTypes.responderTerminate - : topLevelType - ? eventTypes.responderRelease - : null) - ) - (nativeEvent = ResponderSyntheticEvent.getPooled( - topLevelType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (nativeEvent.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - nativeEvent, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - nativeEvent - )), - changeResponder(null); - return JSCompiler_temp$jscomp$0; - }, - GlobalResponderHandler: null, - injection: { - injectGlobalResponderHandler: function (GlobalResponderHandler) { - ResponderEventPlugin.GlobalResponderHandler = - GlobalResponderHandler; - } + } + ) + : console.error( + "getInspectorDataForViewAtPoint expects to receive a host component" + ); } }, - eventPluginOrder = null, - namesToPlugins = {}, - plugins = [], - eventNameDispatchConfigs = {}, - registrationNameModules = {}, - customBubblingEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry - .customBubblingEventTypes, - customDirectEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry - .customDirectEventTypes; - if (eventPluginOrder) - throw Error( - "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." + getViewConfigForType = + reactPrivateInterface.ReactNativeViewConfigRegistry.get, + nextReactTag = 2; + registerEventHandler && registerEventHandler(dispatchEvent); + var currentUpdatePriority = 0, + schedulerEvent = void 0, + scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; + FragmentInstance.prototype.observeUsing = function (observer) { + null === this._observers && (this._observers = new Set()); + this._observers.add(observer); + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + observeChild, + observer, + void 0, + void 0 ); - eventPluginOrder = Array.prototype.slice.call([ - "ResponderEventPlugin", - "ReactNativeBridgeEventPlugin" - ]); - recomputePluginOrdering(); - (function (injectedNamesToPlugins) { - var isOrderingDirty = !1, - pluginName; - for (pluginName in injectedNamesToPlugins) - if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { - var pluginModule = injectedNamesToPlugins[pluginName]; - if ( - !namesToPlugins.hasOwnProperty(pluginName) || - namesToPlugins[pluginName] !== pluginModule - ) { - if (namesToPlugins[pluginName]) - throw Error( - "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName + "`.") - ); - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = !0; - } - } - isOrderingDirty && recomputePluginOrdering(); - })({ - ResponderEventPlugin: ResponderEventPlugin, - ReactNativeBridgeEventPlugin: { - eventTypes: {}, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - if (null == targetInst) return null; - var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], - directDispatchConfig = customDirectEventTypes[topLevelType]; - if (!bubbleDispatchConfig && !directDispatchConfig) - throw Error( - 'Unsupported top level event type "' + - topLevelType + - '" dispatched' - ); - topLevelType = SyntheticEvent.getPooled( - bubbleDispatchConfig || directDispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget + }; + FragmentInstance.prototype.unobserveUsing = function (observer) { + var observers = this._observers; + null !== observers && observers.has(observer) + ? (observers.delete(observer), + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + unobserveChild, + observer, + void 0, + void 0 + )) + : console.error( + "You are calling unobserveUsing() with an observer that is not being observed with this fragment instance. First attach the observer with observeUsing()" ); - if (bubbleDispatchConfig) - null != topLevelType && - null != topLevelType.dispatchConfig.phasedRegistrationNames && - topLevelType.dispatchConfig.phasedRegistrationNames.skipBubbling - ? topLevelType && - topLevelType.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - topLevelType._targetInst, - accumulateDirectionalDispatches, - topLevelType, - !0 - ) - : forEachAccumulated( - topLevelType, - accumulateTwoPhaseDispatchesSingle - ); - else if (directDispatchConfig) - forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle); - else return null; - return topLevelType; - } + }; + FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; + var children = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectChildren, + children, + void 0, + void 0 + ); + if (0 === children.length) { + children = getPublicInstanceFromHostFiber(parentHostFiber); + parentHostFiber = this._fragmentFiber; + var parentResult = children.compareDocumentPosition(otherNode); + var result = parentResult; + children === otherNode + ? (result = Node.DOCUMENT_POSITION_CONTAINS) + : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && + ((children = [null, null]), + (result = + getFragmentParentInstanceOrContainerFiber(parentHostFiber)), + null !== result && + findFragmentInstanceOrTextInstanceSiblings( + children, + parentHostFiber, + result.child, + { foundSelf: !1 } + ), + (parentHostFiber = children[1]), + null === parentHostFiber + ? (result = Node.DOCUMENT_POSITION_PRECEDING) + : ((otherNode = + getPublicInstanceFromHostFiber( + parentHostFiber + ).compareDocumentPosition(otherNode)), + (result = + 0 === otherNode || + otherNode & Node.DOCUMENT_POSITION_FOLLOWING + ? Node.DOCUMENT_POSITION_FOLLOWING + : Node.DOCUMENT_POSITION_PRECEDING))); + return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); } - }); - var isInsideEventHandler = !1, - eventQueue = null, - _enableNativeEventTargetEventDispatching = null, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, - cancelCallback$1 = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now$1 = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority$1 = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority, - log$1 = Scheduler.log, - unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, - rendererID = null, - injectedHook = null, - hasLoggedError = !1, - isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, - clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log = Math.log, - LN2 = Math.LN2, - nextTransitionUpdateLane = 256, - nextTransitionDeferredLane = 262144, - nextRetryLane = 4194304, - DiscreteEventPriority = 2, - ContinuousEventPriority = 8, - DefaultEventPriority = 32, - IdleEventPriority = 268435456, + parentHostFiber = getPublicInstanceFromHostFiber(children[0]); + children = getPublicInstanceFromHostFiber(children[children.length - 1]); + result = parentHostFiber.compareDocumentPosition(otherNode); + var lastResult = children.compareDocumentPosition(otherNode); + parentResult = + result & Node.DOCUMENT_POSITION_CONTAINED_BY || + lastResult & Node.DOCUMENT_POSITION_CONTAINED_BY; + lastResult = + result & Node.DOCUMENT_POSITION_FOLLOWING && + lastResult & Node.DOCUMENT_POSITION_PRECEDING; + return parentHostFiber === otherNode || + children === otherNode || + parentResult || + lastResult + ? Node.DOCUMENT_POSITION_CONTAINED_BY + : result; + }; + FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + return null === parentHostFiber + ? this + : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( + getRootNodeOptions + ); + }; + FragmentInstance.prototype.getClientRects = function () { + var rects = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectClientRects, + rects, + void 0, + void 0 + ); + return rects; + }; + var HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, + scheduleMicrotask = + "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout, bind = Function.prototype.bind, valueStack = []; var fiberStack = []; @@ -18174,6 +16951,7 @@ __DEV__ && needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, + StrictLegacyMode = 8, valueCursor = createCursor(null); var renderer2CursorDEV = createCursor(null); var rendererSigil = {}; @@ -18337,20 +17115,20 @@ __DEV__ && ("function" === typeof instance.componentWillMount && !0 !== instance.componentWillMount.__suppressDeprecationWarning && pendingComponentWillMountWarnings.push(fiber), - fiber.mode & 8 && + fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillMount && pendingUNSAFE_ComponentWillMountWarnings.push(fiber), "function" === typeof instance.componentWillReceiveProps && !0 !== instance.componentWillReceiveProps.__suppressDeprecationWarning && pendingComponentWillReceivePropsWarnings.push(fiber), - fiber.mode & 8 && + fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillReceiveProps && pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber), "function" === typeof instance.componentWillUpdate && !0 !== instance.componentWillUpdate.__suppressDeprecationWarning && pendingComponentWillUpdateWarnings.push(fiber), - fiber.mode & 8 && + fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillUpdate && pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber)); }; @@ -18465,7 +17243,8 @@ __DEV__ && ) { var strictRoot = null; for (var node = fiber; null !== node; ) - node.mode & 8 && (strictRoot = node), (node = node.return); + node.mode & StrictLegacyMode && (strictRoot = node), + (node = node.return); null === strictRoot ? console.error( "Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue." @@ -19858,6 +18637,7 @@ __DEV__ && cacheSignal: function () { return readContext(CacheContext).controller.signal; }, + units: null, getOwner: function () { return current; } @@ -20010,370 +18790,41 @@ __DEV__ && }; overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value); - fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, 2); - null !== path && scheduleUpdateOnFiber(path, fiber, 2); - }; - overridePropsDeletePath = function (fiber, path) { - fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); - fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, 2); - null !== path && scheduleUpdateOnFiber(path, fiber, 2); - }; - overridePropsRenamePath = function (fiber, oldPath, newPath) { - fiber.pendingProps = copyWithRename( - fiber.memoizedProps, - oldPath, - newPath - ); - fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - oldPath = enqueueConcurrentRenderForLane(fiber, 2); - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); - }; - scheduleUpdate = function (fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); - }; - scheduleRetry = function (fiber) { - var lane = claimNextRetryLane(), - root = enqueueConcurrentRenderForLane(fiber, lane); - null !== root && scheduleUpdateOnFiber(root, fiber, lane); - }; - setErrorHandler = function (newShouldErrorImpl) { - shouldErrorImpl = newShouldErrorImpl; - }; - setSuspenseHandler = function (newShouldSuspendImpl) { - shouldSuspendImpl = newShouldSuspendImpl; - }; - var emptyObject = Object.freeze({}); - var getInspectorDataForInstance = function (closestInstance) { - if (!closestInstance) - return { - hierarchy: [], - props: emptyObject, - selectedIndex: null, - componentStack: "" - }; - closestInstance = findCurrentFiberUsingSlowPath(closestInstance); - if (null === closestInstance) - return { - hierarchy: [], - props: emptyObject, - selectedIndex: null, - componentStack: "" - }; - var hierarchy = []; - traverseOwnerTreeUp(hierarchy, closestInstance); - var instance; - a: { - for (instance = hierarchy.length - 1; 1 < instance; instance--) { - var instance$jscomp$0 = hierarchy[instance]; - if (5 !== instance$jscomp$0.tag) { - instance = instance$jscomp$0; - break a; - } - } - instance = hierarchy[0]; - } - instance$jscomp$0 = createHierarchy(hierarchy); - var props = getHostProps(instance); - hierarchy = hierarchy.indexOf(instance); - closestInstance = getStackByFiberInDevAndProd(closestInstance); - return { - closestInstance: instance, - hierarchy: instance$jscomp$0, - props: props, - selectedIndex: hierarchy, - componentStack: closestInstance - }; + fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; - var supportsHydration = !1, - isSuspenseInstancePending = shim$1, - isSuspenseInstanceFallback = shim$1, - getSuspenseInstanceFallbackErrorDetails = shim$1, - registerSuspenseInstanceRetry = shim$1, - commitHydratedInstance = shim$1, - preloadResource = shim, - suspendResource = shim, - fabricCreateViewTransitionInstance = - reactPrivateInterface.fabricUIManager.createViewTransitionInstance, - fabricStartViewTransition = - reactPrivateInterface.fabricUIManager.startViewTransition, - fabricStartViewTransitionReadyFinished = - reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished, - createNode = reactPrivateInterface.fabricUIManager.createNode, - cloneNodeWithNewChildren = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, - cloneNodeWithNewChildrenAndProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, - cloneNodeWithNewProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, - createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, - appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, - appendChildNodeToSet = - reactPrivateInterface.fabricUIManager.appendChildToSet, - completeRoot = reactPrivateInterface.fabricUIManager.completeRoot, - registerEventHandler = - reactPrivateInterface.fabricUIManager.registerEventHandler, - FabricDiscretePriority = - reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, - FabricContinuousPriority = - reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, - FabricIdlePriority = - reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, - fabricGetCurrentEventPriority = - reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, - fabricSuspendOnActiveViewTransition = - reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, - extraDevToolsConfig = { - getInspectorDataForInstance: getInspectorDataForInstance, - getInspectorDataForViewAtPoint: function ( - inspectedView, - locationX, - locationY, - callback - ) { - var closestInstance = null; - (inspectedView = - reactPrivateInterface.getNodeFromPublicInstance(inspectedView)) - ? reactPrivateInterface.fabricUIManager.findNodeAtPoint( - inspectedView, - locationX, - locationY, - function (internalInstanceHandle) { - var node = - null != internalInstanceHandle - ? getNodeFromInternalInstanceHandle( - internalInstanceHandle - ) - : null; - if (null == internalInstanceHandle || null == node) - callback( - assign( - { - pointerY: locationY, - frame: { left: 0, top: 0, width: 0, height: 0 } - }, - getInspectorDataForInstance(closestInstance) - ) - ); - else { - closestInstance = - internalInstanceHandle.stateNode.canonical - .internalInstanceHandle; - var closestPublicInstance = - internalInstanceHandle.stateNode.canonical - .publicInstance, - nativeViewTag = - internalInstanceHandle.stateNode.canonical.nativeTag; - reactPrivateInterface.fabricUIManager.measure( - node, - function (x, y, width, height, pageX, pageY) { - x = getInspectorDataForInstance(closestInstance); - callback( - assign({}, x, { - pointerY: locationY, - frame: { - left: pageX, - top: pageY, - width: width, - height: height - }, - touchedViewTag: nativeViewTag, - closestPublicInstance: closestPublicInstance - }) - ); - } - ); - } - } - ) - : console.error( - "getInspectorDataForViewAtPoint expects to receive a host component" - ); - } - }, - getViewConfigForType = - reactPrivateInterface.ReactNativeViewConfigRegistry.get, - nextReactTag = 2; - registerEventHandler && registerEventHandler(dispatchEvent); - var currentUpdatePriority = 0, - schedulerEvent = void 0, - warnsIfNotActing = !1, - scheduleTimeout = setTimeout, - cancelTimeout = clearTimeout, - noTimeout = -1; - FragmentInstance.prototype.observeUsing = function (observer) { - null === this._observers && (this._observers = new Set()); - this._observers.add(observer); - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - observeChild, - observer, - void 0, - void 0 + overridePropsDeletePath = function (fiber, path) { + fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); + fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); + }; + overridePropsRenamePath = function (fiber, oldPath, newPath) { + fiber.pendingProps = copyWithRename( + fiber.memoizedProps, + oldPath, + newPath ); + fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); + oldPath = enqueueConcurrentRenderForLane(fiber, 2); + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); }; - FragmentInstance.prototype.unobserveUsing = function (observer) { - var observers = this._observers; - null !== observers && observers.has(observer) - ? (observers.delete(observer), - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - unobserveChild, - observer, - void 0, - void 0 - )) - : console.error( - "You are calling unobserveUsing() with an observer that is not being observed with this fragment instance. First attach the observer with observeUsing()" - ); + scheduleUpdate = function (fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); }; - FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; - var children = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectChildren, - children, - void 0, - void 0 - ); - if (0 === children.length) { - var parentHostInstance = - getPublicInstanceFromHostFiber(parentHostFiber); - children = this._fragmentFiber; - parentHostFiber = getPublicInstanceFromHostFiber; - var parentResult = - parentHostInstance.compareDocumentPosition(otherNode); - var result = parentResult; - parentHostInstance === otherNode - ? (result = Node.DOCUMENT_POSITION_CONTAINS) - : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && - ((parentHostInstance = [null, null]), - (result = getFragmentParentInstanceOrContainerFiber(children)), - null !== result && - findFragmentInstanceOrTextInstanceSiblings( - parentHostInstance, - children, - result.child, - { foundSelf: !1 } - ), - (children = parentHostInstance[1]), - null === children - ? (result = Node.DOCUMENT_POSITION_PRECEDING) - : ((otherNode = - parentHostFiber(children).compareDocumentPosition(otherNode)), - (result = - 0 === otherNode || - otherNode & Node.DOCUMENT_POSITION_FOLLOWING - ? Node.DOCUMENT_POSITION_FOLLOWING - : Node.DOCUMENT_POSITION_PRECEDING))); - return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - } - parentHostFiber = getPublicInstanceFromHostFiber(children[0]); - children = getPublicInstanceFromHostFiber(children[children.length - 1]); - parentHostInstance = parentHostFiber.compareDocumentPosition(otherNode); - parentResult = children.compareDocumentPosition(otherNode); - result = - parentHostInstance & Node.DOCUMENT_POSITION_CONTAINED_BY || - parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY; - parentResult = - parentHostInstance & Node.DOCUMENT_POSITION_FOLLOWING && - parentResult & Node.DOCUMENT_POSITION_PRECEDING; - return parentHostFiber === otherNode || - children === otherNode || - result || - parentResult - ? Node.DOCUMENT_POSITION_CONTAINED_BY - : parentHostInstance; + scheduleRetry = function (fiber) { + var lane = claimNextRetryLane(), + root = enqueueConcurrentRenderForLane(fiber, lane); + null !== root && scheduleUpdateOnFiber(root, fiber, lane); }; - FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - return null === parentHostFiber - ? this - : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( - getRootNodeOptions - ); + setErrorHandler = function (newShouldErrorImpl) { + shouldErrorImpl = newShouldErrorImpl; }; - FragmentInstance.prototype.getClientRects = function () { - var rects = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectClientRects, - rects, - void 0, - void 0 - ); - return rects; + setSuspenseHandler = function (newShouldSuspendImpl) { + shouldSuspendImpl = newShouldSuspendImpl; }; - var NotPendingTransition = null, - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: NotPendingTransition, - _currentValue2: NotPendingTransition, - _threadCount: 0 - }, - scheduleMicrotask = - "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout; - (function ( - getFiberCurrentPropsFromNodeImpl, - getInstanceFromNodeImpl, - getNodeFromInstanceImpl - ) { - getFiberCurrentPropsFromNode$1 = getFiberCurrentPropsFromNodeImpl; - getInstanceFromNode$1 = getInstanceFromNodeImpl; - ((getNodeFromInstance$1 = getNodeFromInstanceImpl) && - getInstanceFromNode$1) || - console.error( - "Injected module is missing getNodeFromInstance or getInstanceFromNode." - ); - })( - function (instance) { - return instance.canonical.currentProps; - }, - function (node) { - return null != node.canonical && - null != node.canonical.internalInstanceHandle - ? node.canonical.internalInstanceHandle - : node; - }, - function (fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null == fiber) - throw Error("Could not find host instance from fiber"); - return fiber; - } - ); - ResponderEventPlugin.injection.injectGlobalResponderHandler({ - onChange: function (from, to, blockNativeResponder) { - from && - from.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - from.stateNode.node, - !1, - blockNativeResponder || !1 - ); - to && - to.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - to.stateNode.node, - !0, - blockNativeResponder || !1 - ); - } - }); if ( "function" !== typeof reactPrivateInterface.ReactFiberErrorDialog.showErrorDialog @@ -20382,17 +18833,7 @@ __DEV__ && "Expected ReactFiberErrorDialog.showErrorDialog to be a function." ); batchedUpdatesImpl = function (fn, a) { - var prevExecutionContext = executionContext; - executionContext |= 1; - try { - return fn(a); - } finally { - (executionContext = prevExecutionContext), - executionContext !== NoContext || - ReactSharedInternals.isBatchingLegacy || - ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - flushSyncWorkAcrossRoots_impl(0, !0)); - } + return fn(a); }; var roots = new Map(); (function () { @@ -20497,6 +18938,25 @@ __DEV__ && componentOrHandle ); }; + exports.flushSync = function (fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = currentUpdatePriority; + try { + if ( + ((ReactSharedInternals.T = null), + (currentUpdatePriority = DiscreteEventPriority), + fn) + ) + return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (currentUpdatePriority = previousUpdatePriority), + flushSyncWork() && + console.error( + "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task." + ); + } + }; exports.getNodeFromInternalInstanceHandle = getNodeFromInternalInstanceHandle; exports.getPublicInstanceFromInternalInstanceHandle = function ( @@ -20557,14 +19017,15 @@ __DEV__ && concurrentRoot, options ) { - var root = roots.get(containerTag); - if (!root) { - root = nativeOnUncaughtError; + if (!concurrentRoot) throw Error("render: Unsupported Legacy Mode API."); + concurrentRoot = roots.get(containerTag); + if (!concurrentRoot) { + concurrentRoot = nativeOnUncaughtError; var onCaughtError = nativeOnCaughtError, onRecoverableError = defaultOnRecoverableError; options && void 0 !== options.onUncaughtError && - (root = options.onUncaughtError); + (concurrentRoot = options.onUncaughtError); options && void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError); @@ -20576,25 +19037,22 @@ __DEV__ && reactPrivateInterface.createPublicRootInstance(containerTag), containerTag: containerTag }; - concurrentRoot = concurrentRoot ? 1 : 0; - root = new FiberRootNode( + options = new FiberRootNode( options, - concurrentRoot, !1, "", - root, + concurrentRoot, onCaughtError, onRecoverableError, nativeOnDefaultTransitionIndicator, null ); - concurrentRoot = (1 === concurrentRoot ? 1 : 0) | 2; - concurrentRoot = createFiber(3, null, null, concurrentRoot); - root.current = concurrentRoot; - concurrentRoot.stateNode = root; + concurrentRoot = createFiber(3, null, null, 3); + options.current = concurrentRoot; + concurrentRoot.stateNode = options; onCaughtError = createCache(); retainCache(onCaughtError); - root.pooledCache = onCaughtError; + options.pooledCache = onCaughtError; retainCache(onCaughtError); concurrentRoot.memoizedState = { element: null, @@ -20602,10 +19060,11 @@ __DEV__ && cache: onCaughtError }; initializeUpdateQueue(concurrentRoot); - roots.set(containerTag, root); + concurrentRoot = options; + roots.set(containerTag, concurrentRoot); } - updateContainer(element, root, null, callback); - a: if (((element = root.current), element.child)) + updateContainer(element, concurrentRoot, null, callback); + a: if (((element = concurrentRoot.current), element.child)) switch (element.child.tag) { case 27: case 5: diff --git a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js index 97526fd2a9bf..609756330bb0 100644 --- a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +++ b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js @@ -7,233 +7,173 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<7d9c6a7b1084c5ed9ccdf315b8a3383f>> * * This file was sync'd from the facebook/react repository. */ "use strict"; -require("react-native/setup-env"); -var reactPrivateInterface = require("react-native/react-private-interface"), - React = require("react"), +var React = require("react"), + reactPrivateInterface = require("react-native/react-private-interface"), Scheduler = require("scheduler"), - isArrayImpl = Array.isArray, - ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - assign = Object.assign, - prefix, - suffix; -function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; + assign = Object.assign; +function getNearestMountedFiber(fiber) { + for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) + (node = nextNode), + 0 !== (node.flags & 4098) && (fiber = node.return), + (nextNode = node.return); + for (; node.return; ) node = node.return; + return 3 === node.tag ? fiber : null; } -var reentry = !1; -function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - reentry = !0; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - try { - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { - throw Error(); - } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x$1) { - control = x$1; - } - Fake = !1; - try { - var prevProps = Object.getOwnPropertyDescriptor( - fn.prototype, - "props" - ); - Object.defineProperty(fn.prototype, "props", { - configurable: !0, - set: function () { - throw Error(); - } - }); - Fake = !0; - new fn(); - } finally { - Fake && - (void 0 !== prevProps - ? Object.defineProperty(fn.prototype, "props", prevProps) - : delete fn.prototype.props); - } - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); - } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; +function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error("Unable to find node on an unmounted component."); +} +function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) + throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, child$1 = parentA.child; child$1; ) { + if (child$1 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; } - return [null, null]; + if (child$1 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$1 = child$1.sibling; } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } - ); - var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - if (sampleStack && controlStack) { - var sampleLines = sampleStack.split("\n"), - controlLines = controlStack.split("\n"); - for ( - namePropDescriptor = RunInRootFrame = 0; - RunInRootFrame < sampleLines.length && - !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); - - ) - RunInRootFrame++; - for ( - ; - namePropDescriptor < controlLines.length && - !controlLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - if ( - RunInRootFrame === sampleLines.length || - namePropDescriptor === controlLines.length - ) - for ( - RunInRootFrame = sampleLines.length - 1, - namePropDescriptor = controlLines.length - 1; - 1 <= RunInRootFrame && - 0 <= namePropDescriptor && - sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; - - ) - namePropDescriptor--; - for ( - ; - 1 <= RunInRootFrame && 0 <= namePropDescriptor; - RunInRootFrame--, namePropDescriptor-- - ) - if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { - if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { - do - if ( - (RunInRootFrame--, - namePropDescriptor--, - 0 > namePropDescriptor || - sampleLines[RunInRootFrame] !== - controlLines[namePropDescriptor]) - ) { - var frame = - "\n" + - sampleLines[RunInRootFrame].replace(" at new ", " at "); - fn.displayName && - frame.includes("") && - (frame = frame.replace("", fn.displayName)); - return frame; - } - while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + if (!didFindChild) { + for (child$1 = parentB.child; child$1; ) { + if (child$1 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; } - break; + if (child$1 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$1 = child$1.sibling; } + if (!didFindChild) + throw Error( + "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." + ); + } } - } finally { - (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); + if (a.alternate !== b) + throw Error( + "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." + ); } - return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(previousPrepareStackTrace) - : ""; + if (3 !== a.tag) + throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; } -function describeFiber(fiber, childFiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return describeBuiltInComponentFrame(fiber.type); - case 16: - return describeBuiltInComponentFrame("Lazy"); - case 13: - return fiber.child !== childFiber && null !== childFiber - ? describeBuiltInComponentFrame("Suspense Fallback") - : describeBuiltInComponentFrame("Suspense"); - case 19: - return describeBuiltInComponentFrame("SuspenseList"); - case 0: - case 15: - return describeNativeComponentFrame(fiber.type, !1); - case 11: - return describeNativeComponentFrame(fiber.type.render, !1); - case 1: - return describeNativeComponentFrame(fiber.type, !0); - case 31: - return describeBuiltInComponentFrame("Activity"); - case 30: - return describeBuiltInComponentFrame("ViewTransition"); - default: - return ""; +function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; } + return null; } -function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = "", - previous = null; - do - (info += describeFiber(workInProgress, previous)), - (previous = workInProgress), - (workInProgress = workInProgress.return); - while (workInProgress); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; +function traverseVisibleInstancesAndTextInstances( + child, + searchWithinHosts, + fn, + a, + b, + c +) { + for (; null !== child; ) { + if ( + ((5 === child.tag || 27 === child.tag || 6 === child.tag) && + fn(child, a, b, c)) || + ((22 !== child.tag || null === child.memoizedState) && + (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && + traverseVisibleInstancesAndTextInstances( + child.child, + searchWithinHosts, + fn, + a, + b, + c + )) + ) + return !0; + child = child.sibling; + } + return !1; +} +function getFragmentParentInstanceOrContainerFiber(fiber) { + for (fiber = fiber.return; null !== fiber; ) { + if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber; + fiber = fiber.return; + } + return null; +} +function findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child, + state +) { + for (; null !== child; ) { + if (child === self) state.foundSelf = !0; + else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { + if (state.foundSelf) return (result[1] = child), !0; + result[0] = child; + } else if ( + (22 !== child.tag || null === child.memoizedState) && + findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child.child, + state + ) + ) + return !0; + child = child.sibling; } + return !1; } var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -319,1118 +259,202 @@ function getComponentNameFromType(type) { } return null; } -var hasError = !1, - caughtError = null, - getFiberCurrentPropsFromNode$1 = null, - getInstanceFromNode$1 = null, - getNodeFromInstance$1 = null; -function executeDispatch(event, listener, inst) { - event.currentTarget = getNodeFromInstance$1(inst); - inst = global.event; - global.event = event; +var isArrayImpl = Array.isArray, + ReactSharedInternals = + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; +function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); +} +var isInsideEventHandler = !1; +function batchedUpdates$1(fn, bookkeeping) { + if (isInsideEventHandler) return fn(bookkeeping); + isInsideEventHandler = !0; try { - listener(event); - } catch (error) { - hasError || ((hasError = !0), (caughtError = error)); + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = !1; } - global.event = inst; - event.currentTarget = null; } -function executeDirectDispatch(event) { - var dispatchListener = event._dispatchListeners, - dispatchInstance = event._dispatchInstances; - if (isArrayImpl(dispatchListener)) throw Error("Invalid `event`."); - event.currentTarget = dispatchListener - ? getNodeFromInstance$1(dispatchInstance) - : null; - dispatchListener = dispatchListener ? dispatchListener(event) : null; - event.currentTarget = null; - event._dispatchListeners = null; - event._dispatchInstances = null; - return dispatchListener; -} -function currentTimeStamp() { - currentTimeStamp = - "object" === typeof performance && - null !== performance && - "function" === typeof performance.now - ? function () { - return performance.now(); - } - : function () { - return Date.now(); - }; - return currentTimeStamp(); +function dispatchEvent(target, topLevelType, nativeEventParam) { + var nativeEvent = + null != nativeEventParam && "object" === typeof nativeEventParam + ? nativeEventParam + : {}, + eventTarget = null; + null != target && + ((target = target.stateNode), + null != target && (eventTarget = getPublicInstance(target))); + batchedUpdates$1(function () { + var event = { eventName: topLevelType, nativeEvent: nativeEvent }; + reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); + reactPrivateInterface.RawEventEmitter.emit("*", event); + reactPrivateInterface.dispatchNativeEvent( + eventTarget, + topLevelType, + nativeEvent + ); + }); } -function functionThatReturnsTrue() { - return !0; +var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + cancelCallback$1 = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority$1 = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority, + log$1 = Scheduler.log, + unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + rendererID = null, + injectedHook = null; +function setIsStrictModeForDevtools(newIsStrictMode) { + "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); + if (injectedHook && "function" === typeof injectedHook.setStrictMode) + try { + injectedHook.setStrictMode(rendererID, newIsStrictMode); + } catch (err) {} } -function functionThatReturnsFalse() { - return !1; +var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; +function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -function SyntheticEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget -) { - this.dispatchConfig = dispatchConfig; - this._targetInst = targetInst; - this.nativeEvent = nativeEvent; - this._dispatchInstances = this._dispatchListeners = null; - dispatchConfig = this.constructor.Interface; - for (var propName in dispatchConfig) - dispatchConfig.hasOwnProperty(propName) && - ((targetInst = dispatchConfig[propName]) - ? (this[propName] = targetInst(nativeEvent)) - : "target" === propName - ? (this.target = nativeEventTarget) - : (this[propName] = nativeEvent[propName])); - this.isDefaultPrevented = ( - null != nativeEvent.defaultPrevented - ? nativeEvent.defaultPrevented - : !1 === nativeEvent.returnValue - ) - ? functionThatReturnsTrue - : functionThatReturnsFalse; - this.isPropagationStopped = functionThatReturnsFalse; - return this; -} -assign(SyntheticEvent.prototype, { - preventDefault: function () { - this.defaultPrevented = !0; - var event = this.nativeEvent; - event && - (event.preventDefault - ? event.preventDefault() - : "unknown" !== typeof event.returnValue && (event.returnValue = !1), - (this.isDefaultPrevented = functionThatReturnsTrue)); - }, - stopPropagation: function () { - var event = this.nativeEvent; - event && - (event.stopPropagation - ? event.stopPropagation() - : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0), - (this.isPropagationStopped = functionThatReturnsTrue)); - }, - persist: function () { - this.isPersistent = functionThatReturnsTrue; - }, - isPersistent: functionThatReturnsFalse, - destructor: function () { - var Interface = this.constructor.Interface, - propName; - for (propName in Interface) this[propName] = null; - this.nativeEvent = this._targetInst = this.dispatchConfig = null; - this.isPropagationStopped = this.isDefaultPrevented = - functionThatReturnsFalse; - this._dispatchInstances = this._dispatchListeners = null; - } -}); -SyntheticEvent.Interface = { - type: null, - target: null, - currentTarget: function () { - return null; - }, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function (event) { - return event.timeStamp || event.timestamp || currentTimeStamp(); - }, - defaultPrevented: null, - isTrusted: null -}; -SyntheticEvent.extend = function (Interface) { - function E() {} - function Class() { - return Super.apply(this, arguments); - } - var Super = this; - E.prototype = Super.prototype; - var prototype = new E(); - assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - Class.Interface = assign({}, Super.Interface, Interface); - Class.extend = Super.extend; - addEventPoolingTo(Class); - return Class; -}; -addEventPoolingTo(SyntheticEvent); -function createOrGetPooledEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeInst -) { - if (this.eventPool.length) { - var instance = this.eventPool.pop(); - this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); - return instance; +var nextTransitionUpdateLane = 256, + nextTransitionDeferredLane = 262144, + nextRetryLane = 4194304; +function getHighestPriorityLanes(lanes) { + var pendingSyncLanes = lanes & 42; + if (0 !== pendingSyncLanes) return pendingSyncLanes; + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; + case 128: + return 128; + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + return lanes & -lanes; + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 3932160; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 0; + default: + return lanes; } - return new this(dispatchConfig, targetInst, nativeEvent, nativeInst); } -function releasePooledEvent(event) { - if (!(event instanceof this)) - throw Error( - "Trying to release an event instance into a pool of a different type." - ); - event.destructor(); - 10 > this.eventPool.length && this.eventPool.push(event); +function getNextLanes(root, wipLanes, rootHasPendingCommit) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; + var nonIdlePendingLanes = pendingLanes & 134217727; + 0 !== nonIdlePendingLanes + ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); + return 0 === nextLanes + ? 0 + : 0 !== wipLanes && + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) + ? wipLanes + : nextLanes; } -function addEventPoolingTo(EventConstructor) { - EventConstructor.getPooled = createOrGetPooledEvent; - EventConstructor.eventPool = []; - EventConstructor.release = releasePooledEvent; +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); } -var ResponderSyntheticEvent = SyntheticEvent.extend({ - touchHistory: function () { - return null; - } -}); -function isStartish(topLevelType) { - return "topTouchStart" === topLevelType; -} -function isMoveish(topLevelType) { - return "topTouchMove" === topLevelType; -} -var startDependencies = ["topTouchStart"], - moveDependencies = ["topTouchMove"], - endDependencies = ["topTouchCancel", "topTouchEnd"], - touchBank = [], - touchHistory = { - touchBank: touchBank, - numberActiveTouches: 0, - indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 - }; -function timestampForTouch(touch) { - return touch.timeStamp || touch.timestamp; -} -function getTouchIdentifier(_ref) { - _ref = _ref.identifier; - if (null == _ref) throw Error("Touch object is missing identifier."); - return _ref; -} -function recordTouchStart(touch) { - var identifier = getTouchIdentifier(touch), - touchRecord = touchBank[identifier]; - touchRecord - ? ((touchRecord.touchActive = !0), - (touchRecord.startPageX = touch.pageX), - (touchRecord.startPageY = touch.pageY), - (touchRecord.startTimeStamp = timestampForTouch(touch)), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchRecord.previousPageX = touch.pageX), - (touchRecord.previousPageY = touch.pageY), - (touchRecord.previousTimeStamp = timestampForTouch(touch))) - : ((touchRecord = { - touchActive: !0, - startPageX: touch.pageX, - startPageY: touch.pageY, - startTimeStamp: timestampForTouch(touch), - currentPageX: touch.pageX, - currentPageY: touch.pageY, - currentTimeStamp: timestampForTouch(touch), - previousPageX: touch.pageX, - previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) - }), - (touchBank[identifier] = touchRecord)); - touchHistory.mostRecentTimeStamp = timestampForTouch(touch); -} -function recordTouchMove(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord && - ((touchRecord.touchActive = !0), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))); -} -function recordTouchEnd(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord && - ((touchRecord.touchActive = !1), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))); -} -var instrumentationCallback, - ResponderTouchHistoryStore = { - instrument: function (callback) { - instrumentationCallback = callback; - }, - recordTouchTrack: function (topLevelType, nativeEvent) { - null != instrumentationCallback && - instrumentationCallback(topLevelType, nativeEvent); - if (isMoveish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchMove); - else if (isStartish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchStart), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches && - (touchHistory.indexOfSingleActiveTouch = - nativeEvent.touches[0].identifier); - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if ( - (nativeEvent.changedTouches.forEach(recordTouchEnd), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches) - ) - for ( - topLevelType = 0; - topLevelType < touchBank.length; - topLevelType++ - ) - if ( - ((nativeEvent = touchBank[topLevelType]), - null != nativeEvent && nativeEvent.touchActive) - ) { - touchHistory.indexOfSingleActiveTouch = topLevelType; - break; - } - }, - touchHistory: touchHistory - }; -function accumulate(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - return null == current - ? next - : isArrayImpl(current) - ? current.concat(next) - : isArrayImpl(next) - ? [current].concat(next) - : [current, next]; -} -function accumulateInto(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - if (null == current) return next; - if (isArrayImpl(current)) { - if (isArrayImpl(next)) return current.push.apply(current, next), current; - current.push(next); - return current; - } - return isArrayImpl(next) ? [current].concat(next) : [current, next]; -} -function forEachAccumulated(arr, cb, scope) { - Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); -} -var responderInst = null, - trackedTouchCount = 0; -function changeResponder(nextResponderInst, blockHostResponder) { - var oldResponderInst = responderInst; - responderInst = nextResponderInst; - if (null !== ResponderEventPlugin.GlobalResponderHandler) - ResponderEventPlugin.GlobalResponderHandler.onChange( - oldResponderInst, - nextResponderInst, - blockHostResponder - ); -} -var eventTypes = { - startShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onStartShouldSetResponder", - captured: "onStartShouldSetResponderCapture" - }, - dependencies: startDependencies - }, - scrollShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onScrollShouldSetResponder", - captured: "onScrollShouldSetResponderCapture" - }, - dependencies: ["topScroll"] - }, - selectionChangeShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onSelectionChangeShouldSetResponder", - captured: "onSelectionChangeShouldSetResponderCapture" - }, - dependencies: ["topSelectionChange"] - }, - moveShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onMoveShouldSetResponder", - captured: "onMoveShouldSetResponderCapture" - }, - dependencies: moveDependencies - }, - responderStart: { - registrationName: "onResponderStart", - dependencies: startDependencies - }, - responderMove: { - registrationName: "onResponderMove", - dependencies: moveDependencies - }, - responderEnd: { - registrationName: "onResponderEnd", - dependencies: endDependencies - }, - responderRelease: { - registrationName: "onResponderRelease", - dependencies: endDependencies - }, - responderTerminationRequest: { - registrationName: "onResponderTerminationRequest", - dependencies: [] - }, - responderGrant: { registrationName: "onResponderGrant", dependencies: [] }, - responderReject: { registrationName: "onResponderReject", dependencies: [] }, - responderTerminate: { - registrationName: "onResponderTerminate", - dependencies: [] - } -}; -function getParent$1(inst) { - do inst = inst.return; - while (inst && 5 !== inst.tag); - return inst ? inst : null; -} -function traverseTwoPhase$1(inst, fn, arg) { - for (var path = []; inst; ) path.push(inst), (inst = getParent$1(inst)); - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); -} -function getListener$1(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." - ); - return inst; -} -function accumulateDirectionalDispatches$1(inst, phase, event) { - if ( - (phase = getListener$1( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); -} -function accumulateDirectDispatchesSingle$1(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener$1(inst, event.dispatchConfig.registrationName); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } - } -} -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst; - targetInst = targetInst ? getParent$1(targetInst) : null; - traverseTwoPhase$1(targetInst, accumulateDirectionalDispatches$1, event); - } -} -function accumulateTwoPhaseDispatchesSingle$1(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase$1( - event._targetInst, - accumulateDirectionalDispatches$1, - event - ); -} -var ResponderEventPlugin = { - _getResponder: function () { - return responderInst; - }, - eventTypes: eventTypes, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - if (isStartish(topLevelType)) trackedTouchCount += 1; - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if (0 <= trackedTouchCount) --trackedTouchCount; - else return null; - ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); - if ( - targetInst && - (("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) || - (0 < trackedTouchCount && "topSelectionChange" === topLevelType) || - isStartish(topLevelType) || - isMoveish(topLevelType)) - ) { - var shouldSetEventType = isStartish(topLevelType) - ? eventTypes.startShouldSetResponder - : isMoveish(topLevelType) - ? eventTypes.moveShouldSetResponder - : "topSelectionChange" === topLevelType - ? eventTypes.selectionChangeShouldSetResponder - : eventTypes.scrollShouldSetResponder; - if (responderInst) - b: { - var JSCompiler_temp = responderInst; - for ( - var depthA = 0, tempA = JSCompiler_temp; - tempA; - tempA = getParent$1(tempA) - ) - depthA++; - tempA = 0; - for (var tempB = targetInst; tempB; tempB = getParent$1(tempB)) - tempA++; - for (; 0 < depthA - tempA; ) - (JSCompiler_temp = getParent$1(JSCompiler_temp)), depthA--; - for (; 0 < tempA - depthA; ) - (targetInst = getParent$1(targetInst)), tempA--; - for (; depthA--; ) { - if ( - JSCompiler_temp === targetInst || - JSCompiler_temp === targetInst.alternate - ) - break b; - JSCompiler_temp = getParent$1(JSCompiler_temp); - targetInst = getParent$1(targetInst); - } - JSCompiler_temp = null; - } - else JSCompiler_temp = targetInst; - targetInst = JSCompiler_temp; - JSCompiler_temp = targetInst === responderInst; - shouldSetEventType = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - targetInst, - nativeEvent, - nativeEventTarget - ); - shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory; - JSCompiler_temp - ? forEachAccumulated( - shouldSetEventType, - accumulateTwoPhaseDispatchesSingleSkipTarget - ) - : forEachAccumulated( - shouldSetEventType, - accumulateTwoPhaseDispatchesSingle$1 - ); - b: { - JSCompiler_temp = shouldSetEventType._dispatchListeners; - targetInst = shouldSetEventType._dispatchInstances; - if (isArrayImpl(JSCompiler_temp)) - for ( - depthA = 0; - depthA < JSCompiler_temp.length && - !shouldSetEventType.isPropagationStopped(); - depthA++ - ) { - if ( - JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA]) - ) { - JSCompiler_temp = targetInst[depthA]; - break b; - } - } - else if ( - JSCompiler_temp && - JSCompiler_temp(shouldSetEventType, targetInst) - ) { - JSCompiler_temp = targetInst; - break b; - } - JSCompiler_temp = null; - } - shouldSetEventType._dispatchInstances = null; - shouldSetEventType._dispatchListeners = null; - shouldSetEventType.isPersistent() || - shouldSetEventType.constructor.release(shouldSetEventType); - if (JSCompiler_temp && JSCompiler_temp !== responderInst) - if ( - ((shouldSetEventType = ResponderSyntheticEvent.getPooled( - eventTypes.responderGrant, - JSCompiler_temp, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (targetInst = !0 === executeDirectDispatch(shouldSetEventType)), - responderInst) - ) - if ( - ((depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminationRequest, - responderInst, - nativeEvent, - nativeEventTarget - )), - (depthA.touchHistory = ResponderTouchHistoryStore.touchHistory), - forEachAccumulated(depthA, accumulateDirectDispatchesSingle$1), - (tempA = - !depthA._dispatchListeners || executeDirectDispatch(depthA)), - depthA.isPersistent() || depthA.constructor.release(depthA), - tempA) - ) { - depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminate, - responderInst, - nativeEvent, - nativeEventTarget - ); - depthA.touchHistory = ResponderTouchHistoryStore.touchHistory; - forEachAccumulated(depthA, accumulateDirectDispatchesSingle$1); - var JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - [shouldSetEventType, depthA] - ); - changeResponder(JSCompiler_temp, targetInst); - } else - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - eventTypes.responderReject, - JSCompiler_temp, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - else - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )), - changeResponder(JSCompiler_temp, targetInst); - else JSCompiler_temp$jscomp$0 = null; - } else JSCompiler_temp$jscomp$0 = null; - shouldSetEventType = responderInst && isStartish(topLevelType); - JSCompiler_temp = responderInst && isMoveish(topLevelType); - targetInst = - responderInst && - ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType); - if ( - (shouldSetEventType = shouldSetEventType - ? eventTypes.responderStart - : JSCompiler_temp - ? eventTypes.responderMove - : targetInst - ? eventTypes.responderEnd - : null) - ) - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - shouldSetEventType = responderInst && "topTouchCancel" === topLevelType; - if ( - (topLevelType = - responderInst && - !shouldSetEventType && - ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType)) - ) - a: { - if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < topLevelType.length; - JSCompiler_temp++ - ) - if ( - ((targetInst = topLevelType[JSCompiler_temp].target), - null !== targetInst && - void 0 !== targetInst && - 0 !== targetInst) - ) { - depthA = getInstanceFromNode$1(targetInst); - b: { - for (targetInst = responderInst; depthA; ) { - if ( - targetInst === depthA || - targetInst === depthA.alternate - ) { - targetInst = !0; - break b; - } - depthA = getParent$1(depthA); - } - targetInst = !1; - } - if (targetInst) { - topLevelType = !1; - break a; - } - } - topLevelType = !0; - } - if ( - (topLevelType = shouldSetEventType - ? eventTypes.responderTerminate - : topLevelType - ? eventTypes.responderRelease - : null) - ) - (nativeEvent = ResponderSyntheticEvent.getPooled( - topLevelType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory), - forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle$1), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - nativeEvent - )), - changeResponder(null); - return JSCompiler_temp$jscomp$0; - }, - GlobalResponderHandler: null, - injection: { - injectGlobalResponderHandler: function (GlobalResponderHandler) { - ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; - } - } - }, - eventPluginOrder = null, - namesToPlugins = {}; -function recomputePluginOrdering() { - if (eventPluginOrder) - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName], - pluginIndex = eventPluginOrder.indexOf(pluginName); - if (-1 >= pluginIndex) - throw Error( - "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + - (pluginName + "`.") - ); - if (!plugins[pluginIndex]) { - if (!pluginModule.extractEvents) - throw Error( - "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + - (pluginName + "` does not.") - ); - plugins[pluginIndex] = pluginModule; - pluginIndex = pluginModule.eventTypes; - for (var eventName in pluginIndex) { - var JSCompiler_inline_result = void 0; - var dispatchConfig = pluginIndex[eventName]; - if (eventNameDispatchConfigs.hasOwnProperty(eventName)) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + - (eventName + "`.") - ); - eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (JSCompiler_inline_result in phasedRegistrationNames) - phasedRegistrationNames.hasOwnProperty( - JSCompiler_inline_result - ) && - publishRegistrationName( - phasedRegistrationNames[JSCompiler_inline_result], - pluginModule - ); - JSCompiler_inline_result = !0; - } else - dispatchConfig.registrationName - ? (publishRegistrationName( - dispatchConfig.registrationName, - pluginModule - ), - (JSCompiler_inline_result = !0)) - : (JSCompiler_inline_result = !1); - if (!JSCompiler_inline_result) - throw Error( - "EventPluginRegistry: Failed to publish event `" + - eventName + - "` for plugin `" + - pluginName + - "`." - ); - } - } - } -} -function publishRegistrationName(registrationName, pluginModule) { - if (registrationNameModules[registrationName]) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + - (registrationName + "`.") - ); - registrationNameModules[registrationName] = pluginModule; -} -var plugins = [], - eventNameDispatchConfigs = {}, - registrationNameModules = {}; -function getListener(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." - ); - return inst; -} -var customBubblingEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry - .customBubblingEventTypes, - customDirectEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry.customDirectEventTypes; -function accumulateDirectionalDispatches(inst, phase, event) { - if ( - (phase = getListener( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); -} -function traverseTwoPhase(inst, fn, arg, skipBubbling) { - for (var path = []; inst; ) { - path.push(inst); - do inst = inst.return; - while (inst && 5 !== inst.tag); - inst = inst ? inst : null; - } - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - if (skipBubbling) fn(path[0], "bubbled", arg); - else - for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); -} -function accumulateTwoPhaseDispatchesSingle(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - event._targetInst, - accumulateDirectionalDispatches, - event, - !1 - ); -} -function accumulateDirectDispatchesSingle(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener(inst, event.dispatchConfig.registrationName); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } - } -} -if (eventPluginOrder) - throw Error( - "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." - ); -eventPluginOrder = Array.prototype.slice.call([ - "ResponderEventPlugin", - "ReactNativeBridgeEventPlugin" -]); -recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_295 = { - ResponderEventPlugin: ResponderEventPlugin, - ReactNativeBridgeEventPlugin: { - eventTypes: {}, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - if (null == targetInst) return null; - var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], - directDispatchConfig = customDirectEventTypes[topLevelType]; - if (!bubbleDispatchConfig && !directDispatchConfig) - throw Error( - 'Unsupported top level event type "' + topLevelType + '" dispatched' - ); - topLevelType = SyntheticEvent.getPooled( - bubbleDispatchConfig || directDispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget - ); - if (bubbleDispatchConfig) - null != topLevelType && - null != topLevelType.dispatchConfig.phasedRegistrationNames && - topLevelType.dispatchConfig.phasedRegistrationNames.skipBubbling - ? topLevelType && - topLevelType.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - topLevelType._targetInst, - accumulateDirectionalDispatches, - topLevelType, - !0 - ) - : forEachAccumulated( - topLevelType, - accumulateTwoPhaseDispatchesSingle - ); - else if (directDispatchConfig) - forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle); - else return null; - return topLevelType; - } - } - }, - isOrderingDirty$jscomp$inline_296 = !1, - pluginName$jscomp$inline_297; -for (pluginName$jscomp$inline_297 in injectedNamesToPlugins$jscomp$inline_295) - if ( - injectedNamesToPlugins$jscomp$inline_295.hasOwnProperty( - pluginName$jscomp$inline_297 - ) - ) { - var pluginModule$jscomp$inline_298 = - injectedNamesToPlugins$jscomp$inline_295[pluginName$jscomp$inline_297]; - if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_297) || - namesToPlugins[pluginName$jscomp$inline_297] !== - pluginModule$jscomp$inline_298 +function getEntangledLanes(root, renderLanes) { + 0 !== (renderLanes & 8) && (renderLanes |= renderLanes & 32); + var allEntangledLanes = root.entangledLanes; + if (0 !== allEntangledLanes) + for ( + root = root.entanglements, allEntangledLanes &= renderLanes; + 0 < allEntangledLanes; + ) { - if (namesToPlugins[pluginName$jscomp$inline_297]) - throw Error( - "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_297 + "`.") - ); - namesToPlugins[pluginName$jscomp$inline_297] = - pluginModule$jscomp$inline_298; - isOrderingDirty$jscomp$inline_296 = !0; - } - } -isOrderingDirty$jscomp$inline_296 && recomputePluginOrdering(); -function batchedUpdatesImpl(fn, bookkeeping) { - return fn(bookkeeping); -} -var isInsideEventHandler = !1; -function batchedUpdates$1(fn, bookkeeping) { - if (isInsideEventHandler) return fn(bookkeeping); - isInsideEventHandler = !0; - try { - return batchedUpdatesImpl(fn, bookkeeping); - } finally { - isInsideEventHandler = !1; - } -} -var eventQueue = null; -function executeDispatchesAndReleaseTopLevel(e) { - if (e) { - var dispatchListeners = e._dispatchListeners, - dispatchInstances = e._dispatchInstances; - if (isArrayImpl(dispatchListeners)) - for ( - var i = 0; - i < dispatchListeners.length && !e.isPropagationStopped(); - i++ - ) - executeDispatch(e, dispatchListeners[i], dispatchInstances[i]); - else - dispatchListeners && - executeDispatch(e, dispatchListeners, dispatchInstances); - e._dispatchListeners = null; - e._dispatchInstances = null; - e.isPersistent() || e.constructor.release(e); - } -} -var _enableNativeEventTargetEventDispatching = null; -function dispatchEvent(target, topLevelType, nativeEventParam) { - var nativeEvent = - null != nativeEventParam && "object" === typeof nativeEventParam - ? nativeEventParam - : {}, - eventTarget = null; - null != target && - ((nativeEventParam = target.stateNode), - null != nativeEventParam && - (eventTarget = getPublicInstance(nativeEventParam))); - batchedUpdates$1(function () { - var event = { eventName: topLevelType, nativeEvent: nativeEvent }; - reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); - reactPrivateInterface.RawEventEmitter.emit("*", event); - null == _enableNativeEventTargetEventDispatching && - ((event = - null != reactPrivateInterface.ReactNativeFeatureFlags - ? reactPrivateInterface.ReactNativeFeatureFlags - .enableNativeEventTargetEventDispatching - : null), - (_enableNativeEventTargetEventDispatching = - "function" === typeof event && event())); - if (_enableNativeEventTargetEventDispatching) - reactPrivateInterface.dispatchNativeEvent( - eventTarget, - topLevelType, - nativeEvent - ); - else { - event = eventTarget; - for ( - var events = null, legacyPlugins = plugins, i = 0; - i < legacyPlugins.length; - i++ - ) { - var possiblePlugin = legacyPlugins[i]; - possiblePlugin && - (possiblePlugin = possiblePlugin.extractEvents( - topLevelType, - target, - nativeEvent, - event - )) && - (events = accumulateInto(events, possiblePlugin)); - } - event = events; - null !== event && (eventQueue = accumulateInto(eventQueue, event)); - event = eventQueue; - eventQueue = null; - if (event) { - forEachAccumulated(event, executeDispatchesAndReleaseTopLevel); - if (eventQueue) - throw Error( - "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." - ); - if (hasError) - throw ( - ((event = caughtError), - (hasError = !1), - (caughtError = null), - event) - ); - } + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + renderLanes |= root[index$3]; + allEntangledLanes &= ~lane; } - }); -} -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, - cancelCallback$1 = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority$1 = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority, - log$1 = Scheduler.log, - unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, - rendererID = null, - injectedHook = null; -function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); - if (injectedHook && "function" === typeof injectedHook.setStrictMode) - try { - injectedHook.setStrictMode(rendererID, newIsStrictMode); - } catch (err) {} -} -var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log = Math.log, - LN2 = Math.LN2; -function clz32Fallback(x) { - x >>>= 0; - return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; + return renderLanes; } -var nextTransitionUpdateLane = 256, - nextTransitionDeferredLane = 262144, - nextRetryLane = 4194304; -function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & 42; - if (0 !== pendingSyncLanes) return pendingSyncLanes; - switch (lanes & -lanes) { +function computeExpirationTime(lane, currentTime) { + switch (lane) { case 1: - return 1; case 2: - return 2; case 4: - return 4; case 8: - return 8; + case 64: + return currentTime + 250; case 16: - return 16; case 32: - return 32; - case 64: - return 64; case 128: - return 128; case 256: case 512: case 1024: @@ -1441,126 +465,16 @@ function getHighestPriorityLanes(lanes) { case 32768: case 65536: case 131072: - return lanes & -lanes; case 262144: case 524288: case 1048576: case 2097152: - return lanes & 3932160; + return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & 62914560; - case 67108864: - return 67108864; - case 134217728: - return 134217728; - case 268435456: - return 268435456; - case 536870912: - return 536870912; - case 1073741824: - return 0; - default: - return lanes; - } -} -function getNextLanes(root, wipLanes, rootHasPendingCommit) { - var pendingLanes = root.pendingLanes; - if (0 === pendingLanes) return 0; - var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes; - root = root.warmLanes; - var nonIdlePendingLanes = pendingLanes & 134217727; - 0 !== nonIdlePendingLanes - ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : rootHasPendingCommit || - ((rootHasPendingCommit = nonIdlePendingLanes & ~root), - 0 !== rootHasPendingCommit && - (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : rootHasPendingCommit || - ((rootHasPendingCommit = pendingLanes & ~root), - 0 !== rootHasPendingCommit && - (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); - return 0 === nextLanes - ? 0 - : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (rootHasPendingCommit = wipLanes & -wipLanes), - suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) - ? wipLanes - : nextLanes; -} -function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); -} -function getEntangledLanes(root, renderLanes) { - 0 !== (renderLanes & 8) && (renderLanes |= renderLanes & 32); - var allEntangledLanes = root.entangledLanes; - if (0 !== allEntangledLanes) - for ( - root = root.entanglements, allEntangledLanes &= renderLanes; - 0 < allEntangledLanes; - - ) { - var index$6 = 31 - clz32(allEntangledLanes), - lane = 1 << index$6; - renderLanes |= root[index$6]; - allEntangledLanes &= ~lane; - } - return renderLanes; -} -function computeExpirationTime(lane, currentTime) { - switch (lane) { - case 1: - case 2: - case 4: - case 8: - case 64: - return currentTime + 250; - case 16: - case 32: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return currentTime + 5e3; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - return -1; + return -1; case 67108864: case 134217728: case 268435456: @@ -1611,18 +525,18 @@ function markRootFinished( 0 < remainingLanes; ) { - var index$9 = 31 - clz32(remainingLanes), - lane = 1 << index$9; - entanglements[index$9] = 0; - expirationTimes[index$9] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$9]; + var index$6 = 31 - clz32(remainingLanes), + lane = 1 << index$6; + entanglements[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$9] = null, index$9 = 0; - index$9 < hiddenUpdatesForLane.length; - index$9++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$9]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } remainingLanes &= ~lane; @@ -1646,10 +560,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$10 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$10; - (lane & entangledLanes) | (root[index$10] & entangledLanes) && - (root[index$10] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -1707,1278 +621,1673 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -function getNearestMountedFiber(fiber) { - for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) - (node = nextNode), - 0 !== (node.flags & 4098) && (fiber = node.return), - (nextNode = node.return); - for (; node.return; ) node = node.return; - return 3 === node.tag ? fiber : null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); +var prefix, suffix; +function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$11 = parentA.child; child$11; ) { - if (child$11 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$11 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$11 = child$11.sibling; - } - if (!didFindChild) { - for (child$11 = parentB.child; child$11; ) { - if (child$11 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$11 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; + return "\n" + prefix + name + suffix; +} +var reentry = !1; +function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + reentry = !0; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$8) { + control = x$8; + } + Fake = !1; + try { + var prevProps = Object.getOwnPropertyDescriptor( + fn.prototype, + "props" + ); + Object.defineProperty(fn.prototype, "props", { + configurable: !0, + set: function () { + throw Error(); + } + }); + Fake = !0; + new fn(); + } finally { + Fake && + (void 0 !== prevProps + ? Object.defineProperty(fn.prototype, "props", prevProps) + : delete fn.prototype.props); + } + } + } else { + try { + throw Error(); + } catch (x$9) { + control = x$9; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - child$11 = child$11.sibling; + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); + return [null, null]; } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} -function traverseVisibleInstancesAndTextInstances( - child, - searchWithinHosts, - fn, - a, - b, - c -) { - for (; null !== child; ) { - if ( - ((5 === child.tag || 27 === child.tag || 6 === child.tag) && - fn(child, a, b, c)) || - ((22 !== child.tag || null === child.memoizedState) && - (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && - traverseVisibleInstancesAndTextInstances( - child.child, - searchWithinHosts, - fn, - a, - b, - c - )) - ) - return !0; - child = child.sibling; + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + namePropDescriptor = RunInRootFrame = 0; + RunInRootFrame < sampleLines.length && + !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); + + ) + RunInRootFrame++; + for ( + ; + namePropDescriptor < controlLines.length && + !controlLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + if ( + RunInRootFrame === sampleLines.length || + namePropDescriptor === controlLines.length + ) + for ( + RunInRootFrame = sampleLines.length - 1, + namePropDescriptor = controlLines.length - 1; + 1 <= RunInRootFrame && + 0 <= namePropDescriptor && + sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; + + ) + namePropDescriptor--; + for ( + ; + 1 <= RunInRootFrame && 0 <= namePropDescriptor; + RunInRootFrame--, namePropDescriptor-- + ) + if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { + if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { + do + if ( + (RunInRootFrame--, + namePropDescriptor--, + 0 > namePropDescriptor || + sampleLines[RunInRootFrame] !== + controlLines[namePropDescriptor]) + ) { + var frame = + "\n" + + sampleLines[RunInRootFrame].replace(" at new ", " at "); + fn.displayName && + frame.includes("") && + (frame = frame.replace("", fn.displayName)); + return frame; + } + while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + } + break; + } + } + } finally { + (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); } - return !1; + return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(previousPrepareStackTrace) + : ""; } -function getFragmentParentInstanceOrContainerFiber(fiber) { - for (fiber = fiber.return; null !== fiber; ) { - if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber; - fiber = fiber.return; +function describeFiber(fiber, childFiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return fiber.child !== childFiber && null !== childFiber + ? describeBuiltInComponentFrame("Suspense Fallback") + : describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return describeNativeComponentFrame(fiber.type, !1); + case 11: + return describeNativeComponentFrame(fiber.type.render, !1); + case 1: + return describeNativeComponentFrame(fiber.type, !0); + case 31: + return describeBuiltInComponentFrame("Activity"); + case 30: + return describeBuiltInComponentFrame("ViewTransition"); + default: + return ""; } - return null; } -function findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child, - state -) { - for (; null !== child; ) { - if (child === self) state.foundSelf = !0; - else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { - if (state.foundSelf) return (result[1] = child), !0; - result[0] = child; - } else if ( - (22 !== child.tag || null === child.memoizedState) && - findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child.child, - state - ) - ) - return !0; - child = child.sibling; +function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = "", + previous = null; + do + (info += describeFiber(workInProgress, previous)), + (previous = workInProgress), + (workInProgress = workInProgress.return); + while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; } - return !1; } -var valueStack = [], - index = -1; -function createCursor(defaultValue) { - return { current: defaultValue }; +function shim$1() { + throw Error( + "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." + ); } -function pop(cursor) { - 0 > index || - ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); +function shim() { + throw Error( + "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." + ); } -function push(cursor, value) { - index++; - valueStack[index] = cursor.current; - cursor.current = value; +var fabricCreateViewTransitionInstance = + reactPrivateInterface.fabricUIManager.createViewTransitionInstance, + fabricStartViewTransition = + reactPrivateInterface.fabricUIManager.startViewTransition, + fabricStartViewTransitionReadyFinished = + reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished; +function ViewTransitionPseudoElement(pseudo, name) { + this._pseudo = pseudo; + this._name = name; } -var emptyContextObject = {}, - globalClientIdCounter$1 = 0; -function getViewTransitionName(props, instance) { - if (null != props.name && "auto" !== props.name) return props.name; - if (null !== instance.autoName) return instance.autoName; - props = pendingEffectsRoot.identifierPrefix; - var globalClientId = globalClientIdCounter$1++; - props = "_" + props + "t_" + globalClientId.toString(32) + "_"; - return (instance.autoName = props); +function measureClonedInstance() { + return { + rect: { x: 0, y: 0, width: 0, height: 0 }, + abs: !1, + clip: !1, + view: !0 + }; } -function getClassNameByType(classByType) { - if (null == classByType || "string" === typeof classByType) - return classByType; - var className = null, - activeTypes = pendingTransitionTypes; - if (null !== activeTypes) - for (var i = 0; i < activeTypes.length; i++) { - var match = classByType[activeTypes[i]]; - if (null != match) { - if ("none" === match) return "none"; - className = null == className ? match : className + (" " + match); - } - } - return null == className ? classByType.default : className; +function createViewTransitionInstance(name) { + var tag = allocateTag(); + fabricCreateViewTransitionInstance(name, tag); + return { + name: name, + old: new ViewTransitionPseudoElement("old", name), + new: new ViewTransitionPseudoElement("new", name) + }; } -function getViewTransitionClassName(defaultClass, eventClass) { - defaultClass = getClassNameByType(defaultClass); - eventClass = getClassNameByType(eventClass); - return null == eventClass - ? "auto" === defaultClass - ? null - : defaultClass - : "auto" === eventClass - ? null - : eventClass; +function startViewTransition( + suspendedState, + rootContainer, + transitionTypes, + mutationCallback, + layoutCallback, + afterMutationCallback, + spawnedWorkCallback, + passiveCallback +) { + suspendedState = fabricStartViewTransition(function () { + mutationCallback(); + layoutCallback(); + afterMutationCallback(); + }); + if (null == suspendedState) + return mutationCallback(), layoutCallback(), spawnedWorkCallback(), null; + suspendedState.ready.then(function () { + spawnedWorkCallback(); + fabricStartViewTransitionReadyFinished(); + }); + suspendedState.finished.finally(function () { + passiveCallback(); + }); + return suspendedState; } -function is(x, y) { - return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +var createNode = reactPrivateInterface.fabricUIManager.createNode, + cloneNodeWithNewChildren = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, + createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, + appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, + appendChildNodeToSet = reactPrivateInterface.fabricUIManager.appendChildToSet, + completeRoot$1 = reactPrivateInterface.fabricUIManager.completeRoot, + registerEventHandler = + reactPrivateInterface.fabricUIManager.registerEventHandler, + FabricDiscretePriority = + reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, + FabricContinuousPriority = + reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, + FabricIdlePriority = + reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, + fabricGetCurrentEventPriority = + reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, + fabricSuspendOnActiveViewTransition = + reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, + extraDevToolsConfig = { + getInspectorDataForInstance: void 0, + getInspectorDataForViewAtPoint: function () { + throw Error( + "getInspectorDataForViewAtPoint() is not available in production." + ); + } + }, + getViewConfigForType = + reactPrivateInterface.ReactNativeViewConfigRegistry.get, + nextReactTag = 2; +function allocateTag() { + var tag = nextReactTag; + nextReactTag += 2; + return tag; } -var objectIs = "function" === typeof Object.is ? Object.is : is, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - hasOwnProperty = Object.prototype.hasOwnProperty, - CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } +registerEventHandler && registerEventHandler(dispatchEvent); +var PROD_HOST_CONTEXT = { isInAParentText: !0 }; +function createTextInstance( + text, + rootContainerInstance, + hostContext, + internalInstanceHandle +) { + hostContext = allocateTag(); return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) + node: createNode( + hostContext, + "RCTRawText", + rootContainerInstance.containerTag, + { text: text }, + internalInstanceHandle + ) }; } -var contextStackCursor = createCursor(null), - contextFiberStackCursor = createCursor(null), - rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null); -function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance); - push(contextFiberStackCursor, fiber); - push(contextStackCursor, null); - fiber = PROD_HOST_CONTEXT; - pop(contextStackCursor); - push(contextStackCursor, fiber); -} -function popHostContainer() { - pop(contextStackCursor); - pop(contextFiberStackCursor); - pop(rootInstanceStackCursor); +function getPublicInstance(instance) { + if (null != instance.canonical) { + if (null == instance.canonical.publicInstance) { + var $jscomp$nullish$tmp0; + instance.canonical.publicInstance = + reactPrivateInterface.createPublicInstance( + instance.canonical.nativeTag, + instance.canonical.viewConfig, + instance.canonical.internalInstanceHandle, + null != ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) + ? $jscomp$nullish$tmp0 + : null + ); + instance.canonical.publicRootInstance = null; + } + return instance.canonical.publicInstance; + } + return null != instance.containerInfo + ? instance.containerInfo.publicInstance + : null; } -function pushHostContext(fiber) { - var stateHook = fiber.memoizedState; - null !== stateHook && - ((HostTransitionContext._currentValue2 = stateHook.memoizedState), - push(hostTransitionProviderCursor, fiber)); - stateHook = contextStackCursor.current; - stateHook !== stateHook && - (push(contextFiberStackCursor, fiber), push(contextStackCursor, stateHook)); +function getPublicInstanceFromHostFiber(fiber) { + fiber = getPublicInstance(fiber.stateNode); + if (null === fiber) + throw Error("Expected to find a host node. This is a bug in React."); + return fiber; } -function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor), pop(contextFiberStackCursor)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor), - (HostTransitionContext._currentValue2 = null)); +var currentUpdatePriority = 0; +function resolveUpdatePriority() { + if (0 !== currentUpdatePriority) return currentUpdatePriority; + var currentEventPriority = fabricGetCurrentEventPriority + ? fabricGetCurrentEventPriority() + : null; + if (null != currentEventPriority) + switch (currentEventPriority) { + case FabricDiscretePriority: + return 2; + case FabricContinuousPriority: + return 8; + case FabricIdlePriority: + return 268435456; + } + return 32; } -var hydrationErrors = null; -function upgradeHydrationErrorsToRecoverable() { - var queuedErrors = hydrationErrors; - null !== queuedErrors && - (null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = queuedErrors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - queuedErrors - ), - (hydrationErrors = null)); - return queuedErrors; +var scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; +function cloneHiddenInstance(instance) { + var node = instance.node, + updatePayload = reactPrivateInterface.createAttributePayload( + { style: { display: "none" } }, + instance.canonical.viewConfig.validAttributes + ); + return { + node: cloneNodeWithNewProps(node, updatePayload), + canonical: instance.canonical + }; } -var valueCursor = createCursor(null), - currentlyRenderingFiber$1 = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2); - context._currentValue2 = nextValue; +function FragmentInstance(fragmentFiber) { + this._fragmentFiber = fragmentFiber; + this._observers = null; } -function popProvider(context) { - context._currentValue2 = valueCursor.current; - pop(valueCursor); +FragmentInstance.prototype.observeUsing = function (observer) { + null === this._observers && (this._observers = new Set()); + this._observers.add(observer); + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + observeChild, + observer, + void 0, + void 0 + ); +}; +function observeChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.observe(child); + return !1; } -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } +FragmentInstance.prototype.unobserveUsing = function (observer) { + var observers = this._observers; + null !== observers && + observers.has(observer) && + (observers.delete(observer), + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + unobserveChild, + observer, + void 0, + void 0 + )); +}; +function unobserveChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.unobserve(child); + return !1; } -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else - 13 === fiber.tag && - null !== fiber.memoizedState && - null === fiber.memoizedState.dehydrated - ? ((fiber.lanes |= renderLanes), - (nextFiber = fiber.alternate), - null !== nextFiber && (nextFiber.lanes |= renderLanes), - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress +FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; + var children = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectChildren, + children, + void 0, + void 0 + ); + if (0 === children.length) { + children = getPublicInstanceFromHostFiber(parentHostFiber); + parentHostFiber = this._fragmentFiber; + var parentResult = children.compareDocumentPosition(otherNode); + var result = parentResult; + children === otherNode + ? (result = Node.DOCUMENT_POSITION_CONTAINS) + : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && + ((children = [null, null]), + (result = getFragmentParentInstanceOrContainerFiber(parentHostFiber)), + null !== result && + findFragmentInstanceOrTextInstanceSiblings( + children, + parentHostFiber, + result.child, + { foundSelf: !1 } ), - (nextFiber = fiber.child), - (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) - : (nextFiber = fiber.child); - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; + (parentHostFiber = children[1]), + null === parentHostFiber + ? (result = Node.DOCUMENT_POSITION_PRECEDING) + : ((otherNode = + getPublicInstanceFromHostFiber( + parentHostFiber + ).compareDocumentPosition(otherNode)), + (result = + 0 === otherNode || otherNode & Node.DOCUMENT_POSITION_FOLLOWING + ? Node.DOCUMENT_POSITION_FOLLOWING + : Node.DOCUMENT_POSITION_PRECEDING))); + return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); } + parentHostFiber = getPublicInstanceFromHostFiber(children[0]); + children = getPublicInstanceFromHostFiber(children[children.length - 1]); + result = parentHostFiber.compareDocumentPosition(otherNode); + var lastResult = children.compareDocumentPosition(otherNode); + parentResult = + result & Node.DOCUMENT_POSITION_CONTAINED_BY || + lastResult & Node.DOCUMENT_POSITION_CONTAINED_BY; + lastResult = + result & Node.DOCUMENT_POSITION_FOLLOWING && + lastResult & Node.DOCUMENT_POSITION_PRECEDING; + return parentHostFiber === otherNode || + children === otherNode || + parentResult || + lastResult + ? Node.DOCUMENT_POSITION_CONTAINED_BY + : result; +}; +function collectChildren(child, collection) { + collection.push(child); + return !1; } -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - return null !== current; +FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + return null === parentHostFiber + ? this + : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( + getRootNodeOptions + ); +}; +FragmentInstance.prototype.getClientRects = function () { + var rects = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectClientRects, + rects, + void 0, + void 0 + ); + return rects; +}; +function collectClientRects(child, rects) { + child = getPublicInstanceFromHostFiber(child); + rects.push(child.getBoundingClientRect()); + return !1; } -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } +function addFragmentHandleToFiber(child, fragmentInstance) { + child = getPublicInstanceFromHostFiber(child); + null != child && addFragmentHandleToInstance(child, fragmentInstance); return !1; } -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber$1 = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); +function addFragmentHandleToInstance(instance, fragmentInstance) { + null == instance.reactFragments && (instance.reactFragments = new Set()); + instance.reactFragments.add(fragmentInstance); } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber$1, context); +function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { + if (null != childInstance.canonical) { + var publicInstance = getPublicInstance(childInstance); + if (null !== fragmentInstance._observers) { + if (null == publicInstance) + throw Error("Expected to find a host node. This is a bug in React."); + fragmentInstance._observers.forEach(function (observer) { + observer.observe(publicInstance); + }); + } + addFragmentHandleToInstance(publicInstance, fragmentInstance); + } } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { +var HostTransitionContext = { $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, Provider: null, + Consumer: null, _currentValue: null, _currentValue2: null, _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; + }, + scheduleMicrotask = + "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout, + valueStack = [], + index = -1; +function createCursor(defaultValue) { + return { current: defaultValue }; } -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function pop(cursor) { + 0 > index || + ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); } -function queueTransitionTypes(root, transitionTypes) { - if (0 !== (root.pendingLanes & 4194048)) { - var queued = root.transitionTypes; - null === queued && (queued = root.transitionTypes = []); - for (root = 0; root < transitionTypes.length; root++) { - var transitionType = transitionTypes[root]; - -1 === queued.indexOf(transitionType) && queued.push(transitionType); +function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; +} +var emptyContextObject = {}, + globalClientIdCounter$1 = 0; +function getViewTransitionName(props, instance) { + if (null != props.name && "auto" !== props.name) return props.name; + if (null !== instance.autoName) return instance.autoName; + props = pendingEffectsRoot.identifierPrefix; + var globalClientId = globalClientIdCounter$1++; + props = "_" + props + "t_" + globalClientId.toString(32) + "_"; + return (instance.autoName = props); +} +function getClassNameByType(classByType) { + if (null == classByType || "string" === typeof classByType) + return classByType; + var className = null, + activeTypes = pendingTransitionTypes; + if (null !== activeTypes) + for (var i = 0; i < activeTypes.length; i++) { + var match = classByType[activeTypes[i]]; + if (null != match) { + if ("none" === match) return "none"; + className = null == className ? match : className + (" " + match); + } } - } + return null == className ? classByType.default : className; } -var entangledTransitionTypes = null; -function claimQueuedTransitionTypes(root) { - var claimed = root.transitionTypes; - root.transitionTypes = null; - return claimed; +function getViewTransitionClassName(defaultClass, eventClass) { + defaultClass = getClassNameByType(defaultClass); + eventClass = getClassNameByType(eventClass); + return null == eventClass + ? "auto" === defaultClass + ? null + : defaultClass + : "auto" === eventClass + ? null + : eventClass; } function noop() {} -var firstScheduledRoot = null, - lastScheduledRoot = null, - didScheduleMicrotask = !1, - mightHavePendingSyncWork = !1, - isFlushingWork = !1, - currentEventTransitionLane = 0; -function ensureRootIsScheduled(root) { - root !== lastScheduledRoot && - null === root.next && - (null === lastScheduledRoot - ? (firstScheduledRoot = lastScheduledRoot = root) - : (lastScheduledRoot = lastScheduledRoot.next = root)); - mightHavePendingSyncWork = !0; - didScheduleMicrotask || - ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { - if (!isFlushingWork && mightHavePendingSyncWork) { - isFlushingWork = !0; - do { - var didPerformSomeWork = !1; - for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || 0 === root.tag) - if (0 !== syncTransitionLanes) { - var pendingLanes = root.pendingLanes; - if (0 === pendingLanes) var JSCompiler_inline_result = 0; - else { - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes; - JSCompiler_inline_result = - (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; - JSCompiler_inline_result &= - pendingLanes & ~(suspendedLanes & ~pingedLanes); - JSCompiler_inline_result = - JSCompiler_inline_result & 201326741 - ? (JSCompiler_inline_result & 201326741) | 1 - : JSCompiler_inline_result - ? JSCompiler_inline_result | 2 - : 0; - } - 0 !== JSCompiler_inline_result && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, JSCompiler_inline_result)); - } else - (JSCompiler_inline_result = workInProgressRootRenderLanes), - (JSCompiler_inline_result = getNextLanes( - root, - root === workInProgressRoot ? JSCompiler_inline_result : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root, JSCompiler_inline_result) || - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, JSCompiler_inline_result)); - root = root.next; - } - } while (didPerformSomeWork); - isFlushingWork = !1; +var objectIs = "function" === typeof Object.is ? Object.is : is, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + hasOwnProperty = Object.prototype.hasOwnProperty, + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function processRootScheduleInImmediateTask() { - processRootScheduleInMicrotask(); +var contextStackCursor = createCursor(null), + contextFiberStackCursor = createCursor(null), + rootInstanceStackCursor = createCursor(null), + hostTransitionProviderCursor = createCursor(null); +function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor, null); + pop(contextStackCursor); + push(contextStackCursor, PROD_HOST_CONTEXT); } -function processRootScheduleInMicrotask() { - mightHavePendingSyncWork = didScheduleMicrotask = !1; - for ( - var currentTime = now(), prev = null, root = firstScheduledRoot; - null !== root; - - ) { - var next = root.next, - nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); - 0 === nextLanes - ? ((root.next = null), - null === prev ? (firstScheduledRoot = next) : (prev.next = next), - null === next && (lastScheduledRoot = prev)) - : ((prev = root), - 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); - root = next; - } - (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) || - flushSyncWorkAcrossRoots_impl(0, !1); - 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); +function popHostContainer() { + pop(contextStackCursor); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); } -function scheduleTaskForRootDuringMicrotask(root, currentTime) { - for ( - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - expirationTimes = root.expirationTimes, - lanes = root.pendingLanes & -62914561; - 0 < lanes; - - ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7, - expirationTime = expirationTimes[index$7]; - if (-1 === expirationTime) { - if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$7] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (root.expiredLanes |= lane); - lanes &= ~lane; - } - currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - ); - pingedLanes = root.callbackNode; - if ( - 0 === suspendedLanes || - (root === currentTime && - (2 === workInProgressSuspendedReason || - 9 === workInProgressSuspendedReason)) || - null !== root.cancelPendingCommit - ) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackNode = null), - (root.callbackPriority = 0) - ); - if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) - ) { - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; - } - null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; +function pushHostContext(fiber) { + var stateHook = fiber.memoizedState; + null !== stateHook && + ((HostTransitionContext._currentValue2 = stateHook.memoizedState), + push(hostTransitionProviderCursor, fiber)); + stateHook = contextStackCursor.current; + stateHook !== stateHook && + (push(contextFiberStackCursor, fiber), push(contextStackCursor, stateHook)); } -function performWorkOnRootViaSchedulerTask(root, didTimeout) { - if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) - return (root.callbackNode = null), (root.callbackPriority = 0), null; - var originalCallbackNode = root.callbackNode; - if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) - return null; - var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - ); - if (0 === workInProgressRootRenderLanes$jscomp$0) return null; - performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); - scheduleTaskForRootDuringMicrotask(root, now()); - return null != root.callbackNode && root.callbackNode === originalCallbackNode - ? performWorkOnRootViaSchedulerTask.bind(null, root) - : null; +function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor), pop(contextFiberStackCursor)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor), + (HostTransitionContext._currentValue2 = null)); } -function performSyncWorkOnRoot(root, lanes) { - if (flushPendingEffects()) return null; - performWorkOnRoot(root, lanes, !0); +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function scheduleImmediateRootScheduleTask() { - scheduleMicrotask(function () { - 0 !== (executionContext & 6) - ? scheduleCallback$3( - ImmediatePriority, - processRootScheduleInImmediateTask - ) - : processRootScheduleInMicrotask(); - }); +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2); + context._currentValue2 = nextValue; } -function requestTransitionLane() { - if (0 === currentEventTransitionLane) { - var actionScopeLane = currentEntangledLane; - 0 === actionScopeLane && - ((actionScopeLane = nextTransitionUpdateLane), - (nextTransitionUpdateLane <<= 1), - 0 === (nextTransitionUpdateLane & 261888) && - (nextTransitionUpdateLane = 256)); - currentEventTransitionLane = actionScopeLane; +function popProvider(context) { + context._currentValue2 = valueCursor.current; + pop(valueCursor); +} +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - return currentEventTransitionLane; } -var currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null; -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 propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; } - }; + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else + 13 === fiber.tag && + null !== fiber.memoizedState && + null === fiber.memoizedState.dehydrated + ? ((fiber.lanes |= renderLanes), + (nextFiber = fiber.alternate), + null !== nextFiber && (nextFiber.lanes |= renderLanes), + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + workInProgress + ), + (nextFiber = fiber.child), + (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) + : (nextFiber = fiber.child); + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; } -function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - ((entangledTransitionTypes = null), null !== currentEntangledListeners) +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + ) { - null !== currentEntangledActionThenable && - (currentEntangledActionThenable.status = "fulfilled"); - var listeners = currentEntangledListeners; - currentEntangledListeners = null; - currentEntangledLane = 0; - currentEntangledActionThenable = null; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); - } -} -function chainThenableValue(thenable, result) { - var listeners = [], - thenableWithOverride = { - status: "pending", - value: null, - reason: null, - then: function (resolve) { - listeners.push(resolve); - } - }; - thenable.then( - function () { - thenableWithOverride.status = "fulfilled"; - thenableWithOverride.value = result; - for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); - }, - function (error) { - thenableWithOverride.status = "rejected"; - thenableWithOverride.reason = error; - for (error = 0; error < listeners.length; error++) - (0, listeners[error])(void 0); - } - ); - return thenableWithOverride; -} -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - globalMostRecentTransitionTime = now(); - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - if (null !== entangledTransitionTypes) - for (var root = firstScheduledRoot; null !== root; ) - queueTransitionTypes(root, entangledTransitionTypes), (root = root.next); - root = transition.types; - if (null !== root) { - for (var root$18 = firstScheduledRoot; null !== root$18; ) - queueTransitionTypes(root$18, root), (root$18 = root$18.next); - if (0 !== currentEntangledLane) { - root$18 = entangledTransitionTypes; - null === root$18 && (root$18 = entangledTransitionTypes = []); - for (var i = 0; i < root.length; i++) { - var transitionType = root[i]; - -1 === root$18.indexOf(transitionType) && root$18.push(transitionType); + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } + parent = parent.return; } - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; -} -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + return null !== current; } -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) ) - return !1; + return !0; + currentDependencies = currentDependencies.next; } - return !0; + return !1; } -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - thenableState = thenable.reason; - checkIfUseWrappedInAsyncCatch(thenableState); - if (void 0 === thenableState && !("reason" in thenable)) - throw Error( - "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." - ); - throw thenableState; - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function resolveLazy(lazyType) { - try { - var init = lazyType._init; - return init(lazyType._payload); - } catch (x) { - if (null !== x && "object" === typeof x && "function" === typeof x.then) - throw ((suspendedThenable = x), SuspenseException); - throw x; - } +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; +function readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } -var thenableState$1 = null, - thenableIndexCounter$1 = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - return trackUsedThenable(thenableState$1, thenable, index); -} -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; -} -function throwOnInvalidObjectTypeImpl(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 releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -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 queueTransitionTypes(root, transitionTypes) { + if (0 !== (root.pendingLanes & 4194048)) { + var queued = root.transitionTypes; + null === queued && (queued = root.transitionTypes = []); + for (root = 0; root < transitionTypes.length; root++) { + var transitionType = transitionTypes[root]; + -1 === queued.indexOf(transitionType) && queued.push(transitionType); } } - 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.index, currentFirstChild) - : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 134217730; - return lastPlacedIndex; +} +var entangledTransitionTypes = null; +function claimQueuedTransitionTypes(root) { + var claimed = root.transitionTypes; + root.transitionTypes = null; + return claimed; +} +var firstScheduledRoot = null, + lastScheduledRoot = null, + didScheduleMicrotask = !1, + mightHavePendingSyncWork = !1, + isFlushingWork = !1, + currentEventTransitionLane = 0; +function ensureRootIsScheduled(root) { + root !== lastScheduledRoot && + null === root.next && + (null === lastScheduledRoot + ? (firstScheduledRoot = lastScheduledRoot = root) + : (lastScheduledRoot = lastScheduledRoot.next = root)); + mightHavePendingSyncWork = !0; + didScheduleMicrotask || + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); +} +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes) { + if (!isFlushingWork && mightHavePendingSyncWork) { + isFlushingWork = !0; + do { + var didPerformSomeWork = !1; + for (var root = firstScheduledRoot; null !== root; ) { + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + JSCompiler_inline_result = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + JSCompiler_inline_result &= + pendingLanes & ~(suspendedLanes & ~pingedLanes); + JSCompiler_inline_result = + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 + : JSCompiler_inline_result + ? JSCompiler_inline_result | 2 + : 0; + } + 0 !== JSCompiler_inline_result && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root, + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + )), + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + root = root.next; + } + } while (didPerformSomeWork); + isFlushingWork = !1; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 134217730); - return newFiber; +} +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} +function processRootScheduleInMicrotask() { + mightHavePendingSyncWork = didScheduleMicrotask = !1; + for ( + var currentTime = now(), prev = null, root = firstScheduledRoot; + null !== root; + + ) { + var next = root.next, + nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); + 0 === nextLanes + ? ((root.next = null), + null === prev ? (firstScheduledRoot = next) : (prev.next = next), + null === next && (lastScheduledRoot = prev)) + : ((prev = root), + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); + root = next; } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; + (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) || + flushSyncWorkAcrossRoots_impl(0); + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); +} +function scheduleTaskForRootDuringMicrotask(root, currentTime) { + for ( + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + expirationTimes = root.expirationTimes, + lanes = root.pendingLanes & -62914561; + 0 < lanes; + + ) { + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + lanes &= ~lane; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (returnFiber = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - coerceRef(returnFiber, element), - returnFiber - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + currentTime = workInProgressRoot; + suspendedLanes = workInProgressRootRenderLanes; + suspendedLanes = getNextLanes( + root, + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); + pingedLanes = root.callbackNode; + if ( + 0 === suspendedLanes || + (root === currentTime && + (2 === workInProgressSuspendedReason || + 9 === workInProgressSuspendedReason)) || + null !== root.cancelPendingCommit + ) + return ( + null !== pingedLanes && + null !== pingedLanes && + cancelCallback$1(pingedLanes), + (root.callbackNode = null), + (root.callbackPriority = 0) ); - coerceRef(current, element); - current.return = returnFiber; - return current; + if ( + 0 === (suspendedLanes & 3) || + checkIfRootIsPrerendering(root, suspendedLanes) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; + var originalCallbackNode = root.callbackNode; + if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now()); + return null != root.callbackNode && root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPendingEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} +function scheduleImmediateRootScheduleTask() { + scheduleMicrotask(function () { + 0 !== (executionContext & 6) + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); + }); +} +function requestTransitionLane() { + if (0 === currentEventTransitionLane) { + var actionScopeLane = currentEntangledLane; + 0 === actionScopeLane && + ((actionScopeLane = nextTransitionUpdateLane), + (nextTransitionUpdateLane <<= 1), + 0 === (nextTransitionUpdateLane & 261888) && + (nextTransitionUpdateLane = 256)); + currentEventTransitionLane = actionScopeLane; } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; + return currentEventTransitionLane; +} +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null; +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 createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - createChild(returnFiber, newChild, lanes) - ); + currentEntangledPendingCount++; + thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); + return thenable; +} +function pingEngtangledActionScope() { + if ( + 0 === --currentEntangledPendingCount && + ((entangledTransitionTypes = null), null !== currentEntangledListeners) + ) { + null !== currentEntangledActionThenable && + (currentEntangledActionThenable.status = "fulfilled"); + var listeners = currentEntangledListeners; + currentEntangledListeners = null; + currentEntangledLane = 0; + currentEntangledActionThenable = null; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); + } +} +function chainThenableValue(thenable, result) { + var listeners = [], + thenableWithOverride = { + status: "pending", + value: null, + reason: null, + then: function (resolve) { + listeners.push(resolve); + } + }; + thenable.then( + function () { + thenableWithOverride.status = "fulfilled"; + thenableWithOverride.value = result; + for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); + }, + function (error) { + thenableWithOverride.status = "rejected"; + thenableWithOverride.reason = error; + for (error = 0; error < listeners.length; error++) + (0, listeners[error])(void 0); + } + ); + return thenableWithOverride; +} +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + globalMostRecentTransitionTime = now(); + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + if (null !== entangledTransitionTypes) + for (var root = firstScheduledRoot; null !== root; ) + queueTransitionTypes(root, entangledTransitionTypes), (root = root.next); + root = transition.types; + if (null !== root) { + for (var root$16 = firstScheduledRoot; null !== root$16; ) + queueTransitionTypes(root$16, root), (root$16 = root$16.next); + if (0 !== currentEntangledLane) { + root$16 = entangledTransitionTypes; + null === root$16 && (root$16 = entangledTransitionTypes = []); + for (var i = 0; i < root.length; i++) { + var transitionType = root[i]; + -1 === root$16.indexOf(transitionType) && root$16.push(transitionType); } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectTypeImpl(returnFiber, newChild); } - return null; } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; +} +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); +} +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +} +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) ) - 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 - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes + return !1; + } + return !0; +} +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; +} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + thenableState = thenable.reason; + checkIfUseWrappedInAsyncCatch(thenableState); + if (void 0 === thenableState && !("reason" in thenable)) + throw Error( + "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes + throw thenableState; + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } ); - throwOnInvalidObjectTypeImpl(returnFiber, newChild); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } +} +function resolveLazy(lazyType) { + try { + var init = lazyType._init; + return init(lazyType._payload); + } catch (x) { + if (null !== x && "object" === typeof x && "function" === typeof x.then) + throw ((suspendedThenable = x), SuspenseException); + throw x; + } +} +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); +} +var thenableState$1 = null, + thenableIndexCounter$1 = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + return trackUsedThenable(thenableState$1, thenable, index); +} +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectTypeImpl(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 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 updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null === currentFirstChild.key + ? existingChildren.set(currentFirstChild.index, currentFirstChild) + : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 134217730; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 134217730); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (returnFiber = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + coerceRef(returnFiber, element), + returnFiber + ); if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + return ( + (newChild = resolveLazy(newChild)), + createChild(returnFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(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 + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (newChild = resolveLazy(newChild)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(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), @@ -3391,15 +2700,7 @@ function createChildReconciler(shouldTrackSideEffects) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) - ) - throw x; + if (x === SuspenseException || x === SuspenseActionException) throw x; var fiber = createFiberImplClass(29, x, null, returnFiber.mode); fiber.lanes = lanes; fiber.return = returnFiber; @@ -4102,7 +3403,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$48 = !1; + didReadFromEntangledAsyncAction$46 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4124,11 +3425,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$48 = !0); + (didReadFromEntangledAsyncAction$46 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$48 = !0); + (didReadFromEntangledAsyncAction$46 = !0); continue; } else (updateLane = { @@ -4176,7 +3477,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$48 && + didReadFromEntangledAsyncAction$46 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4380,8 +3681,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$52) { - onActionError(actionQueue, node, error$52); + } catch (error$50) { + onActionError(actionQueue, node, error$50); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4656,17 +3957,34 @@ function updateMemo(nextCreate, deps) { function mountDeferredValueImpl(hook, value, initialValue) { if ( void 0 === initialValue || + objectIs(value, initialValue) || (0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930)) ) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + hook.memoizedState = { value: initialValue, isInitial: !0 }; hook = requestDeferredLane(); currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; return initialValue; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { +function updateDeferredValueImpl( + hook, + prevValue, + prevIsInitial, + value, + initialValue +) { + if (prevIsInitial) { + if (objectIs(value, prevValue)) + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + if (void 0 !== initialValue) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + } if (objectIs(value, prevValue)) return value; if (null !== currentTreeHiddenStackCursor.current) return ( @@ -4679,7 +3997,11 @@ function updateDeferredValueImpl(hook, prevValue, value, initialValue) { (0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930)) ) - return (didReceiveUpdate = !0), (hook.memoizedState = value); + return ( + (didReceiveUpdate = !0), + (hook.memoizedState = { value: value, isInitial: !1 }), + value + ); hook = requestDeferredLane(); currentlyRenderingFiber.lanes |= hook; workInProgressRootSkippedLanes |= hook; @@ -4727,7 +4049,7 @@ function startTransition(fiber, queue, pendingState, finishedState, callback) { fiber, queue, { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) + requestUpdateLane() ); } finally { (currentUpdatePriority = previousPriority), @@ -4751,7 +4073,7 @@ function refreshCache(fiber) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(provider); + var lane = requestUpdateLane(); fiber = createUpdate(lane); var root = enqueueUpdate(provider, fiber, lane); null !== root && @@ -4765,7 +4087,7 @@ function refreshCache(fiber) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); + var lane = requestUpdateLane(); action = { lane: lane, revertLane: 0, @@ -4783,7 +4105,7 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); + var lane = requestUpdateLane(); dispatchSetStateInternal(fiber, queue, action, lane); } function dispatchSetStateInternal(fiber, queue, action, lane) { @@ -5095,10 +4417,12 @@ var ContextOnlyDispatcher = { }, useDebugValue: mountDebugValue, useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); + var hook = updateWorkInProgressHook(), + prevState = currentHook.memoizedState; return updateDeferredValueImpl( hook, - currentHook.memoizedState, + prevState.value, + prevState.isInitial, value, initialValue ); @@ -5144,14 +4468,16 @@ var ContextOnlyDispatcher = { useDebugValue: mountDebugValue, useDeferredValue: function (value, initialValue) { var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); + if (null === currentHook) + return mountDeferredValueImpl(hook, value, initialValue); + var prevState = currentHook.memoizedState; + return updateDeferredValueImpl( + hook, + prevState.value, + prevState.isInitial, + value, + initialValue + ); }, useTransition: function () { var booleanOrThenable = rerenderReducer(basicStateReducer)[0], @@ -5198,7 +4524,7 @@ function applyDerivedStateFromProps( var classComponentUpdater = { enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(inst), + var lane = requestUpdateLane(), update = createUpdate(lane); update.payload = payload; void 0 !== callback && null !== callback && (update.callback = callback); @@ -5209,7 +4535,7 @@ var classComponentUpdater = { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(inst), + var lane = requestUpdateLane(), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -5221,7 +4547,7 @@ var classComponentUpdater = { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(inst), + var lane = requestUpdateLane(), update = createUpdate(lane); update.tag = 2; void 0 !== callback && null !== callback && (update.callback = callback); @@ -5247,20 +4573,6 @@ function checkShouldComponentUpdate( ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } -function constructClassInstance(workInProgress, ctor, props) { - var context = emptyContextObject, - contextType = ctor.contextType; - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - return ctor; -} function callComponentWillReceiveProps( workInProgress, instance, @@ -5275,39 +4587,6 @@ function callComponentWillReceiveProps( instance.state !== workInProgress && classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - instance.context = - "object" === typeof contextType && null !== contextType - ? readContext(contextType) - : emptyContextObject; - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); -} function resolveClassComponentProps(Component, baseProps) { var newProps = baseProps; if ("ref" in baseProps) { @@ -5402,106 +4681,70 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && + returnFiber = sourceFiber.alternate; + null !== returnFiber && propagateParentContextChanges( - currentSourceFiber, + returnFiber, sourceFiber, rootRenderLanes, !0 ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { + returnFiber = suspenseHandlerStackCursor.current; + if (null !== returnFiber) { + switch (returnFiber.tag) { case 31: case 13: case 19: return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - 0 === (currentSourceFiber.mode & 1) - ? currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)) - : ((currentSourceFiber.flags |= 65536), - (currentSourceFiber.lanes = rootRenderLanes)), + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === returnFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3), + (returnFiber.flags &= -257), + (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? (returnFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + return ( + (returnFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (returnFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } throw Error( "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + + returnFiber.tag + "). This is a bug in React." ); } - if (1 === root.tag) - return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 - ); - value = Error( - "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." - ); + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } - currentSourceFiber = createCapturedValueAtFiber( + var error = createCapturedValueAtFiber( Error( "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", { cause: value } @@ -5509,8 +4752,8 @@ function throwException( sourceFiber ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); + ? (workInProgressRootConcurrentErrors = [error]) + : workInProgressRootConcurrentErrors.push(error); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; value = createCapturedValueAtFiber(value, sourceFiber); @@ -5527,16 +4770,14 @@ function throwException( ); case 1: sourceFiber = returnFiber.type; - currentSourceFiber = returnFiber.stateNode; + error = returnFiber.stateNode; if ( 0 === (returnFiber.flags & 128) && ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && + (null !== error && + "function" === typeof error.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - )))) + !legacyErrorBoundariesThatAlreadyFailed.has(error)))) ) return ( (returnFiber.flags |= 65536), @@ -5729,12 +4970,7 @@ function updateOffscreenComponent( nextProps ); } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -5899,41 +5135,85 @@ function updateClassComponent( renderLanes ) { prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType, - nextContext = emptyContextObject; + if (null === workInProgress.stateNode) { + var context = emptyContextObject, + contextType = Component.contextType; "object" === typeof contextType && null !== contextType && - (nextContext = readContext(contextType)); + (context = readContext(contextType)); + context = new Component(nextProps, context); + workInProgress.memoizedState = + null !== context.state && void 0 !== context.state ? context.state : null; + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + context = workInProgress.stateNode; + context.props = nextProps; + context.state = workInProgress.memoizedState; + context.refs = {}; + initializeUpdateQueue(workInProgress); + contextType = Component.contextType; + context.context = + "object" === typeof contextType && null !== contextType + ? readContext(contextType) + : emptyContextObject; + context.state = workInProgress.memoizedState; + contextType = Component.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps( + workInProgress, + Component, + contextType, + nextProps + ), + (context.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ((contextType = context.state), + "function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount(), + contextType !== context.state && + classComponentUpdater.enqueueReplaceState(context, context.state, null), + processUpdateQueue(workInProgress, nextProps, context, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (context.state = workInProgress.memoizedState)); + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308); + nextProps = !0; + } else if (null === current) { + context = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + context.props = oldProps; + var oldContext = context.context, + contextType$jscomp$0 = Component.contextType; + contextType = emptyContextObject; + "object" === typeof contextType$jscomp$0 && + null !== contextType$jscomp$0 && + (contextType = readContext(contextType$jscomp$0)); var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType = + contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; + "function" === typeof context.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== nextContext) && + contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - instance, + context, nextProps, - nextContext + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || oldState !== oldContext || hasForceUpdate @@ -5954,36 +5234,36 @@ function updateClassComponent( nextProps, oldState, oldContext, - nextContext + contextType )) - ? (contextType || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && + ? (contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ("function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount()), + "function" === typeof context.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && + : ("function" === typeof context.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = nextContext), + (context.props = nextProps), + (context.state = oldContext), + (context.context = contextType), (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && + : ("function" === typeof context.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - instance = workInProgress.stateNode; + context = workInProgress.stateNode; cloneUpdateQueue(current, workInProgress); - nextContext = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, nextContext); - instance.props = contextType; + contextType = workInProgress.memoizedProps; + contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); + context.props = contextType$jscomp$0; getDerivedStateFromProps = workInProgress.pendingProps; - oldState = instance.context; + oldState = context.context; oldContext = Component.contextType; oldProps = emptyContextObject; "object" === typeof oldContext && @@ -5992,23 +5272,23 @@ function updateClassComponent( unresolvedOldProps = Component.getDerivedStateFromProps; (oldContext = "function" === typeof unresolvedOldProps || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((nextContext !== getDerivedStateFromProps || oldState !== oldProps) && + "function" === typeof context.getSnapshotBeforeUpdate) || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps( workInProgress, - instance, + context, nextProps, oldProps )); hasForceUpdate = !1; oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - nextContext !== getDerivedStateFromProps || + contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || (null !== current && @@ -6022,12 +5302,12 @@ function updateClassComponent( nextProps ), (newState = workInProgress.memoizedState)), - (contextType = + (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - contextType, + contextType$jscomp$0, nextProps, oldState, newState, @@ -6037,89 +5317,136 @@ function updateClassComponent( null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (oldContext || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldProps), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( + ("function" !== typeof context.UNSAFE_componentWillUpdate && + "function" !== typeof context.componentWillUpdate) || + ("function" === typeof context.componentWillUpdate && + context.componentWillUpdate(nextProps, newState, oldProps), + "function" === typeof context.UNSAFE_componentWillUpdate && + context.UNSAFE_componentWillUpdate( nextProps, newState, oldProps )), - "function" === typeof instance.componentDidUpdate && + "function" === typeof context.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && + "function" === typeof context.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (nextContext === current.memoizedProps && + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && oldState === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (nextContext === current.memoizedProps && + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldProps), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (nextContext === current.memoizedProps && + (context.props = nextProps), + (context.state = newState), + (context.context = oldProps), + (nextProps = contextType$jscomp$0)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && oldState === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (nextContext === current.memoizedProps && + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && oldState === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - !1, - renderLanes - ); -} -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { + context = nextProps; markRef(current, workInProgress); - hasContext = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !hasContext) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - shouldUpdate = workInProgress.stateNode; - Component = - hasContext && "function" !== typeof Component.getDerivedStateFromError - ? null - : shouldUpdate.render(); - workInProgress.flags |= 1; - null !== current && hasContext - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( + nextProps = 0 !== (workInProgress.flags & 128); + context || nextProps + ? ((context = workInProgress.stateNode), + (Component = + nextProps && "function" !== typeof Component.getDerivedStateFromError + ? null + : context.render()), + (workInProgress.flags |= 1), + null !== current && nextProps + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes), + (workInProgress.memoizedState = context.state), + (current = workInProgress.child)) + : (current = bailoutOnAlreadyFinishedWork( + current, workInProgress, - null, - Component, renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - return workInProgress.child; + )); + return current; } -var SUSPENDED_MARKER = { +function mountLazyComponent(workInProgress, elementType, renderLanes) { + var props = workInProgress.pendingProps; + elementType = resolveLazy(elementType); + workInProgress.type = elementType; + if ("function" === typeof elementType) { + if (shouldConstruct(elementType)) + return ( + (props = resolveClassComponentProps(elementType, props)), + (workInProgress.tag = 1), + updateClassComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ) + ); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ); + } + if (void 0 !== elementType && null !== elementType) { + var $$typeof = elementType.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) + return ( + (workInProgress.tag = 11), + updateForwardRef(null, workInProgress, elementType, props, renderLanes) + ); + if ($$typeof === REACT_MEMO_TYPE) + return ( + (workInProgress.tag = 14), + updateMemoComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ) + ); + if ($$typeof === REACT_CONTEXT_TYPE) + return ( + (workInProgress.tag = 10), + (workInProgress.type = elementType), + updateContextProvider(null, workInProgress, renderLanes) + ); + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + workInProgress + + ". Lazy element type must resolve to a class or function." + ); +} +var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0, @@ -6153,44 +5480,40 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { if (null === current) { didSuspend = nextProps.children; nextProps = nextProps.fallback; - if (showFallback) { - reuseSuspenseHandlerOnStack(); - showFallback = workInProgress.mode; - var progressedPrimaryFragment = workInProgress.child; - didSuspend = { mode: "hidden", children: didSuspend }; - 0 === (showFallback & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = didSuspend)) - : (progressedPrimaryFragment = mountWorkInProgressOffscreenFiber( - didSuspend, - showFallback - )); - nextProps = createFiberFromFragment( - nextProps, - showFallback, - renderLanes, - null - ); - progressedPrimaryFragment.return = workInProgress; - nextProps.return = workInProgress; - progressedPrimaryFragment.sibling = nextProps; - workInProgress.child = progressedPrimaryFragment; - nextProps = workInProgress.child; - nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(), + (showFallback = workInProgress.mode), + (didSuspend = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: didSuspend }, + showFallback + )), + (nextProps = createFiberFromFragment( + nextProps, + showFallback, + renderLanes, + null + )), + (didSuspend.return = workInProgress), + (nextProps.return = workInProgress), + (didSuspend.sibling = nextProps), + (workInProgress.child = didSuspend), + (nextProps = workInProgress.child), + (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(null, nextProps) ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(null, nextProps); - } pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren(workInProgress, didSuspend); } - progressedPrimaryFragment = current.memoizedState; - if (null !== progressedPrimaryFragment) { - var dehydrated = progressedPrimaryFragment.dehydrated; + var prevState = current.memoizedState; + if (null !== prevState) { + var dehydrated = prevState.dehydrated; if (null !== dehydrated) return updateDehydratedSuspenseComponent( current, @@ -6199,88 +5522,78 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { JSCompiler_temp, nextProps, dehydrated, - progressedPrimaryFragment, + prevState, renderLanes ); } - if (showFallback) { - reuseSuspenseHandlerOnStack(); - showFallback = nextProps.fallback; - didSuspend = workInProgress.mode; - progressedPrimaryFragment = current.child; - dehydrated = progressedPrimaryFragment.sibling; - var primaryChildProps = { mode: "hidden", children: nextProps.children }; - 0 === (didSuspend & 1) && workInProgress.child !== progressedPrimaryFragment - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = primaryChildProps), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - progressedPrimaryFragment, - primaryChildProps - )), - (nextProps.subtreeFlags = - progressedPrimaryFragment.subtreeFlags & 1206910976)); - null !== dehydrated - ? (showFallback = createWorkInProgress(dehydrated, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - didSuspend, - renderLanes, - null - )), - (showFallback.flags |= 2)); - showFallback.return = workInProgress; - nextProps.return = workInProgress; - nextProps.sibling = showFallback; - workInProgress.child = nextProps; - bailoutOffscreenComponent(null, nextProps); - nextProps = workInProgress.child; - showFallback = current.child.memoizedState; - null === showFallback - ? (showFallback = mountSuspenseOffscreenState(renderLanes)) - : ((didSuspend = showFallback.cachePool), - null !== didSuspend - ? ((progressedPrimaryFragment = CacheContext._currentValue2), - (didSuspend = - didSuspend.parent !== progressedPrimaryFragment - ? { - parent: progressedPrimaryFragment, - pool: progressedPrimaryFragment - } - : didSuspend)) - : (didSuspend = getSuspendedCache()), - (showFallback = { - baseLanes: showFallback.baseLanes | renderLanes, - cachePool: didSuspend - })); - nextProps.memoizedState = showFallback; - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(), + (showFallback = nextProps.fallback), + (didSuspend = workInProgress.mode), + (prevState = current.child), + (dehydrated = prevState.sibling), + (nextProps = updateWorkInProgressOffscreenFiber(prevState, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = prevState.subtreeFlags & 1206910976), + null !== dehydrated + ? (showFallback = createWorkInProgress(dehydrated, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + didSuspend, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + bailoutOffscreenComponent(null, nextProps), + (nextProps = workInProgress.child), + (showFallback = current.child.memoizedState), + null === showFallback + ? (showFallback = mountSuspenseOffscreenState(renderLanes)) + : ((didSuspend = showFallback.cachePool), + null !== didSuspend + ? ((prevState = CacheContext._currentValue2), + (didSuspend = + didSuspend.parent !== prevState + ? { parent: prevState, pool: prevState } + : didSuspend)) + : (didSuspend = getSuspendedCache()), + (showFallback = { + baseLanes: showFallback.baseLanes | renderLanes, + cachePool: didSuspend + })), + (nextProps.memoizedState = showFallback), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(current.child, nextProps) ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(current.child, nextProps); - } pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = updateWorkInProgressOffscreenFiber(renderLanes, { mode: "visible", children: nextProps.children }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; + renderLanes.return = workInProgress; + renderLanes.sibling = null; null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; workInProgress.memoizedState = null; - return JSCompiler_temp; + return renderLanes; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = mountWorkInProgressOffscreenFiber( @@ -6295,6 +5608,9 @@ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { offscreenProps.lanes = 0; return offscreenProps; } +function updateWorkInProgressOffscreenFiber(current, offscreenProps) { + return createWorkInProgress(current, offscreenProps); +} function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -6355,8 +5671,7 @@ function updateDehydratedSuspenseComponent( suspenseState.return = workInProgress; nextProps.sibling = suspenseState; workInProgress.child = nextProps; - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers(workInProgress, current.child, null, renderLanes); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); nextProps = workInProgress.child; nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); nextProps.childLanes = getRemainingWorkInPrimaryTree( @@ -6525,71 +5840,67 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) { current.sibling.return = current.return; current = current.sibling; } - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "backwards": - renderLanes = findLastContentRow(workInProgress.child); + switch (revealOrder) { + case "backwards": + renderLanes = findLastContentRow(workInProgress.child); + null === renderLanes + ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null), + reverseChildren(workInProgress)); + initSuspenseListRenderState( + workInProgress, + !0, + revealOrder, + null, + tailMode, + 0 + ); + break; + case "unstable_legacy-backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode, + 0 + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0, 0); + break; + case "independent": + workInProgress.memoizedState = null; + break; + default: + (renderLanes = findLastContentRow(workInProgress.child)), null === renderLanes ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null), - reverseChildren(workInProgress)); + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)), initSuspenseListRenderState( workInProgress, - !0, + !1, revealOrder, - null, - tailMode, - 0 - ); - break; - case "unstable_legacy-backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, renderLanes, - null, tailMode, 0 ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0, 0); - break; - case "independent": - workInProgress.memoizedState = null; - break; - default: - (renderLanes = findLastContentRow(workInProgress.child)), - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)), - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode, - 0 - ); - } + } return workInProgress.child; } function updateContextProvider(current, workInProgress, renderLanes) { @@ -6598,13 +5909,6 @@ function updateContextProvider(current, workInProgress, renderLanes) { reconcileChildren(current, workInProgress, newProps.children, renderLanes); return workInProgress.child; } -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); -} function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { null !== current && (workInProgress.dependencies = current.dependencies); workInProgressRootSkippedLanes |= workInProgress.lanes; @@ -6674,22 +5978,22 @@ function attemptEarlyBailoutIfNoScheduledUpdate( ); break; case 13: - var state$76 = workInProgress.memoizedState; - if (null !== state$76) { - if (null !== state$76.dehydrated) + var state$74 = workInProgress.memoizedState; + if (null !== state$74) { + if (null !== state$74.dehydrated) return ( pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags |= 128), null ); - state$76 = propagateParentContextChanges( + state$74 = propagateParentContextChanges( current, workInProgress, renderLanes, !1 ); var primaryChildLanes = workInProgress.child.childLanes; - if (state$76 || 0 !== (renderLanes & primaryChildLanes)) + if (state$74 || 0 !== (renderLanes & primaryChildLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); pushPrimaryTreeSuspenseHandler(workInProgress); current = bailoutOnAlreadyFinishedWork( @@ -6709,17 +6013,17 @@ function attemptEarlyBailoutIfNoScheduledUpdate( renderLanes ); primaryChildLanes = 0 !== (current.flags & 128); - state$76 = 0 !== (renderLanes & workInProgress.childLanes); - state$76 || + state$74 = 0 !== (renderLanes & workInProgress.childLanes); + state$74 || (propagateParentContextChanges( current, workInProgress, renderLanes, !1 ), - (state$76 = 0 !== (renderLanes & workInProgress.childLanes))); + (state$74 = 0 !== (renderLanes & workInProgress.childLanes))); if (primaryChildLanes) { - if (state$76) + if (state$74) return updateSuspenseListComponent( current, workInProgress, @@ -6733,7 +6037,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( (primaryChildLanes.tail = null), (primaryChildLanes.lastEffect = null)); pushSuspenseListContext(workInProgress, suspenseStackCursor.current); - if (state$76) break; + if (state$74) break; else return null; case 22: return ( @@ -6773,74 +6077,11 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: - var elementType = workInProgress.elementType; - a: if ( - (resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (current = workInProgress.pendingProps), - (elementType = resolveLazy(elementType)), - (workInProgress.type = elementType), - "function" === typeof elementType) - ) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) { - var $$typeof = elementType.$$typeof; - if ($$typeof === REACT_FORWARD_REF_TYPE) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if ($$typeof === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if ($$typeof === REACT_CONTEXT_TYPE) { - workInProgress.tag = 10; - workInProgress.type = elementType; - workInProgress = updateContextProvider( - null, - workInProgress, - renderLanes - ); - break a; - } - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - workInProgress + - ". Lazy element type must resolve to a class or function." - ); - } - return workInProgress; + return mountLazyComponent( + workInProgress, + workInProgress.elementType, + renderLanes + ); case 0: return updateFunctionComponent( current, @@ -6850,33 +6091,31 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); case 1: - return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, + var Component$76 = workInProgress.type, + resolvedProps = resolveClassComponentProps( + Component$76, workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - $$typeof, - renderLanes - ) + ); + return updateClassComponent( + current, + workInProgress, + Component$76, + resolvedProps, + renderLanes ); case 3: pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - $$typeof = workInProgress.memoizedState; - elementType = $$typeof.element; + resolvedProps = workInProgress.memoizedState; + Component$76 = resolvedProps.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== $$typeof.cache && + nextCache !== resolvedProps.cache && propagateContextChanges( workInProgress, [CacheContext], @@ -6884,14 +6123,19 @@ function beginWork(current, workInProgress, renderLanes) { !0 ); suspendIfUpdateReadFromEntangledAsyncAction(); - $$typeof = nextProps.element; - $$typeof === elementType + resolvedProps = nextProps.element; + resolvedProps === Component$76 ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, $$typeof, renderLanes), + : (reconcileChildren( + current, + workInProgress, + resolvedProps, + renderLanes + ), (workInProgress = workInProgress.child)); return workInProgress; case 26: @@ -6899,9 +6143,9 @@ function beginWork(current, workInProgress, renderLanes) { case 5: return ( pushHostContext(workInProgress), - (elementType = workInProgress.pendingProps.children), + (Component$76 = workInProgress.pendingProps.children), null !== workInProgress.memoizedState && - (($$typeof = renderWithHooks( + ((resolvedProps = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6909,9 +6153,9 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = $$typeof)), + (HostTransitionContext._currentValue2 = resolvedProps)), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component$76, renderLanes), workInProgress.child ); case 6: @@ -6924,18 +6168,18 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component$76 = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component$76, renderLanes )) : reconcileChildren( current, workInProgress, - elementType, + Component$76, renderLanes ), workInProgress.child @@ -6950,9 +6194,9 @@ function beginWork(current, workInProgress, renderLanes) { ); case 7: return ( - (elementType = workInProgress.pendingProps), + (Component$76 = workInProgress.pendingProps), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component$76, renderLanes), workInProgress.child ); case 8: @@ -6979,13 +6223,13 @@ function beginWork(current, workInProgress, renderLanes) { return updateContextProvider(current, workInProgress, renderLanes); case 9: return ( - ($$typeof = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), + (resolvedProps = workInProgress.type._context), + (Component$76 = workInProgress.pendingProps.children), prepareToReadContext(workInProgress), - ($$typeof = readContext($$typeof)), - (elementType = elementType($$typeof)), + (resolvedProps = readContext(resolvedProps)), + (Component$76 = Component$76(resolvedProps)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component$76, renderLanes), workInProgress.child ); case 14: @@ -7004,53 +6248,15 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.pendingProps, renderLanes ); - case 17: - return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, $$typeof), - mountClassInstance(workInProgress, elementType, $$typeof, renderLanes), - finishClassComponent( - null, - workInProgress, - elementType, - !0, - !1, - renderLanes - ) - ); - case 28: - return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( - null, - workInProgress, - elementType, - $$typeof, - renderLanes - ) - ); case 19: return updateSuspenseListComponent(current, workInProgress, renderLanes); case 31: - $$typeof = workInProgress.pendingProps; + resolvedProps = workInProgress.pendingProps; nextProps = 0 !== (workInProgress.flags & 128); workInProgress.flags &= -129; if (null === current) - workInProgress = mountActivityChildren(workInProgress, $$typeof); - else if (((elementType = current.memoizedState), null !== elementType)) + workInProgress = mountActivityChildren(workInProgress, resolvedProps); + else if (((Component$76 = current.memoizedState), null !== Component$76)) b: { pushDehydratedActivitySuspenseHandler(workInProgress); if (nextProps) { @@ -7083,16 +6289,19 @@ function beginWork(current, workInProgress, renderLanes) { nextProps = 0 !== (renderLanes & current.childLanes); if (didReceiveUpdate || nextProps) { if (null === currentTreeHiddenStackCursor.current) { - $$typeof = workInProgressRoot; + resolvedProps = workInProgressRoot; if ( - null !== $$typeof && - ((nextProps = getBumpedLaneForHydration($$typeof, renderLanes)), - 0 !== nextProps && nextProps !== elementType.retryLane) + null !== resolvedProps && + ((nextProps = getBumpedLaneForHydration( + resolvedProps, + renderLanes + )), + 0 !== nextProps && nextProps !== Component$76.retryLane) ) throw ( - ((elementType.retryLane = nextProps), + ((Component$76.retryLane = nextProps), enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber($$typeof, current, nextProps), + scheduleUpdateOnFiber(resolvedProps, current, nextProps), SelectiveHydrationException) ); renderDidSuspendDelayIfPossible(); @@ -7103,18 +6312,21 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); } else - (workInProgress = mountActivityChildren(workInProgress, $$typeof)), + (workInProgress = mountActivityChildren( + workInProgress, + resolvedProps + )), (workInProgress.flags |= 134221824); } else - (renderLanes = createWorkInProgress(current.child, { - mode: $$typeof.mode, - children: $$typeof.children + (current = updateWorkInProgressOffscreenFiber(current.child, { + mode: resolvedProps.mode, + children: resolvedProps.children })), - (renderLanes.ref = workInProgress.ref), - (workInProgress.child = renderLanes), - (renderLanes.return = workInProgress), - (workInProgress = renderLanes); + (current.ref = workInProgress.ref), + (workInProgress.child = current), + (current.return = workInProgress), + (workInProgress = current); return workInProgress; case 22: return updateOffscreenComponent( @@ -7126,39 +6338,43 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress), - (elementType = readContext(CacheContext)), + (Component$76 = readContext(CacheContext)), null === current - ? (($$typeof = peekCacheFromPool()), - null === $$typeof && - (($$typeof = workInProgressRoot), + ? ((resolvedProps = peekCacheFromPool()), + null === resolvedProps && + ((resolvedProps = workInProgressRoot), (nextProps = createCache()), - ($$typeof.pooledCache = nextProps), + (resolvedProps.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && ($$typeof.pooledCacheLanes |= renderLanes), - ($$typeof = nextProps)), + null !== nextProps && + (resolvedProps.pooledCacheLanes |= renderLanes), + (resolvedProps = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: $$typeof + parent: Component$76, + cache: resolvedProps }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, $$typeof)) + pushProvider(workInProgress, CacheContext, resolvedProps)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - ($$typeof = current.memoizedState), + (resolvedProps = current.memoizedState), (nextProps = workInProgress.memoizedState), - $$typeof.parent !== elementType - ? (($$typeof = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = $$typeof), + resolvedProps.parent !== Component$76 + ? ((resolvedProps = { + parent: Component$76, + cache: Component$76 + }), + (workInProgress.memoizedState = resolvedProps), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - $$typeof), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== $$typeof.cache && + resolvedProps), + pushProvider(workInProgress, CacheContext, Component$76)) + : ((Component$76 = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component$76), + Component$76 !== resolvedProps.cache && propagateContextChanges( workInProgress, [CacheContext], @@ -7182,17 +6398,17 @@ function beginWork(current, workInProgress, renderLanes) { clones: null, ref: null }), - (elementType = workInProgress.pendingProps), - null != elementType.name && - "auto" !== elementType.name && + (Component$76 = workInProgress.pendingProps), + null != Component$76.name && + "auto" !== Component$76.name && (workInProgress.flags |= null === current ? 18882560 : 18874368), - null !== current && current.memoizedProps.name !== elementType.name + null !== current && current.memoizedProps.name !== Component$76.name ? (workInProgress.flags |= 4194816) : markRef(current, workInProgress), reconcileChildren( current, workInProgress, - elementType.children, + Component$76.children, renderLanes ), workInProgress.child @@ -7349,19 +6565,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$89 = completedWork.child; null !== child$89; ) - (newChildLanes |= child$89.lanes | child$89.childLanes), - (subtreeFlags |= child$89.subtreeFlags & 1206910976), - (subtreeFlags |= child$89.flags & 1206910976), - (child$89.return = completedWork), - (child$89 = child$89.sibling); + for (var child$81 = completedWork.child; null !== child$81; ) + (newChildLanes |= child$81.lanes | child$81.childLanes), + (subtreeFlags |= child$81.subtreeFlags & 1206910976), + (subtreeFlags |= child$81.flags & 1206910976), + (child$81.return = completedWork), + (child$81 = child$81.sibling); else - for (child$89 = completedWork.child; null !== child$89; ) - (newChildLanes |= child$89.lanes | child$89.childLanes), - (subtreeFlags |= child$89.subtreeFlags), - (subtreeFlags |= child$89.flags), - (child$89.return = completedWork), - (child$89 = child$89.sibling); + for (child$81 = completedWork.child; null !== child$81; ) + (newChildLanes |= child$81.lanes | child$81.childLanes), + (subtreeFlags |= child$81.subtreeFlags), + (subtreeFlags |= child$81.flags), + (child$81.return = completedWork), + (child$81 = child$81.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7369,7 +6585,6 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { - case 28: case 16: case 15: case 0: @@ -7615,8 +6830,6 @@ function completeWork(current, workInProgress, renderLanes) { return ( popProvider(workInProgress.type), bubbleProperties(workInProgress), null ); - case 17: - return bubbleProperties(workInProgress), null; case 19: popSuspenseListContext(workInProgress); newProps = workInProgress.memoizedState; @@ -7735,7 +6948,7 @@ function completeWork(current, workInProgress, renderLanes) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192), - newProps && 0 !== (workInProgress.mode & 1) + newProps ? 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), @@ -7775,8 +6988,6 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress), null ); - case 29: - return null; } throw Error( "Unknown unit of work tag (" + @@ -8053,8 +7264,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$117) { - captureCommitPhaseError(current, nearestMountedAncestor, error$117); + } catch (error$109) { + captureCommitPhaseError(current, nearestMountedAncestor, error$109); } else ref.current = null; } @@ -8144,7 +7355,7 @@ function commitHostPortalContainerChildren( ) { portal = portal.containerInfo; try { - completeRoot(portal.containerTag, pendingChildren); + completeRoot$1(portal.containerTag, pendingChildren); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -8356,7 +7567,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) { root && trackEnterViewTransitions(committedLanes), commitBeforeMutationEffects_complete(root); else { - if (22 === committedLanes.tag && 0 !== (committedLanes.mode & 1)) + if (22 === committedLanes.tag) if ( ((deletions = committedLanes.alternate), null !== committedLanes.memoizedState) @@ -8486,11 +7697,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$107) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$107 ); } } @@ -8550,32 +7761,26 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { (retryDehydratedSuspenseBoundary.bind(null, finishedWork), shim$1())); break; case 22: - if (0 !== (finishedWork.mode & 1)) { - if ( - ((flags = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !flags) - ) { - var newOffscreenSubtreeWasHidden = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - current = offscreenSubtreeIsHidden; - prevProps = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = flags; - (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && - !prevProps - ? ((flags = 0), - 0 !== (finishedWork.subtreeFlags & 8772) && (flags |= 1), - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - flags - )) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = current; - offscreenSubtreeWasHidden = prevProps; - } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; + if (!flags) { + var newOffscreenSubtreeWasHidden = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + current = offscreenSubtreeIsHidden; + prevProps = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = flags; + (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && !prevProps + ? ((flags = 0), + 0 !== (finishedWork.subtreeFlags & 8772) && (flags |= 1), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + flags + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = current; + offscreenSubtreeWasHidden = prevProps; + } break; case 30: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8689,21 +7894,15 @@ function commitDeletionEffectsOnFiber( ); break; case 22: - deletedFiber.mode & 1 - ? ((offscreenSubtreeWasHidden = - (instance = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState), - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ), - (offscreenSubtreeWasHidden = instance)) - : recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); + offscreenSubtreeWasHidden = + (instance = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + offscreenSubtreeWasHidden = instance; break; case 30: safelyDetachRef(deletedFiber, nearestMountedAncestor); @@ -8761,7 +7960,7 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { if (!retryCache.has(wakeable)) { retryCache.add(wakeable); var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); - wakeable.then(retry, retry); + attachContextPreservingListener(wakeable, retry); } }); } @@ -8846,7 +8045,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { flags = root.containerInfo; root = root.pendingChildren; try { - completeRoot(flags.containerTag, root), + completeRoot$1(flags.containerTag, root), (viewTransitionMutationContext = !0); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8896,16 +8095,14 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { case 22: ii = null !== finishedWork.memoizedState; _eventPayloads$ii = null !== current && null !== current.memoizedState; - if (finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; - offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || _eventPayloads$ii; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || _eventPayloads$ii; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); flags & 8192 && ((root = finishedWork.stateNode), @@ -8915,7 +8112,6 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { _eventPayloads$ii || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || - 0 === (finishedWork.mode & 1) || ((root = _eventPayloads$ii || offscreenSubtreeWasHidden), (lanes = offscreenSubtreeIsHidden), (current = offscreenSubtreeWasHidden), @@ -9035,15 +8231,13 @@ function commitAfterMutationEffectsOnFiber(finishedWork, root) { viewTransitionContextChanged = current; break; case 22: - 0 !== (finishedWork.mode & 1) - ? null === finishedWork.memoizedState && - (null !== current.memoizedState - ? commitEnterViewTransitions(finishedWork, !1) - : recursivelyTraverseAfterMutationEffects(root, finishedWork)) - : recursivelyTraverseAfterMutationEffects(root, finishedWork); + null === finishedWork.memoizedState && + (null !== current.memoizedState + ? commitEnterViewTransitions(finishedWork, !1) + : recursivelyTraverseAfterMutationEffects(root, finishedWork)); break; case 30: - var prevContextChanged$126 = viewTransitionContextChanged, + var prevContextChanged$116 = viewTransitionContextChanged, prevCancelableChildren = pushViewTransitionCancelableScope(); viewTransitionContextChanged = !1; recursivelyTraverseAfterMutationEffects(root, finishedWork); @@ -9065,7 +8259,7 @@ function commitAfterMutationEffectsOnFiber(finishedWork, root) { ), (viewTransitionCancelableChildren = prevCancelableChildren)); viewTransitionContextChanged = - 0 !== (finishedWork.flags & 32) ? !0 : prevContextChanged$126; + 0 !== (finishedWork.flags & 32) ? !0 : prevContextChanged$116; break; default: recursivelyTraverseAfterMutationEffects(root, finishedWork); @@ -9426,18 +8620,10 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork - ) - : ((_finishedWork$memoize2._visibility |= 2), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ))) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + )) : (isViewTransitionEligible && null !== id && null !== id.memoizedState && @@ -9528,19 +8714,10 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork - ) - : ((instance._visibility |= 2), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) : ((instance._visibility |= 2), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -9813,7 +8990,8 @@ var DefaultAsyncDispatcher = { }, cacheSignal: function () { return readContext(CacheContext).controller.signal; - } + }, + units: null }, PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, @@ -9852,14 +9030,12 @@ var DefaultAsyncDispatcher = { pendingTransitionTypes = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; -function requestUpdateLane(fiber) { - return 0 === (fiber.mode & 1) - ? 2 - : 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes - ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes - : null !== ReactSharedInternals.T - ? requestTransitionLane() - : resolveUpdatePriority(); +function requestUpdateLane() { + return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? requestTransitionLane() + : resolveUpdatePriority(); } function requestDeferredLane() { if (0 === workInProgressDeferredLane) @@ -9915,12 +9091,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressDeferredLane, !1 )), - ensureRootIsScheduled(root), - 2 === lane && - 0 === executionContext && - 0 === (fiber.mode & 1) && - ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(0, !0)); + ensureRootIsScheduled(root); } function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) @@ -9950,7 +9121,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = !1; continue; } - if (0 !== root$jscomp$0.tag && 2 === exitStatus) { + if (2 === exitStatus) { renderWasConcurrent = lanes; if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) var JSCompiler_inline_result = 0; @@ -10188,20 +9359,28 @@ function markRootSuspended( spawnedLane, didAttemptEntireTree ) { - suspendedLanes = getEntangledLanes(root, suspendedLanes); - suspendedLanes &= ~workInProgressRootPingedLanes; - suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; + var entangledLanes = getEntangledLanes(root, suspendedLanes), + prewarmedLanes = 0; + 0 !== (entangledLanes & 1073741824) + ? (prewarmedLanes = entangledLanes & ~(suspendedLanes | 1073741824)) + : (suspendedLanes = entangledLanes); + entangledLanes = + workInProgressRootPingedLanes | workInProgressRootInterleavedUpdatedLanes; + suspendedLanes &= ~entangledLanes; + prewarmedLanes &= ~entangledLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didAttemptEntireTree && (root.warmLanes |= suspendedLanes); + didAttemptEntireTree && + (root.warmLanes = root.warmLanes | suspendedLanes | prewarmedLanes); didAttemptEntireTree = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$8 = 31 - clz32(lanes), - lane = 1 << index$8; - didAttemptEntireTree[index$8] = -1; - lanes &= ~lane; + for (prewarmedLanes = suspendedLanes; 0 < prewarmedLanes; ) { + entangledLanes = 31 - clz32(prewarmedLanes); + var lane = 1 << entangledLanes; + didAttemptEntireTree[entangledLanes] = -1; + prewarmedLanes &= ~lane; } 0 !== spawnedLane && + 0 !== (suspendedLanes & 261930) && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } function resetWorkInProgressStack() { @@ -10224,7 +9403,11 @@ function resetWorkInProgressStack() { function prepareFreshStack(root, lanes) { var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && - ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); + ((root.timeoutHandle = -1), + cancelTimeout(timeoutHandle), + (timeoutHandle = pendingEffectsLanes), + (root.pingedLanes |= root.suspendedLanes & timeoutHandle), + (root.warmLanes &= ~timeoutHandle)); timeoutHandle = root.cancelPendingCommit; null !== timeoutHandle && ((root.cancelPendingCommit = null), timeoutHandle()); @@ -10350,8 +9533,8 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$135) { - handleThrow(root, thrownValue$135); + } catch (thrownValue$125) { + handleThrow(root, thrownValue$125); } while (1); lanes && root.shellSuspendCounter++; @@ -10466,8 +9649,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrentByScheduler(); break; - } catch (thrownValue$137) { - handleThrow(root, thrownValue$137); + } catch (thrownValue$127) { + handleThrow(root, thrownValue$127); } while (1); lastContextDependency = currentlyRenderingFiber$1 = null; @@ -10696,1013 +9879,653 @@ function commitRoot( pendingTransitionTypes, flushMutationEffects, flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) - : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); -} -function flushAfterMutationEffects() { - 3 === pendingEffectsStatus && - ((pendingEffectsStatus = 0), - commitAfterMutationEffectsOnFiber(pendingFinishedWork, pendingEffectsRoot), - (pendingEffectsStatus = 4)); -} -function flushMutationEffects() { - if (1 === pendingEffectsStatus) { - pendingEffectsStatus = 0; - var root = pendingEffectsRoot, - finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { - rootMutationHasEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var previousPriority = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - try { - commitMutationEffectsOnFiber(finishedWork, root, lanes); - } finally { - (executionContext = prevExecutionContext), - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = rootMutationHasEffect); - } - } - root.current = finishedWork; - pendingEffectsStatus = 2; - } -} -function flushLayoutEffects() { - if (2 === pendingEffectsStatus) { - pendingEffectsStatus = 0; - var root = pendingEffectsRoot, - finishedWork = pendingFinishedWork, - rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); - if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { - rootHasLayoutEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var previousPriority = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - try { - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - } finally { - (executionContext = prevExecutionContext), - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = rootHasLayoutEffect); - } - } - pendingEffectsStatus = 3; - } -} -function flushSpawnedWork() { - if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) { - pendingEffectsStatus = 0; - var committedViewTransition = pendingViewTransition; - pendingViewTransition = null; - requestPaint(); - var root = pendingEffectsRoot, - finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - recoverableErrors = pendingRecoverableErrors, - passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; - 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || - 0 !== (finishedWork.flags & passiveSubtreeMask) - ? (pendingEffectsStatus = 5) - : ((pendingEffectsStatus = 0), - (pendingFinishedWork = pendingEffectsRoot = null), - releaseRootPooledCache(root, root.pendingLanes)); - passiveSubtreeMask = root.pendingLanes; - 0 === passiveSubtreeMask && (legacyErrorBoundariesThatAlreadyFailed = null); - lanesToEventPriority(lanes); - finishedWork = finishedWork.stateNode; - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - finishedWork, - void 0, - 128 === (finishedWork.current.flags & 128) - ); - } catch (err) {} - if (null !== recoverableErrors) { - finishedWork = ReactSharedInternals.T; - passiveSubtreeMask = currentUpdatePriority; - currentUpdatePriority = 2; - ReactSharedInternals.T = null; - try { - for ( - var onRecoverableError = root.onRecoverableError, i = 0; - i < recoverableErrors.length; - i++ - ) { - var recoverableError = recoverableErrors[i]; - onRecoverableError(recoverableError.value, { - componentStack: recoverableError.stack - }); - } - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = passiveSubtreeMask); - } - } - recoverableErrors = pendingViewTransitionEvents; - onRecoverableError = pendingTransitionTypes; - pendingTransitionTypes = null; - if ( - null !== recoverableErrors && - ((pendingViewTransitionEvents = null), - null === onRecoverableError && (onRecoverableError = []), - null !== committedViewTransition) - ) - for ( - recoverableError = 0; - recoverableError < recoverableErrors.length; - recoverableError++ - ) - (finishedWork = (0, recoverableErrors[recoverableError])( - onRecoverableError - )), - void 0 !== finishedWork && - committedViewTransition.finished.finally(finishedWork); - 0 !== (pendingEffectsLanes & 3) && 0 !== root.tag && flushPendingEffects(); - ensureRootIsScheduled(root); - passiveSubtreeMask = root.pendingLanes; - 0 !== (lanes & 261930) && 0 !== (passiveSubtreeMask & 42) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); - flushSyncWorkAcrossRoots_impl(0, !1); - } -} -function releaseRootPooledCache(root, remainingLanes) { - 0 === (root.pooledCacheLanes &= remainingLanes) && - ((remainingLanes = root.pooledCache), - null != remainingLanes && - ((root.pooledCache = null), releaseCache(remainingLanes))); -} -function flushPendingEffects() { - null !== pendingViewTransition && (pendingViewTransition = null); - flushMutationEffects(); - flushLayoutEffects(); - flushSpawnedWork(); - return flushPassiveEffects(); -} -function flushPassiveEffects() { - if (5 !== pendingEffectsStatus) return !1; - var root = pendingEffectsRoot, - remainingLanes = pendingEffectsRemainingLanes; - pendingEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority; - ReactSharedInternals.T = null; - renderPriority = pendingPassiveTransitions; - pendingPassiveTransitions = null; - var root$jscomp$0 = pendingEffectsRoot, - lanes = pendingEffectsLanes; - pendingEffectsStatus = 0; - pendingFinishedWork = pendingEffectsRoot = null; - pendingEffectsLanes = 0; - if (0 !== (executionContext & 6)) - throw Error("Cannot flush passive effects while already rendering."); - var prevExecutionContext = executionContext; - executionContext |= 4; - commitPassiveUnmountOnFiber(root$jscomp$0.current); - commitPassiveMountOnFiber( - root$jscomp$0, - root$jscomp$0.current, - lanes, - renderPriority - ); - executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(0, !1); - if ( - injectedHook && - "function" === typeof injectedHook.onPostCommitFiberRoot - ) - try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); - } catch (err) {} - return !0; - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } -} -function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); - null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); -} -function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { - if (3 === sourceFiber.tag) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); - else - for (; null !== nearestMountedAncestor; ) { - if (3 === nearestMountedAncestor.tag) { - captureCommitPhaseErrorOnRoot( - nearestMountedAncestor, - sourceFiber, - error - ); - break; - } else if (1 === nearestMountedAncestor.tag) { - var instance = nearestMountedAncestor.stateNode; - if ( - "function" === - typeof nearestMountedAncestor.type.getDerivedStateFromError || - ("function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance))) - ) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - error = createClassErrorUpdate(2); - instance = enqueueUpdate(nearestMountedAncestor, error, 2); - null !== instance && - (initializeClassErrorUpdate( - error, - instance, - nearestMountedAncestor, - sourceFiber - ), - markRootUpdated$1(instance, 2), - ensureRootIsScheduled(instance)); - break; - } - } - nearestMountedAncestor = nearestMountedAncestor.return; - } -} -function attachPingListener(root, wakeable, lanes) { - var pingCache = root.pingCache; - if (null === pingCache) { - pingCache = root.pingCache = new PossiblyWeakMap(); - var threadIDs = new Set(); - pingCache.set(wakeable, threadIDs); - } else - (threadIDs = pingCache.get(wakeable)), - void 0 === threadIDs && - ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); - threadIDs.has(lanes) || - ((workInProgressRootDidAttachPingListener = !0), - threadIDs.add(lanes), - (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), - wakeable.then(root, root)); -} -function pingSuspendedRoot(root, wakeable, pingedLanes) { - var pingCache = root.pingCache; - null !== pingCache && pingCache.delete(wakeable); - root.pingedLanes |= root.suspendedLanes & pingedLanes; - root.warmLanes &= ~pingedLanes; - workInProgressRoot === root && - (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && - (4 === workInProgressRootExitStatus || - (3 === workInProgressRootExitStatus && - (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes && - 300 > now() - globalMostRecentFallbackTime) - ? 0 === (executionContext & 2) - ? prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes) - : (workInProgressRootPingedLanes |= pingedLanes), - workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && - (workInProgressSuspendedRetryLanes = 0)); - ensureRootIsScheduled(root); -} -function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && - (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); - boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); - null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), - ensureRootIsScheduled(boundaryFiber)); -} -function retryDehydratedSuspenseBoundary(boundaryFiber) { - var suspenseState = boundaryFiber.memoizedState, - retryLane = 0; - null !== suspenseState && (retryLane = suspenseState.retryLane); - retryTimedOutBoundary(boundaryFiber, retryLane); -} -function resolveRetryWakeable(boundaryFiber, wakeable) { - var retryLane = 0; - switch (boundaryFiber.tag) { - case 31: - case 13: - var retryCache = boundaryFiber.stateNode; - var suspenseState = boundaryFiber.memoizedState; - null !== suspenseState && (retryLane = suspenseState.retryLane); - break; - case 19: - retryCache = boundaryFiber.stateNode; - break; - case 22: - retryCache = boundaryFiber.stateNode._retryCache; - break; - default: - throw Error( - "Pinged unknown suspense boundary type. This is probably a bug in React." - ); - } - null !== retryCache && retryCache.delete(wakeable); - retryTimedOutBoundary(boundaryFiber, retryLane); -} -function scheduleCallback(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} -function FiberNode(tag, pendingProps, key, mode) { - this.tag = tag; - this.key = key; - this.sibling = - this.child = - this.return = - this.stateNode = - this.type = - this.elementType = - null; - this.index = 0; - this.refCleanup = this.ref = null; - this.pendingProps = pendingProps; - this.dependencies = - this.memoizedState = - this.updateQueue = - this.memoizedProps = - null; - this.mode = mode; - this.subtreeFlags = this.flags = 0; - this.deletions = null; - this.childLanes = this.lanes = 0; - this.alternate = null; -} -function createFiberImplClass(tag, pendingProps, key, mode) { - return new FiberNode(tag, pendingProps, key, mode); -} -function shouldConstruct(Component) { - Component = Component.prototype; - return !(!Component || !Component.isReactComponent); -} -function createWorkInProgress(current, pendingProps) { - var workInProgress = current.alternate; - null === workInProgress - ? ((workInProgress = createFiberImplClass( - current.tag, - pendingProps, - current.key, - current.mode - )), - (workInProgress.elementType = current.elementType), - (workInProgress.type = current.type), - (workInProgress.stateNode = current.stateNode), - (workInProgress.alternate = current), - (current.alternate = workInProgress)) - : ((workInProgress.pendingProps = pendingProps), - (workInProgress.type = current.type), - (workInProgress.flags = 0), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 1206910976; - workInProgress.childLanes = current.childLanes; - workInProgress.lanes = current.lanes; - workInProgress.child = current.child; - workInProgress.memoizedProps = current.memoizedProps; - workInProgress.memoizedState = current.memoizedState; - workInProgress.updateQueue = current.updateQueue; - pendingProps = current.dependencies; - workInProgress.dependencies = - null === pendingProps - ? null - : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext }; - workInProgress.sibling = current.sibling; - workInProgress.index = current.index; - workInProgress.ref = current.ref; - workInProgress.refCleanup = current.refCleanup; - return workInProgress; -} -function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 1206910978; - var current = workInProgress.alternate; - null === current - ? ((workInProgress.childLanes = 0), - (workInProgress.lanes = renderLanes), - (workInProgress.child = null), - (workInProgress.subtreeFlags = 0), - (workInProgress.memoizedProps = null), - (workInProgress.memoizedState = null), - (workInProgress.updateQueue = null), - (workInProgress.dependencies = null), - (workInProgress.stateNode = null)) - : ((workInProgress.childLanes = current.childLanes), - (workInProgress.lanes = current.lanes), - (workInProgress.child = current.child), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null), - (workInProgress.memoizedProps = current.memoizedProps), - (workInProgress.memoizedState = current.memoizedState), - (workInProgress.updateQueue = current.updateQueue), - (workInProgress.type = current.type), - (renderLanes = current.dependencies), - (workInProgress.dependencies = - null === renderLanes - ? null - : { - lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext - })); - return workInProgress; -} -function createFiberFromTypeAndProps( - type, - key, - pendingProps, - owner, - mode, - lanes -) { - var fiberTag = 0; - owner = type; - if ("function" === typeof owner) shouldConstruct(owner) && (fiberTag = 1); - else if ("string" === typeof owner) fiberTag = 5; - else - a: switch (owner) { - case REACT_ACTIVITY_TYPE: - return ( - (type = createFiberImplClass(31, pendingProps, key, mode)), - (type.elementType = REACT_ACTIVITY_TYPE), - (type.lanes = lanes), - type - ); - case REACT_FRAGMENT_TYPE: - return createFiberFromFragment(pendingProps.children, mode, lanes, key); - case REACT_STRICT_MODE_TYPE: - fiberTag = 8; - mode |= 8; - 0 !== (mode & 1) && (mode |= 16); - break; - case REACT_PROFILER_TYPE: - return ( - (type = createFiberImplClass(12, pendingProps, key, mode | 2)), - (type.elementType = REACT_PROFILER_TYPE), - (type.lanes = lanes), - type - ); - case REACT_SUSPENSE_TYPE: - return ( - (type = createFiberImplClass(13, pendingProps, key, mode)), - (type.elementType = REACT_SUSPENSE_TYPE), - (type.lanes = lanes), - type - ); - case REACT_SUSPENSE_LIST_TYPE: - return ( - (type = createFiberImplClass(19, pendingProps, key, mode)), - (type.elementType = REACT_SUSPENSE_LIST_TYPE), - (type.lanes = lanes), - type - ); - case REACT_LEGACY_HIDDEN_TYPE: - case REACT_VIEW_TRANSITION_TYPE: - return ( - (type = mode | 32), - (type = createFiberImplClass(30, pendingProps, key, type)), - (type.elementType = REACT_VIEW_TRANSITION_TYPE), - (type.lanes = lanes), - (type.stateNode = { - autoName: null, - paired: null, - clones: null, - ref: null - }), - type - ); - default: - if ("object" === typeof owner && null !== owner) - switch (owner.$$typeof) { - case REACT_CONTEXT_TYPE: - fiberTag = 10; - break a; - case REACT_CONSUMER_TYPE: - fiberTag = 9; - break a; - case REACT_FORWARD_REF_TYPE: - fiberTag = 11; - break a; - case REACT_MEMO_TYPE: - fiberTag = 14; - break a; - case REACT_LAZY_TYPE: - fiberTag = 16; - owner = null; - break a; - } - fiberTag = 29; - pendingProps = Error( - "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - ((null === type ? "null" : typeof type) + ".") - ); - owner = null; - } - key = createFiberImplClass(fiberTag, pendingProps, key, mode); - key.elementType = type; - key.type = owner; - key.lanes = lanes; - return key; + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) + : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } -function createFiberFromFragment(elements, mode, lanes, key) { - elements = createFiberImplClass(7, elements, key, mode); - elements.lanes = lanes; - return elements; +function flushAfterMutationEffects() { + 3 === pendingEffectsStatus && + ((pendingEffectsStatus = 0), + commitAfterMutationEffectsOnFiber(pendingFinishedWork, pendingEffectsRoot), + (pendingEffectsStatus = 4)); } -function createFiberFromText(content, mode, lanes) { - content = createFiberImplClass(6, content, null, mode); - content.lanes = lanes; - return content; +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root, lanes); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = 2; + } } -function createFiberFromPortal(portal, mode, lanes) { - mode = createFiberImplClass( - 4, - null !== portal.children ? portal.children : [], - portal.key, - mode - ); - mode.lanes = lanes; - mode.stateNode = { - containerInfo: portal.containerInfo, - pendingChildren: null, - implementation: portal.implementation - }; - return mode; +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + pendingEffectsStatus = 3; + } } -function FiberRootNode( - containerInfo, - tag, - hydrate, - identifierPrefix, - onUncaughtError, - onCaughtError, - onRecoverableError, - onDefaultTransitionIndicator, - formState -) { - this.tag = tag; - this.containerInfo = containerInfo; - this.pingCache = this.current = this.pendingChildren = null; - this.timeoutHandle = -1; - this.callbackNode = - this.next = - this.pendingContext = - this.context = - this.cancelPendingCommit = - null; - this.callbackPriority = 0; - this.expirationTimes = createLaneMap(-1); - this.entangledLanes = - this.shellSuspendCounter = - this.errorRecoveryDisabledLanes = - this.expiredLanes = - this.warmLanes = - this.pingedLanes = - this.suspendedLanes = - this.pendingLanes = - 0; - this.entanglements = createLaneMap(0); - this.hiddenUpdates = createLaneMap(null); - this.identifierPrefix = identifierPrefix; - this.onUncaughtError = onUncaughtError; - this.onCaughtError = onCaughtError; - this.onRecoverableError = onRecoverableError; - this.pooledCache = null; - this.pooledCacheLanes = 0; - this.formState = formState; - this.transitionTypes = null; - this.incompleteTransitions = new Map(); +function flushSpawnedWork() { + if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var committedViewTransition = pendingViewTransition; + pendingViewTransition = null; + requestPaint(); + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; + 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || + 0 !== (finishedWork.flags & passiveSubtreeMask) + ? (pendingEffectsStatus = 5) + : ((pendingEffectsStatus = 0), + (pendingFinishedWork = pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + passiveSubtreeMask = root.pendingLanes; + 0 === passiveSubtreeMask && (legacyErrorBoundariesThatAlreadyFailed = null); + lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + void 0, + 128 === (finishedWork.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + passiveSubtreeMask = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + for ( + var onRecoverableError = root.onRecoverableError, i = 0; + i < recoverableErrors.length; + i++ + ) { + var recoverableError = recoverableErrors[i]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = passiveSubtreeMask); + } + } + recoverableErrors = pendingViewTransitionEvents; + onRecoverableError = pendingTransitionTypes; + pendingTransitionTypes = null; + if ( + null !== recoverableErrors && + ((pendingViewTransitionEvents = null), + null === onRecoverableError && (onRecoverableError = []), + null !== committedViewTransition) + ) + for ( + recoverableError = 0; + recoverableError < recoverableErrors.length; + recoverableError++ + ) + (finishedWork = (0, recoverableErrors[recoverableError])( + onRecoverableError + )), + void 0 !== finishedWork && + committedViewTransition.finished.finally(finishedWork); + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + passiveSubtreeMask = root.pendingLanes; + 0 !== (lanes & 261930) && 0 !== (passiveSubtreeMask & 42) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); + flushSyncWorkAcrossRoots_impl(0); + } } -function createPortal$1(children, containerInfo, implementation) { - var key = - 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - return { - $$typeof: REACT_PORTAL_TYPE, - key: - null == key - ? null - : key === REACT_OPTIMISTIC_KEY - ? REACT_OPTIMISTIC_KEY - : "" + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; +function releaseRootPooledCache(root, remainingLanes) { + 0 === (root.pooledCacheLanes &= remainingLanes) && + ((remainingLanes = root.pooledCache), + null != remainingLanes && + ((root.pooledCache = null), releaseCache(remainingLanes))); } -function findHostInstance(component) { - var fiber = component._reactInternals; - if (void 0 === fiber) { - if ("function" === typeof component.render) - throw Error("Unable to find node on an unmounted component."); - component = Object.keys(component).join(","); - throw Error( - "Argument appears to not be a ReactComponent. Keys: " + component +function flushPendingEffects() { + null !== pendingViewTransition && (pendingViewTransition = null); + flushMutationEffects(); + flushLayoutEffects(); + flushSpawnedWork(); + return flushPassiveEffects(); +} +function flushPassiveEffects() { + if (5 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority; + ReactSharedInternals.T = null; + renderPriority = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root$jscomp$0 = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingFinishedWork = pendingEffectsRoot = null; + pendingEffectsLanes = 0; + if (0 !== (executionContext & 6)) + throw Error("Cannot flush passive effects while already rendering."); + var prevExecutionContext = executionContext; + executionContext |= 4; + commitPassiveUnmountOnFiber(root$jscomp$0.current); + commitPassiveMountOnFiber( + root$jscomp$0, + root$jscomp$0.current, + lanes, + renderPriority ); + executionContext = prevExecutionContext; + flushSyncWorkAcrossRoots_impl(0); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + } catch (err) {} + return !0; + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - component = findCurrentFiberUsingSlowPath(fiber); - component = null !== component ? findCurrentHostFiberImpl(component) : null; - return null === component ? null : getPublicInstance(component.stateNode); -} -function updateContainer(element, container, parentComponent, callback) { - parentComponent = container.current; - var lane = requestUpdateLane(parentComponent); - null === container.context - ? (container.context = emptyContextObject) - : (container.pendingContext = emptyContextObject); - container = createUpdate(lane); - container.payload = { element: element }; - callback = void 0 === callback ? null : callback; - null !== callback && (container.callback = callback); - element = enqueueUpdate(parentComponent, container, lane); - null !== element && - (scheduleUpdateOnFiber(element, parentComponent, lane), - entangleTransitions(element, parentComponent, lane)); - return lane; -} -function shim$1() { - throw Error( - "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." - ); -} -function shim() { - throw Error( - "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." - ); } -var fabricCreateViewTransitionInstance = - reactPrivateInterface.fabricUIManager.createViewTransitionInstance, - fabricStartViewTransition = - reactPrivateInterface.fabricUIManager.startViewTransition, - fabricStartViewTransitionReadyFinished = - reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished; -function ViewTransitionPseudoElement(pseudo, name) { - this._pseudo = pseudo; - this._name = name; +function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); + null !== rootFiber && + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } -function measureClonedInstance() { - return { - rect: { x: 0, y: 0, width: 0, height: 0 }, - abs: !1, - clip: !1, - view: !0 - }; +function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + else + for (; null !== nearestMountedAncestor; ) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot( + nearestMountedAncestor, + sourceFiber, + error + ); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + if ( + "function" === + typeof nearestMountedAncestor.type.getDerivedStateFromError || + ("function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + ) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + error = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error, 2); + null !== instance && + (initializeClassErrorUpdate( + error, + instance, + nearestMountedAncestor, + sourceFiber + ), + markRootUpdated$1(instance, 2), + ensureRootIsScheduled(instance)); + break; + } + } + nearestMountedAncestor = nearestMountedAncestor.return; + } } -function createViewTransitionInstance(name) { - var tag = allocateTag(); - fabricCreateViewTransitionInstance(name, tag); - return { - name: name, - old: new ViewTransitionPseudoElement("old", name), - new: new ViewTransitionPseudoElement("new", name) - }; +function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else + (threadIDs = pingCache.get(wakeable)), + void 0 === threadIDs && + ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || + ((workInProgressRootDidAttachPingListener = !0), + threadIDs.add(lanes), + (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), + attachContextPreservingListener(wakeable, root)); } -function startViewTransition( - suspendedState, - rootContainer, - transitionTypes, - mutationCallback, - layoutCallback, - afterMutationCallback, - spawnedWorkCallback, - passiveCallback -) { - suspendedState = fabricStartViewTransition(function () { - mutationCallback(); - layoutCallback(); - afterMutationCallback(); - }); - if (null == suspendedState) - return mutationCallback(), layoutCallback(), spawnedWorkCallback(), null; - suspendedState.ready.then(function () { - spawnedWorkCallback(); - fabricStartViewTransitionReadyFinished(); - }); - suspendedState.finished.finally(function () { - passiveCallback(); - }); - return suspendedState; +function attachContextPreservingListener(wakeable, listener) { + if ("function" !== typeof Promise) wakeable.then(listener, listener); + else { + var resolve = noop; + new Promise(function (r) { + resolve = r; + }).then(listener); + listener = function () { + return resolve(); + }; + wakeable.then(listener, listener); + } } -var createNode = reactPrivateInterface.fabricUIManager.createNode, - cloneNodeWithNewChildren = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, - cloneNodeWithNewChildrenAndProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, - cloneNodeWithNewProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, - createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, - appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, - appendChildNodeToSet = reactPrivateInterface.fabricUIManager.appendChildToSet, - completeRoot = reactPrivateInterface.fabricUIManager.completeRoot, - registerEventHandler = - reactPrivateInterface.fabricUIManager.registerEventHandler, - FabricDiscretePriority = - reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, - FabricContinuousPriority = - reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, - FabricIdlePriority = - reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, - fabricGetCurrentEventPriority = - reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, - fabricSuspendOnActiveViewTransition = - reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, - extraDevToolsConfig = { - getInspectorDataForInstance: void 0, - getInspectorDataForViewAtPoint: function () { - throw Error( - "getInspectorDataForViewAtPoint() is not available in production." - ); - } - }, - getViewConfigForType = - reactPrivateInterface.ReactNativeViewConfigRegistry.get, - nextReactTag = 2; -function allocateTag() { - var tag = nextReactTag; - nextReactTag += 2; - return tag; +function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; + workInProgressRoot === root && + (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && + (4 === workInProgressRootExitStatus || + (3 === workInProgressRootExitStatus && + (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes && + 300 > now() - globalMostRecentFallbackTime) + ? 0 === (executionContext & 2) + ? prepareFreshStack(root, 0) + : (workInProgressRootPingedLanes |= pingedLanes) + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); + ensureRootIsScheduled(root); } -registerEventHandler && registerEventHandler(dispatchEvent); -var PROD_HOST_CONTEXT = { isInAParentText: !0 }; -function createTextInstance( - text, - rootContainerInstance, - hostContext, - internalInstanceHandle -) { - hostContext = allocateTag(); - return { - node: createNode( - hostContext, - "RCTRawText", - rootContainerInstance.containerTag, - { text: text }, - internalInstanceHandle - ) - }; +function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && (retryLane = claimNextRetryLane()); + boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + null !== boundaryFiber && + (markRootUpdated$1(boundaryFiber, retryLane), + ensureRootIsScheduled(boundaryFiber)); } -function getPublicInstance(instance) { - if (null != instance.canonical) { - if (null == instance.canonical.publicInstance) { - var $jscomp$nullish$tmp0; - instance.canonical.publicInstance = - reactPrivateInterface.createPublicInstance( - instance.canonical.nativeTag, - instance.canonical.viewConfig, - instance.canonical.internalInstanceHandle, - null != ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) - ? $jscomp$nullish$tmp0 - : null - ); - instance.canonical.publicRootInstance = null; - } - return instance.canonical.publicInstance; +function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); +} +function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 31: + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + case 22: + retryCache = boundaryFiber.stateNode; + if (null === retryCache) return; + retryCache = retryCache._retryCache; + break; + default: + throw Error( + "Pinged unknown suspense boundary type. This is probably a bug in React." + ); } - return null != instance.containerInfo - ? instance.containerInfo.publicInstance - : null; + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); } -function getPublicInstanceFromHostFiber(fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null === fiber) - throw Error("Expected to find a host node. This is a bug in React."); - return fiber; +function scheduleCallback(priorityLevel, callback) { + return scheduleCallback$3(priorityLevel, callback); } -var currentUpdatePriority = 0; -function resolveUpdatePriority() { - if (0 !== currentUpdatePriority) return currentUpdatePriority; - var currentEventPriority = fabricGetCurrentEventPriority - ? fabricGetCurrentEventPriority() - : null; - if (null != currentEventPriority) - switch (currentEventPriority) { - case FabricDiscretePriority: - return 2; - case FabricContinuousPriority: - return 8; - case FabricIdlePriority: - return 268435456; - } - return 32; +function FiberNode(tag, pendingProps, key, mode) { + this.tag = tag; + this.key = key; + this.sibling = + this.child = + this.return = + this.stateNode = + this.type = + this.elementType = + null; + this.index = 0; + this.refCleanup = this.ref = null; + this.pendingProps = pendingProps; + this.dependencies = + this.memoizedState = + this.updateQueue = + this.memoizedProps = + null; + this.mode = mode; + this.subtreeFlags = this.flags = 0; + this.deletions = null; + this.childLanes = this.lanes = 0; + this.alternate = null; } -var scheduleTimeout = setTimeout, - cancelTimeout = clearTimeout; -function cloneHiddenInstance(instance) { - var node = instance.node, - updatePayload = reactPrivateInterface.createAttributePayload( - { style: { display: "none" } }, - instance.canonical.viewConfig.validAttributes - ); - return { - node: cloneNodeWithNewProps(node, updatePayload), - canonical: instance.canonical - }; +function createFiberImplClass(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); } -function FragmentInstance(fragmentFiber) { - this._fragmentFiber = fragmentFiber; - this._observers = null; +function shouldConstruct(Component) { + Component = Component.prototype; + return !(!Component || !Component.isReactComponent); } -FragmentInstance.prototype.observeUsing = function (observer) { - null === this._observers && (this._observers = new Set()); - this._observers.add(observer); - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - observeChild, - observer, - void 0, - void 0 - ); -}; -function observeChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.observe(child); - return !1; +function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + null === workInProgress + ? ((workInProgress = createFiberImplClass( + current.tag, + pendingProps, + current.key, + current.mode + )), + (workInProgress.elementType = current.elementType), + (workInProgress.type = current.type), + (workInProgress.stateNode = current.stateNode), + (workInProgress.alternate = current), + (current.alternate = workInProgress)) + : ((workInProgress.pendingProps = pendingProps), + (workInProgress.type = current.type), + (workInProgress.flags = 0), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null)); + workInProgress.flags = current.flags & 1206910976; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + pendingProps = current.dependencies; + workInProgress.dependencies = + null === pendingProps + ? null + : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext }; + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + workInProgress.refCleanup = current.refCleanup; + return workInProgress; +} +function resetWorkInProgress(workInProgress, renderLanes) { + workInProgress.flags &= 1206910978; + var current = workInProgress.alternate; + null === current + ? ((workInProgress.childLanes = 0), + (workInProgress.lanes = renderLanes), + (workInProgress.child = null), + (workInProgress.subtreeFlags = 0), + (workInProgress.memoizedProps = null), + (workInProgress.memoizedState = null), + (workInProgress.updateQueue = null), + (workInProgress.dependencies = null), + (workInProgress.stateNode = null)) + : ((workInProgress.childLanes = current.childLanes), + (workInProgress.lanes = current.lanes), + (workInProgress.child = current.child), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null), + (workInProgress.memoizedProps = current.memoizedProps), + (workInProgress.memoizedState = current.memoizedState), + (workInProgress.updateQueue = current.updateQueue), + (workInProgress.type = current.type), + (renderLanes = current.dependencies), + (workInProgress.dependencies = + null === renderLanes + ? null + : { + lanes: renderLanes.lanes, + firstContext: renderLanes.firstContext + })); + return workInProgress; +} +function createFiberFromTypeAndProps( + type, + key, + pendingProps, + owner, + mode, + lanes +) { + var fiberTag = 0; + owner = type; + if ("function" === typeof owner) shouldConstruct(owner) && (fiberTag = 1); + else if ("string" === typeof owner) fiberTag = 5; + else + a: switch (owner) { + case REACT_ACTIVITY_TYPE: + return ( + (type = createFiberImplClass(31, pendingProps, key, mode)), + (type.elementType = REACT_ACTIVITY_TYPE), + (type.lanes = lanes), + type + ); + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + case REACT_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 24; + break; + case REACT_PROFILER_TYPE: + return ( + (type = createFiberImplClass(12, pendingProps, key, mode | 2)), + (type.elementType = REACT_PROFILER_TYPE), + (type.lanes = lanes), + type + ); + case REACT_SUSPENSE_TYPE: + return ( + (type = createFiberImplClass(13, pendingProps, key, mode)), + (type.elementType = REACT_SUSPENSE_TYPE), + (type.lanes = lanes), + type + ); + case REACT_SUSPENSE_LIST_TYPE: + return ( + (type = createFiberImplClass(19, pendingProps, key, mode)), + (type.elementType = REACT_SUSPENSE_LIST_TYPE), + (type.lanes = lanes), + type + ); + case REACT_LEGACY_HIDDEN_TYPE: + case REACT_VIEW_TRANSITION_TYPE: + return ( + (type = mode | 32), + (type = createFiberImplClass(30, pendingProps, key, type)), + (type.elementType = REACT_VIEW_TRANSITION_TYPE), + (type.lanes = lanes), + (type.stateNode = { + autoName: null, + paired: null, + clones: null, + ref: null + }), + type + ); + default: + if ("object" === typeof owner && null !== owner) + switch (owner.$$typeof) { + case REACT_CONTEXT_TYPE: + fiberTag = 10; + break a; + case REACT_CONSUMER_TYPE: + fiberTag = 9; + break a; + case REACT_FORWARD_REF_TYPE: + fiberTag = 11; + break a; + case REACT_MEMO_TYPE: + fiberTag = 14; + break a; + case REACT_LAZY_TYPE: + fiberTag = 16; + owner = null; + break a; + } + fiberTag = 29; + pendingProps = Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + + ((null === type ? "null" : typeof type) + ".") + ); + owner = null; + } + key = createFiberImplClass(fiberTag, pendingProps, key, mode); + key.elementType = type; + key.type = owner; + key.lanes = lanes; + return key; } -FragmentInstance.prototype.unobserveUsing = function (observer) { - var observers = this._observers; - null !== observers && - observers.has(observer) && - (observers.delete(observer), - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - unobserveChild, - observer, - void 0, - void 0 - )); -}; -function unobserveChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.unobserve(child); - return !1; +function createFiberFromFragment(elements, mode, lanes, key) { + elements = createFiberImplClass(7, elements, key, mode); + elements.lanes = lanes; + return elements; } -FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; - var children = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectChildren, - children, - void 0, - void 0 - ); - if (0 === children.length) { - var parentHostInstance = getPublicInstanceFromHostFiber(parentHostFiber); - children = this._fragmentFiber; - parentHostFiber = getPublicInstanceFromHostFiber; - var parentResult = parentHostInstance.compareDocumentPosition(otherNode); - var result = parentResult; - parentHostInstance === otherNode - ? (result = Node.DOCUMENT_POSITION_CONTAINS) - : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && - ((parentHostInstance = [null, null]), - (result = getFragmentParentInstanceOrContainerFiber(children)), - null !== result && - findFragmentInstanceOrTextInstanceSiblings( - parentHostInstance, - children, - result.child, - { foundSelf: !1 } - ), - (children = parentHostInstance[1]), - null === children - ? (result = Node.DOCUMENT_POSITION_PRECEDING) - : ((otherNode = - parentHostFiber(children).compareDocumentPosition(otherNode)), - (result = - 0 === otherNode || otherNode & Node.DOCUMENT_POSITION_FOLLOWING - ? Node.DOCUMENT_POSITION_FOLLOWING - : Node.DOCUMENT_POSITION_PRECEDING))); - return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - } - parentHostFiber = getPublicInstanceFromHostFiber(children[0]); - children = getPublicInstanceFromHostFiber(children[children.length - 1]); - parentHostInstance = parentHostFiber.compareDocumentPosition(otherNode); - parentResult = children.compareDocumentPosition(otherNode); - result = - parentHostInstance & Node.DOCUMENT_POSITION_CONTAINED_BY || - parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY; - parentResult = - parentHostInstance & Node.DOCUMENT_POSITION_FOLLOWING && - parentResult & Node.DOCUMENT_POSITION_PRECEDING; - return parentHostFiber === otherNode || - children === otherNode || - result || - parentResult - ? Node.DOCUMENT_POSITION_CONTAINED_BY - : parentHostInstance; -}; -function collectChildren(child, collection) { - collection.push(child); - return !1; +function createFiberFromText(content, mode, lanes) { + content = createFiberImplClass(6, content, null, mode); + content.lanes = lanes; + return content; } -FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - return null === parentHostFiber - ? this - : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( - getRootNodeOptions - ); -}; -FragmentInstance.prototype.getClientRects = function () { - var rects = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectClientRects, - rects, - void 0, - void 0 +function createFiberFromPortal(portal, mode, lanes) { + mode = createFiberImplClass( + 4, + null !== portal.children ? portal.children : [], + portal.key, + mode ); - return rects; -}; -function collectClientRects(child, rects) { - child = getPublicInstanceFromHostFiber(child); - rects.push(child.getBoundingClientRect()); - return !1; + mode.lanes = lanes; + mode.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + implementation: portal.implementation + }; + return mode; } -function addFragmentHandleToFiber(child, fragmentInstance) { - child = getPublicInstanceFromHostFiber(child); - null != child && addFragmentHandleToInstance(child, fragmentInstance); - return !1; +function FiberRootNode( + containerInfo, + hydrate, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + onDefaultTransitionIndicator, + formState +) { + this.tag = 1; + this.containerInfo = containerInfo; + this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.callbackNode = + this.next = + this.pendingContext = + this.context = + this.cancelPendingCommit = + null; + this.callbackPriority = 0; + this.expirationTimes = createLaneMap(-1); + this.entangledLanes = + this.shellSuspendCounter = + this.errorRecoveryDisabledLanes = + this.expiredLanes = + this.warmLanes = + this.pingedLanes = + this.suspendedLanes = + this.pendingLanes = + 0; + this.entanglements = createLaneMap(0); + this.hiddenUpdates = createLaneMap(null); + this.identifierPrefix = identifierPrefix; + this.onUncaughtError = onUncaughtError; + this.onCaughtError = onCaughtError; + this.onRecoverableError = onRecoverableError; + this.pooledCache = null; + this.pooledCacheLanes = 0; + this.formState = formState; + this.transitionTypes = null; + this.incompleteTransitions = new Map(); } -function addFragmentHandleToInstance(instance, fragmentInstance) { - null == instance.reactFragments && (instance.reactFragments = new Set()); - instance.reactFragments.add(fragmentInstance); +function createPortal$1(children, containerInfo, implementation) { + var key = + 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: + null == key + ? null + : key === REACT_OPTIMISTIC_KEY + ? REACT_OPTIMISTIC_KEY + : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; } -function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { - if (null != childInstance.canonical) { - var publicInstance = getPublicInstance(childInstance); - if (null !== fragmentInstance._observers) { - if (null == publicInstance) - throw Error("Expected to find a host node. This is a bug in React."); - fragmentInstance._observers.forEach(function (observer) { - observer.observe(publicInstance); - }); - } - addFragmentHandleToInstance(publicInstance, fragmentInstance); +function findHostInstance(component) { + var fiber = component._reactInternals; + if (void 0 === fiber) { + if ("function" === typeof component.render) + throw Error("Unable to find node on an unmounted component."); + component = Object.keys(component).join(","); + throw Error( + "Argument appears to not be a ReactComponent. Keys: " + component + ); } + component = findCurrentFiberUsingSlowPath(fiber); + component = null !== component ? findCurrentHostFiberImpl(component) : null; + return null === component ? null : getPublicInstance(component.stateNode); +} +function updateContainer(element, container, parentComponent, callback) { + parentComponent = container.current; + var lane = requestUpdateLane(); + null === container.context + ? (container.context = emptyContextObject) + : (container.pendingContext = emptyContextObject); + container = createUpdate(lane); + container.payload = { element: element }; + callback = void 0 === callback ? null : callback; + null !== callback && (container.callback = callback); + element = enqueueUpdate(parentComponent, container, lane); + null !== element && + (scheduleUpdateOnFiber(element, parentComponent, lane), + entangleTransitions(element, parentComponent, lane)); + return lane; } -var HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, - scheduleMicrotask = - "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout; -getFiberCurrentPropsFromNode$1 = function (instance) { - return instance.canonical.currentProps; -}; -getInstanceFromNode$1 = function (node) { - return null != node.canonical && null != node.canonical.internalInstanceHandle - ? node.canonical.internalInstanceHandle - : node; -}; -getNodeFromInstance$1 = function (fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null == fiber) throw Error("Could not find host instance from fiber"); - return fiber; -}; -ResponderEventPlugin.injection.injectGlobalResponderHandler({ - onChange: function (from, to, blockNativeResponder) { - from && - from.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - from.stateNode.node, - !1, - blockNativeResponder || !1 - ); - to && - to.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - to.stateNode.node, - !0, - blockNativeResponder || !1 - ); - } -}); if ( "function" !== typeof reactPrivateInterface.ReactFiberErrorDialog.showErrorDialog @@ -11730,19 +10553,10 @@ function nativeOnCaughtError(error, errorInfo) { } function nativeOnDefaultTransitionIndicator() {} batchedUpdatesImpl = function (fn, a) { - var prevExecutionContext = executionContext; - executionContext |= 1; - try { - return fn(a); - } finally { - (executionContext = prevExecutionContext), - 0 === executionContext && - ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(0, !0)); - } + return fn(a); }; var roots = new Map(), - internals$jscomp$inline_1351 = { + internals$jscomp$inline_1195 = { bundleType: 0, version: "19.3.0", rendererPackageName: "react-native-renderer", @@ -11750,18 +10564,18 @@ var roots = new Map(), reconcilerVersion: "19.3.0" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1351.rendererConfig = extraDevToolsConfig); + (internals$jscomp$inline_1195.rendererConfig = extraDevToolsConfig); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1672 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1472 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1672.isDisabled && - hook$jscomp$inline_1672.supportsFiber + !hook$jscomp$inline_1472.isDisabled && + hook$jscomp$inline_1472.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1672.inject( - internals$jscomp$inline_1351 + (rendererID = hook$jscomp$inline_1472.inject( + internals$jscomp$inline_1195 )), - (injectedHook = hook$jscomp$inline_1672); + (injectedHook = hook$jscomp$inline_1472); } catch (err) {} } exports.createPortal = function (children, containerTag) { @@ -11804,6 +10618,18 @@ exports.findNodeHandle = function (componentOrHandle) { ? componentOrHandle : reactPrivateInterface.getNativeTagFromPublicInstance(componentOrHandle); }; +exports.flushSync = function (fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = currentUpdatePriority; + try { + if (((ReactSharedInternals.T = null), (currentUpdatePriority = 2), fn)) + return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (currentUpdatePriority = previousUpdatePriority), + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(0); + } +}; exports.getNodeFromInternalInstanceHandle = function (internalInstanceHandle) { return ( internalInstanceHandle && @@ -11841,14 +10667,15 @@ exports.render = function ( concurrentRoot, options ) { - var root = roots.get(containerTag); - if (!root) { - root = nativeOnUncaughtError; + if (!concurrentRoot) throw Error("render: Unsupported Legacy Mode API."); + concurrentRoot = roots.get(containerTag); + if (!concurrentRoot) { + concurrentRoot = nativeOnUncaughtError; var onCaughtError = nativeOnCaughtError, onRecoverableError = defaultOnRecoverableError; options && void 0 !== options.onUncaughtError && - (root = options.onUncaughtError); + (concurrentRoot = options.onUncaughtError); options && void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError); @@ -11860,29 +10687,22 @@ exports.render = function ( reactPrivateInterface.createPublicRootInstance(containerTag), containerTag: containerTag }; - concurrentRoot = concurrentRoot ? 1 : 0; - root = new FiberRootNode( + options = new FiberRootNode( options, - concurrentRoot, !1, "", - root, + concurrentRoot, onCaughtError, onRecoverableError, nativeOnDefaultTransitionIndicator, null ); - concurrentRoot = createFiberImplClass( - 3, - null, - null, - 1 === concurrentRoot ? 1 : 0 - ); - root.current = concurrentRoot; - concurrentRoot.stateNode = root; + concurrentRoot = createFiberImplClass(3, null, null, 1); + options.current = concurrentRoot; + concurrentRoot.stateNode = options; onCaughtError = createCache(); onCaughtError.refCount++; - root.pooledCache = onCaughtError; + options.pooledCache = onCaughtError; onCaughtError.refCount++; concurrentRoot.memoizedState = { element: null, @@ -11890,10 +10710,11 @@ exports.render = function ( cache: onCaughtError }; initializeUpdateQueue(concurrentRoot); - roots.set(containerTag, root); + concurrentRoot = options; + roots.set(containerTag, concurrentRoot); } - updateContainer(element, root, null, callback); - a: if (((element = root.current), element.child)) + updateContainer(element, concurrentRoot, null, callback); + a: if (((element = concurrentRoot.current), element.child)) switch (element.child.tag) { case 27: case 5: diff --git a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js index dbffa3aca64f..5990c424edf0 100644 --- a/packages/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +++ b/packages/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9f9934c9c6457b3e7ada8ebf2d803424>> + * @generated SignedSource<<46e531e7ad16e76a30aebf9f132fdd71>> * * This file was sync'd from the facebook/react repository. */ @@ -17,227 +17,167 @@ "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); -require("react-native/setup-env"); -var reactPrivateInterface = require("react-native/react-private-interface"), +var React = require("react"), + reactPrivateInterface = require("react-native/react-private-interface"), Scheduler = require("scheduler"), - React = require("react"), - isArrayImpl = Array.isArray, - ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - assign = Object.assign, - prefix, - suffix; -function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; + assign = Object.assign; +function getNearestMountedFiber(fiber) { + for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) + (node = nextNode), + 0 !== (node.flags & 4098) && (fiber = node.return), + (nextNode = node.return); + for (; node.return; ) node = node.return; + return 3 === node.tag ? fiber : null; } -var reentry = !1; -function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - reentry = !0; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - try { - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { - throw Error(); - } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x$1) { - control = x$1; - } - Fake = !1; - try { - var prevProps = Object.getOwnPropertyDescriptor( - fn.prototype, - "props" - ); - Object.defineProperty(fn.prototype, "props", { - configurable: !0, - set: function () { - throw Error(); - } - }); - Fake = !0; - new fn(); - } finally { - Fake && - (void 0 !== prevProps - ? Object.defineProperty(fn.prototype, "props", prevProps) - : delete fn.prototype.props); - } - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); - } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; +function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error("Unable to find node on an unmounted component."); +} +function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) + throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, child$1 = parentA.child; child$1; ) { + if (child$1 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; } - return [null, null]; + if (child$1 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$1 = child$1.sibling; } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } - ); - var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - if (sampleStack && controlStack) { - var sampleLines = sampleStack.split("\n"), - controlLines = controlStack.split("\n"); - for ( - namePropDescriptor = RunInRootFrame = 0; - RunInRootFrame < sampleLines.length && - !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); - - ) - RunInRootFrame++; - for ( - ; - namePropDescriptor < controlLines.length && - !controlLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - if ( - RunInRootFrame === sampleLines.length || - namePropDescriptor === controlLines.length - ) - for ( - RunInRootFrame = sampleLines.length - 1, - namePropDescriptor = controlLines.length - 1; - 1 <= RunInRootFrame && - 0 <= namePropDescriptor && - sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; - - ) - namePropDescriptor--; - for ( - ; - 1 <= RunInRootFrame && 0 <= namePropDescriptor; - RunInRootFrame--, namePropDescriptor-- - ) - if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { - if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { - do - if ( - (RunInRootFrame--, - namePropDescriptor--, - 0 > namePropDescriptor || - sampleLines[RunInRootFrame] !== - controlLines[namePropDescriptor]) - ) { - var frame = - "\n" + - sampleLines[RunInRootFrame].replace(" at new ", " at "); - fn.displayName && - frame.includes("") && - (frame = frame.replace("", fn.displayName)); - return frame; - } - while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + if (!didFindChild) { + for (child$1 = parentB.child; child$1; ) { + if (child$1 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; } - break; + if (child$1 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$1 = child$1.sibling; } + if (!didFindChild) + throw Error( + "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." + ); + } } - } finally { - (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); + if (a.alternate !== b) + throw Error( + "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." + ); } - return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(previousPrepareStackTrace) - : ""; + if (3 !== a.tag) + throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; } -function describeFiber(fiber, childFiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return describeBuiltInComponentFrame(fiber.type); - case 16: - return describeBuiltInComponentFrame("Lazy"); - case 13: - return fiber.child !== childFiber && null !== childFiber - ? describeBuiltInComponentFrame("Suspense Fallback") - : describeBuiltInComponentFrame("Suspense"); - case 19: - return describeBuiltInComponentFrame("SuspenseList"); - case 0: - case 15: - return describeNativeComponentFrame(fiber.type, !1); - case 11: - return describeNativeComponentFrame(fiber.type.render, !1); - case 1: - return describeNativeComponentFrame(fiber.type, !0); - case 31: - return describeBuiltInComponentFrame("Activity"); - case 30: - return describeBuiltInComponentFrame("ViewTransition"); - default: - return ""; +function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; } + return null; } -function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = "", - previous = null; - do - (info += describeFiber(workInProgress, previous)), - (previous = workInProgress), - (workInProgress = workInProgress.return); - while (workInProgress); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; +function traverseVisibleInstancesAndTextInstances( + child, + searchWithinHosts, + fn, + a, + b, + c +) { + for (; null !== child; ) { + if ( + ((5 === child.tag || 27 === child.tag || 6 === child.tag) && + fn(child, a, b, c)) || + ((22 !== child.tag || null === child.memoizedState) && + (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && + traverseVisibleInstancesAndTextInstances( + child.child, + searchWithinHosts, + fn, + a, + b, + c + )) + ) + return !0; + child = child.sibling; + } + return !1; +} +function getFragmentParentInstanceOrContainerFiber(fiber) { + for (fiber = fiber.return; null !== fiber; ) { + if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber; + fiber = fiber.return; + } + return null; +} +function findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child, + state +) { + for (; null !== child; ) { + if (child === self) state.foundSelf = !0; + else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { + if (state.foundSelf) return (result[1] = child), !0; + result[0] = child; + } else if ( + (22 !== child.tag || null === child.memoizedState) && + findFragmentInstanceOrTextInstanceSiblings( + result, + self, + child.child, + state + ) + ) + return !0; + child = child.sibling; } + return !1; } var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -374,8 +314,6 @@ function getComponentNameFromFiber(fiber) { return "TracingMarker"; case 30: return "ViewTransition"; - case 17: - case 28: case 1: case 0: case 14: @@ -386,1226 +324,200 @@ function getComponentNameFromFiber(fiber) { } return null; } -var hasError = !1, - caughtError = null, - getFiberCurrentPropsFromNode$1 = null, - getInstanceFromNode$1 = null, - getNodeFromInstance$1 = null; -function executeDispatch(event, listener, inst) { - event.currentTarget = getNodeFromInstance$1(inst); - inst = global.event; - global.event = event; +var isArrayImpl = Array.isArray, + ReactSharedInternals = + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; +function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); +} +var isInsideEventHandler = !1; +function batchedUpdates$1(fn, bookkeeping) { + if (isInsideEventHandler) return fn(bookkeeping); + isInsideEventHandler = !0; try { - listener(event); - } catch (error) { - hasError || ((hasError = !0), (caughtError = error)); + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = !1; } - global.event = inst; - event.currentTarget = null; } -function executeDirectDispatch(event) { - var dispatchListener = event._dispatchListeners, - dispatchInstance = event._dispatchInstances; - if (isArrayImpl(dispatchListener)) throw Error("Invalid `event`."); - event.currentTarget = dispatchListener - ? getNodeFromInstance$1(dispatchInstance) - : null; - dispatchListener = dispatchListener ? dispatchListener(event) : null; - event.currentTarget = null; - event._dispatchListeners = null; - event._dispatchInstances = null; - return dispatchListener; -} -function currentTimeStamp() { - currentTimeStamp = - "object" === typeof performance && - null !== performance && - "function" === typeof performance.now - ? function () { - return performance.now(); - } - : function () { - return Date.now(); - }; - return currentTimeStamp(); +function dispatchEvent(target, topLevelType, nativeEventParam) { + var nativeEvent = + null != nativeEventParam && "object" === typeof nativeEventParam + ? nativeEventParam + : {}, + eventTarget = null; + null != target && + ((target = target.stateNode), + null != target && (eventTarget = getPublicInstance(target))); + batchedUpdates$1(function () { + var event = { eventName: topLevelType, nativeEvent: nativeEvent }; + reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); + reactPrivateInterface.RawEventEmitter.emit("*", event); + reactPrivateInterface.dispatchNativeEvent( + eventTarget, + topLevelType, + nativeEvent + ); + }); } -function functionThatReturnsTrue() { - return !0; +var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + cancelCallback$1 = Scheduler.unstable_cancelCallback, + shouldYield = Scheduler.unstable_shouldYield, + requestPaint = Scheduler.unstable_requestPaint, + now$1 = Scheduler.unstable_now, + ImmediatePriority = Scheduler.unstable_ImmediatePriority, + UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + NormalPriority$1 = Scheduler.unstable_NormalPriority, + IdlePriority = Scheduler.unstable_IdlePriority, + log$1 = Scheduler.log, + unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + rendererID = null, + injectedHook = null, + isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; +function setIsStrictModeForDevtools(newIsStrictMode) { + "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); + if (injectedHook && "function" === typeof injectedHook.setStrictMode) + try { + injectedHook.setStrictMode(rendererID, newIsStrictMode); + } catch (err) {} } -function functionThatReturnsFalse() { - return !1; +var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; +function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -function SyntheticEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget -) { - this.dispatchConfig = dispatchConfig; - this._targetInst = targetInst; - this.nativeEvent = nativeEvent; - this._dispatchInstances = this._dispatchListeners = null; - dispatchConfig = this.constructor.Interface; - for (var propName in dispatchConfig) - dispatchConfig.hasOwnProperty(propName) && - ((targetInst = dispatchConfig[propName]) - ? (this[propName] = targetInst(nativeEvent)) - : "target" === propName - ? (this.target = nativeEventTarget) - : (this[propName] = nativeEvent[propName])); - this.isDefaultPrevented = ( - null != nativeEvent.defaultPrevented - ? nativeEvent.defaultPrevented - : !1 === nativeEvent.returnValue - ) - ? functionThatReturnsTrue - : functionThatReturnsFalse; - this.isPropagationStopped = functionThatReturnsFalse; - return this; -} -assign(SyntheticEvent.prototype, { - preventDefault: function () { - this.defaultPrevented = !0; - var event = this.nativeEvent; - event && - (event.preventDefault - ? event.preventDefault() - : "unknown" !== typeof event.returnValue && (event.returnValue = !1), - (this.isDefaultPrevented = functionThatReturnsTrue)); - }, - stopPropagation: function () { - var event = this.nativeEvent; - event && - (event.stopPropagation - ? event.stopPropagation() - : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0), - (this.isPropagationStopped = functionThatReturnsTrue)); - }, - persist: function () { - this.isPersistent = functionThatReturnsTrue; - }, - isPersistent: functionThatReturnsFalse, - destructor: function () { - var Interface = this.constructor.Interface, - propName; - for (propName in Interface) this[propName] = null; - this.nativeEvent = this._targetInst = this.dispatchConfig = null; - this.isPropagationStopped = this.isDefaultPrevented = - functionThatReturnsFalse; - this._dispatchInstances = this._dispatchListeners = null; - } -}); -SyntheticEvent.Interface = { - type: null, - target: null, - currentTarget: function () { - return null; - }, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function (event) { - return event.timeStamp || event.timestamp || currentTimeStamp(); - }, - defaultPrevented: null, - isTrusted: null -}; -SyntheticEvent.extend = function (Interface) { - function E() {} - function Class() { - return Super.apply(this, arguments); - } - var Super = this; - E.prototype = Super.prototype; - var prototype = new E(); - assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - Class.Interface = assign({}, Super.Interface, Interface); - Class.extend = Super.extend; - addEventPoolingTo(Class); - return Class; -}; -addEventPoolingTo(SyntheticEvent); -function createOrGetPooledEvent( - dispatchConfig, - targetInst, - nativeEvent, - nativeInst -) { - if (this.eventPool.length) { - var instance = this.eventPool.pop(); - this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); - return instance; +var nextTransitionUpdateLane = 256, + nextTransitionDeferredLane = 262144, + nextRetryLane = 4194304; +function getHighestPriorityLanes(lanes) { + var pendingSyncLanes = lanes & 42; + if (0 !== pendingSyncLanes) return pendingSyncLanes; + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; + case 128: + return 128; + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + return lanes & -lanes; + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 3932160; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 0; + default: + return lanes; } - return new this(dispatchConfig, targetInst, nativeEvent, nativeInst); } -function releasePooledEvent(event) { - if (!(event instanceof this)) - throw Error( - "Trying to release an event instance into a pool of a different type." - ); - event.destructor(); - 10 > this.eventPool.length && this.eventPool.push(event); +function getNextLanes(root, wipLanes, rootHasPendingCommit) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; + var nonIdlePendingLanes = pendingLanes & 134217727; + 0 !== nonIdlePendingLanes + ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); + return 0 === nextLanes + ? 0 + : 0 !== wipLanes && + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) + ? wipLanes + : nextLanes; } -function addEventPoolingTo(EventConstructor) { - EventConstructor.getPooled = createOrGetPooledEvent; - EventConstructor.eventPool = []; - EventConstructor.release = releasePooledEvent; +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); } -var ResponderSyntheticEvent = SyntheticEvent.extend({ - touchHistory: function () { - return null; - } -}); -function isStartish(topLevelType) { - return "topTouchStart" === topLevelType; -} -function isMoveish(topLevelType) { - return "topTouchMove" === topLevelType; -} -var startDependencies = ["topTouchStart"], - moveDependencies = ["topTouchMove"], - endDependencies = ["topTouchCancel", "topTouchEnd"], - touchBank = [], - touchHistory = { - touchBank: touchBank, - numberActiveTouches: 0, - indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 - }; -function timestampForTouch(touch) { - return touch.timeStamp || touch.timestamp; -} -function getTouchIdentifier(_ref) { - _ref = _ref.identifier; - if (null == _ref) throw Error("Touch object is missing identifier."); - return _ref; -} -function recordTouchStart(touch) { - var identifier = getTouchIdentifier(touch), - touchRecord = touchBank[identifier]; - touchRecord - ? ((touchRecord.touchActive = !0), - (touchRecord.startPageX = touch.pageX), - (touchRecord.startPageY = touch.pageY), - (touchRecord.startTimeStamp = timestampForTouch(touch)), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchRecord.previousPageX = touch.pageX), - (touchRecord.previousPageY = touch.pageY), - (touchRecord.previousTimeStamp = timestampForTouch(touch))) - : ((touchRecord = { - touchActive: !0, - startPageX: touch.pageX, - startPageY: touch.pageY, - startTimeStamp: timestampForTouch(touch), - currentPageX: touch.pageX, - currentPageY: touch.pageY, - currentTimeStamp: timestampForTouch(touch), - previousPageX: touch.pageX, - previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) - }), - (touchBank[identifier] = touchRecord)); - touchHistory.mostRecentTimeStamp = timestampForTouch(touch); -} -function recordTouchMove(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord && - ((touchRecord.touchActive = !0), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))); -} -function recordTouchEnd(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord && - ((touchRecord.touchActive = !1), - (touchRecord.previousPageX = touchRecord.currentPageX), - (touchRecord.previousPageY = touchRecord.currentPageY), - (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp), - (touchRecord.currentPageX = touch.pageX), - (touchRecord.currentPageY = touch.pageY), - (touchRecord.currentTimeStamp = timestampForTouch(touch)), - (touchHistory.mostRecentTimeStamp = timestampForTouch(touch))); -} -var instrumentationCallback, - ResponderTouchHistoryStore = { - instrument: function (callback) { - instrumentationCallback = callback; - }, - recordTouchTrack: function (topLevelType, nativeEvent) { - null != instrumentationCallback && - instrumentationCallback(topLevelType, nativeEvent); - if (isMoveish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchMove); - else if (isStartish(topLevelType)) - nativeEvent.changedTouches.forEach(recordTouchStart), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches && - (touchHistory.indexOfSingleActiveTouch = - nativeEvent.touches[0].identifier); - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if ( - (nativeEvent.changedTouches.forEach(recordTouchEnd), - (touchHistory.numberActiveTouches = nativeEvent.touches.length), - 1 === touchHistory.numberActiveTouches) - ) - for ( - topLevelType = 0; - topLevelType < touchBank.length; - topLevelType++ - ) - if ( - ((nativeEvent = touchBank[topLevelType]), - null != nativeEvent && nativeEvent.touchActive) - ) { - touchHistory.indexOfSingleActiveTouch = topLevelType; - break; - } - }, - touchHistory: touchHistory - }; -function accumulate(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - return null == current - ? next - : isArrayImpl(current) - ? current.concat(next) - : isArrayImpl(next) - ? [current].concat(next) - : [current, next]; -} -function accumulateInto(current, next) { - if (null == next) - throw Error("Accumulated items must not be null or undefined."); - if (null == current) return next; - if (isArrayImpl(current)) { - if (isArrayImpl(next)) return current.push.apply(current, next), current; - current.push(next); - return current; - } - return isArrayImpl(next) ? [current].concat(next) : [current, next]; -} -function forEachAccumulated(arr, cb, scope) { - Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); -} -var responderInst = null, - trackedTouchCount = 0; -function changeResponder(nextResponderInst, blockHostResponder) { - var oldResponderInst = responderInst; - responderInst = nextResponderInst; - if (null !== ResponderEventPlugin.GlobalResponderHandler) - ResponderEventPlugin.GlobalResponderHandler.onChange( - oldResponderInst, - nextResponderInst, - blockHostResponder - ); -} -var eventTypes = { - startShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onStartShouldSetResponder", - captured: "onStartShouldSetResponderCapture" - }, - dependencies: startDependencies - }, - scrollShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onScrollShouldSetResponder", - captured: "onScrollShouldSetResponderCapture" - }, - dependencies: ["topScroll"] - }, - selectionChangeShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onSelectionChangeShouldSetResponder", - captured: "onSelectionChangeShouldSetResponderCapture" - }, - dependencies: ["topSelectionChange"] - }, - moveShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onMoveShouldSetResponder", - captured: "onMoveShouldSetResponderCapture" - }, - dependencies: moveDependencies - }, - responderStart: { - registrationName: "onResponderStart", - dependencies: startDependencies - }, - responderMove: { - registrationName: "onResponderMove", - dependencies: moveDependencies - }, - responderEnd: { - registrationName: "onResponderEnd", - dependencies: endDependencies - }, - responderRelease: { - registrationName: "onResponderRelease", - dependencies: endDependencies - }, - responderTerminationRequest: { - registrationName: "onResponderTerminationRequest", - dependencies: [] - }, - responderGrant: { registrationName: "onResponderGrant", dependencies: [] }, - responderReject: { registrationName: "onResponderReject", dependencies: [] }, - responderTerminate: { - registrationName: "onResponderTerminate", - dependencies: [] - } -}; -function getParent$1(inst) { - do inst = inst.return; - while (inst && 5 !== inst.tag); - return inst ? inst : null; -} -function traverseTwoPhase$1(inst, fn, arg) { - for (var path = []; inst; ) path.push(inst), (inst = getParent$1(inst)); - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); -} -function getListener$1(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." - ); - return inst; -} -function accumulateDirectionalDispatches$1(inst, phase, event) { - if ( - (phase = getListener$1( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); -} -function accumulateDirectDispatchesSingle$1(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener$1(inst, event.dispatchConfig.registrationName); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } - } -} -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst; - targetInst = targetInst ? getParent$1(targetInst) : null; - traverseTwoPhase$1(targetInst, accumulateDirectionalDispatches$1, event); - } -} -function accumulateTwoPhaseDispatchesSingle$1(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase$1( - event._targetInst, - accumulateDirectionalDispatches$1, - event - ); -} -var ResponderEventPlugin = { - _getResponder: function () { - return responderInst; - }, - eventTypes: eventTypes, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - if (isStartish(topLevelType)) trackedTouchCount += 1; - else if ( - "topTouchEnd" === topLevelType || - "topTouchCancel" === topLevelType - ) - if (0 <= trackedTouchCount) --trackedTouchCount; - else return null; - ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); - if ( - targetInst && - (("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) || - (0 < trackedTouchCount && "topSelectionChange" === topLevelType) || - isStartish(topLevelType) || - isMoveish(topLevelType)) - ) { - var shouldSetEventType = isStartish(topLevelType) - ? eventTypes.startShouldSetResponder - : isMoveish(topLevelType) - ? eventTypes.moveShouldSetResponder - : "topSelectionChange" === topLevelType - ? eventTypes.selectionChangeShouldSetResponder - : eventTypes.scrollShouldSetResponder; - if (responderInst) - b: { - var JSCompiler_temp = responderInst; - for ( - var depthA = 0, tempA = JSCompiler_temp; - tempA; - tempA = getParent$1(tempA) - ) - depthA++; - tempA = 0; - for (var tempB = targetInst; tempB; tempB = getParent$1(tempB)) - tempA++; - for (; 0 < depthA - tempA; ) - (JSCompiler_temp = getParent$1(JSCompiler_temp)), depthA--; - for (; 0 < tempA - depthA; ) - (targetInst = getParent$1(targetInst)), tempA--; - for (; depthA--; ) { - if ( - JSCompiler_temp === targetInst || - JSCompiler_temp === targetInst.alternate - ) - break b; - JSCompiler_temp = getParent$1(JSCompiler_temp); - targetInst = getParent$1(targetInst); - } - JSCompiler_temp = null; - } - else JSCompiler_temp = targetInst; - targetInst = JSCompiler_temp; - JSCompiler_temp = targetInst === responderInst; - shouldSetEventType = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - targetInst, - nativeEvent, - nativeEventTarget - ); - shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory; - JSCompiler_temp - ? forEachAccumulated( - shouldSetEventType, - accumulateTwoPhaseDispatchesSingleSkipTarget - ) - : forEachAccumulated( - shouldSetEventType, - accumulateTwoPhaseDispatchesSingle$1 - ); - b: { - JSCompiler_temp = shouldSetEventType._dispatchListeners; - targetInst = shouldSetEventType._dispatchInstances; - if (isArrayImpl(JSCompiler_temp)) - for ( - depthA = 0; - depthA < JSCompiler_temp.length && - !shouldSetEventType.isPropagationStopped(); - depthA++ - ) { - if ( - JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA]) - ) { - JSCompiler_temp = targetInst[depthA]; - break b; - } - } - else if ( - JSCompiler_temp && - JSCompiler_temp(shouldSetEventType, targetInst) - ) { - JSCompiler_temp = targetInst; - break b; - } - JSCompiler_temp = null; - } - shouldSetEventType._dispatchInstances = null; - shouldSetEventType._dispatchListeners = null; - shouldSetEventType.isPersistent() || - shouldSetEventType.constructor.release(shouldSetEventType); - if (JSCompiler_temp && JSCompiler_temp !== responderInst) - if ( - ((shouldSetEventType = ResponderSyntheticEvent.getPooled( - eventTypes.responderGrant, - JSCompiler_temp, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (targetInst = !0 === executeDirectDispatch(shouldSetEventType)), - responderInst) - ) - if ( - ((depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminationRequest, - responderInst, - nativeEvent, - nativeEventTarget - )), - (depthA.touchHistory = ResponderTouchHistoryStore.touchHistory), - forEachAccumulated(depthA, accumulateDirectDispatchesSingle$1), - (tempA = - !depthA._dispatchListeners || executeDirectDispatch(depthA)), - depthA.isPersistent() || depthA.constructor.release(depthA), - tempA) - ) { - depthA = ResponderSyntheticEvent.getPooled( - eventTypes.responderTerminate, - responderInst, - nativeEvent, - nativeEventTarget - ); - depthA.touchHistory = ResponderTouchHistoryStore.touchHistory; - forEachAccumulated(depthA, accumulateDirectDispatchesSingle$1); - var JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - [shouldSetEventType, depthA] - ); - changeResponder(JSCompiler_temp, targetInst); - } else - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - eventTypes.responderReject, - JSCompiler_temp, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - else - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )), - changeResponder(JSCompiler_temp, targetInst); - else JSCompiler_temp$jscomp$0 = null; - } else JSCompiler_temp$jscomp$0 = null; - shouldSetEventType = responderInst && isStartish(topLevelType); - JSCompiler_temp = responderInst && isMoveish(topLevelType); - targetInst = - responderInst && - ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType); - if ( - (shouldSetEventType = shouldSetEventType - ? eventTypes.responderStart - : JSCompiler_temp - ? eventTypes.responderMove - : targetInst - ? eventTypes.responderEnd - : null) - ) - (shouldSetEventType = ResponderSyntheticEvent.getPooled( - shouldSetEventType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (shouldSetEventType.touchHistory = - ResponderTouchHistoryStore.touchHistory), - forEachAccumulated( - shouldSetEventType, - accumulateDirectDispatchesSingle$1 - ), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - shouldSetEventType - )); - shouldSetEventType = responderInst && "topTouchCancel" === topLevelType; - if ( - (topLevelType = - responderInst && - !shouldSetEventType && - ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType)) - ) - a: { - if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < topLevelType.length; - JSCompiler_temp++ - ) - if ( - ((targetInst = topLevelType[JSCompiler_temp].target), - null !== targetInst && - void 0 !== targetInst && - 0 !== targetInst) - ) { - depthA = getInstanceFromNode$1(targetInst); - b: { - for (targetInst = responderInst; depthA; ) { - if ( - targetInst === depthA || - targetInst === depthA.alternate - ) { - targetInst = !0; - break b; - } - depthA = getParent$1(depthA); - } - targetInst = !1; - } - if (targetInst) { - topLevelType = !1; - break a; - } - } - topLevelType = !0; - } - if ( - (topLevelType = shouldSetEventType - ? eventTypes.responderTerminate - : topLevelType - ? eventTypes.responderRelease - : null) - ) - (nativeEvent = ResponderSyntheticEvent.getPooled( - topLevelType, - responderInst, - nativeEvent, - nativeEventTarget - )), - (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory), - forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle$1), - (JSCompiler_temp$jscomp$0 = accumulate( - JSCompiler_temp$jscomp$0, - nativeEvent - )), - changeResponder(null); - return JSCompiler_temp$jscomp$0; - }, - GlobalResponderHandler: null, - injection: { - injectGlobalResponderHandler: function (GlobalResponderHandler) { - ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; - } - } - }, - eventPluginOrder = null, - namesToPlugins = {}; -function recomputePluginOrdering() { - if (eventPluginOrder) - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName], - pluginIndex = eventPluginOrder.indexOf(pluginName); - if (-1 >= pluginIndex) - throw Error( - "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + - (pluginName + "`.") - ); - if (!plugins[pluginIndex]) { - if (!pluginModule.extractEvents) - throw Error( - "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + - (pluginName + "` does not.") - ); - plugins[pluginIndex] = pluginModule; - pluginIndex = pluginModule.eventTypes; - for (var eventName in pluginIndex) { - var JSCompiler_inline_result = void 0; - var dispatchConfig = pluginIndex[eventName]; - if (eventNameDispatchConfigs.hasOwnProperty(eventName)) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + - (eventName + "`.") - ); - eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (JSCompiler_inline_result in phasedRegistrationNames) - phasedRegistrationNames.hasOwnProperty( - JSCompiler_inline_result - ) && - publishRegistrationName( - phasedRegistrationNames[JSCompiler_inline_result], - pluginModule - ); - JSCompiler_inline_result = !0; - } else - dispatchConfig.registrationName - ? (publishRegistrationName( - dispatchConfig.registrationName, - pluginModule - ), - (JSCompiler_inline_result = !0)) - : (JSCompiler_inline_result = !1); - if (!JSCompiler_inline_result) - throw Error( - "EventPluginRegistry: Failed to publish event `" + - eventName + - "` for plugin `" + - pluginName + - "`." - ); - } - } - } -} -function publishRegistrationName(registrationName, pluginModule) { - if (registrationNameModules[registrationName]) - throw Error( - "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + - (registrationName + "`.") - ); - registrationNameModules[registrationName] = pluginModule; -} -var plugins = [], - eventNameDispatchConfigs = {}, - registrationNameModules = {}; -function getListener(inst, registrationName) { - inst = inst.stateNode; - if (null === inst) return null; - inst = getFiberCurrentPropsFromNode$1(inst); - if (null === inst) return null; - if ((inst = inst[registrationName]) && "function" !== typeof inst) - throw Error( - "Expected `" + - registrationName + - "` listener to be a function, instead got a value of `" + - typeof inst + - "` type." - ); - return inst; -} -var customBubblingEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry - .customBubblingEventTypes, - customDirectEventTypes = - reactPrivateInterface.ReactNativeViewConfigRegistry.customDirectEventTypes; -function accumulateDirectionalDispatches(inst, phase, event) { - if ( - (phase = getListener( - inst, - event.dispatchConfig.phasedRegistrationNames[phase] - )) - ) - (event._dispatchListeners = accumulateInto( - event._dispatchListeners, - phase - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - )); -} -function traverseTwoPhase(inst, fn, arg, skipBubbling) { - for (var path = []; inst; ) { - path.push(inst); - do inst = inst.return; - while (inst && 5 !== inst.tag); - inst = inst ? inst : null; - } - for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg); - if (skipBubbling) fn(path[0], "bubbled", arg); - else - for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); -} -function accumulateTwoPhaseDispatchesSingle(event) { - event && - event.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - event._targetInst, - accumulateDirectionalDispatches, - event, - !1 - ); -} -function accumulateDirectDispatchesSingle(event) { - if (event && event.dispatchConfig.registrationName) { - var inst = event._targetInst; - if (inst && event && event.dispatchConfig.registrationName) { - var listener = getListener(inst, event.dispatchConfig.registrationName); - listener && - ((event._dispatchListeners = accumulateInto( - event._dispatchListeners, - listener - )), - (event._dispatchInstances = accumulateInto( - event._dispatchInstances, - inst - ))); - } - } -} -if (eventPluginOrder) - throw Error( - "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." - ); -eventPluginOrder = Array.prototype.slice.call([ - "ResponderEventPlugin", - "ReactNativeBridgeEventPlugin" -]); -recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_337 = { - ResponderEventPlugin: ResponderEventPlugin, - ReactNativeBridgeEventPlugin: { - eventTypes: {}, - extractEvents: function ( - topLevelType, - targetInst, - nativeEvent, - nativeEventTarget - ) { - if (null == targetInst) return null; - var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], - directDispatchConfig = customDirectEventTypes[topLevelType]; - if (!bubbleDispatchConfig && !directDispatchConfig) - throw Error( - 'Unsupported top level event type "' + topLevelType + '" dispatched' - ); - topLevelType = SyntheticEvent.getPooled( - bubbleDispatchConfig || directDispatchConfig, - targetInst, - nativeEvent, - nativeEventTarget - ); - if (bubbleDispatchConfig) - null != topLevelType && - null != topLevelType.dispatchConfig.phasedRegistrationNames && - topLevelType.dispatchConfig.phasedRegistrationNames.skipBubbling - ? topLevelType && - topLevelType.dispatchConfig.phasedRegistrationNames && - traverseTwoPhase( - topLevelType._targetInst, - accumulateDirectionalDispatches, - topLevelType, - !0 - ) - : forEachAccumulated( - topLevelType, - accumulateTwoPhaseDispatchesSingle - ); - else if (directDispatchConfig) - forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle); - else return null; - return topLevelType; - } - } - }, - isOrderingDirty$jscomp$inline_338 = !1, - pluginName$jscomp$inline_339; -for (pluginName$jscomp$inline_339 in injectedNamesToPlugins$jscomp$inline_337) - if ( - injectedNamesToPlugins$jscomp$inline_337.hasOwnProperty( - pluginName$jscomp$inline_339 - ) - ) { - var pluginModule$jscomp$inline_340 = - injectedNamesToPlugins$jscomp$inline_337[pluginName$jscomp$inline_339]; - if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_339) || - namesToPlugins[pluginName$jscomp$inline_339] !== - pluginModule$jscomp$inline_340 +function getEntangledLanes(root, renderLanes) { + 0 !== (renderLanes & 8) && (renderLanes |= renderLanes & 32); + var allEntangledLanes = root.entangledLanes; + if (0 !== allEntangledLanes) + for ( + root = root.entanglements, allEntangledLanes &= renderLanes; + 0 < allEntangledLanes; + ) { - if (namesToPlugins[pluginName$jscomp$inline_339]) - throw Error( - "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_339 + "`.") - ); - namesToPlugins[pluginName$jscomp$inline_339] = - pluginModule$jscomp$inline_340; - isOrderingDirty$jscomp$inline_338 = !0; - } - } -isOrderingDirty$jscomp$inline_338 && recomputePluginOrdering(); -function batchedUpdatesImpl(fn, bookkeeping) { - return fn(bookkeeping); -} -var isInsideEventHandler = !1; -function batchedUpdates$1(fn, bookkeeping) { - if (isInsideEventHandler) return fn(bookkeeping); - isInsideEventHandler = !0; - try { - return batchedUpdatesImpl(fn, bookkeeping); - } finally { - isInsideEventHandler = !1; - } -} -var eventQueue = null; -function executeDispatchesAndReleaseTopLevel(e) { - if (e) { - var dispatchListeners = e._dispatchListeners, - dispatchInstances = e._dispatchInstances; - if (isArrayImpl(dispatchListeners)) - for ( - var i = 0; - i < dispatchListeners.length && !e.isPropagationStopped(); - i++ - ) - executeDispatch(e, dispatchListeners[i], dispatchInstances[i]); - else - dispatchListeners && - executeDispatch(e, dispatchListeners, dispatchInstances); - e._dispatchListeners = null; - e._dispatchInstances = null; - e.isPersistent() || e.constructor.release(e); - } -} -var _enableNativeEventTargetEventDispatching = null; -function dispatchEvent(target, topLevelType, nativeEventParam) { - var nativeEvent = - null != nativeEventParam && "object" === typeof nativeEventParam - ? nativeEventParam - : {}, - eventTarget = null; - null != target && - ((nativeEventParam = target.stateNode), - null != nativeEventParam && - (eventTarget = getPublicInstance(nativeEventParam))); - batchedUpdates$1(function () { - var event = { eventName: topLevelType, nativeEvent: nativeEvent }; - reactPrivateInterface.RawEventEmitter.emit(topLevelType, event); - reactPrivateInterface.RawEventEmitter.emit("*", event); - null == _enableNativeEventTargetEventDispatching && - ((event = - null != reactPrivateInterface.ReactNativeFeatureFlags - ? reactPrivateInterface.ReactNativeFeatureFlags - .enableNativeEventTargetEventDispatching - : null), - (_enableNativeEventTargetEventDispatching = - "function" === typeof event && event())); - if (_enableNativeEventTargetEventDispatching) - reactPrivateInterface.dispatchNativeEvent( - eventTarget, - topLevelType, - nativeEvent - ); - else { - event = eventTarget; - for ( - var events = null, legacyPlugins = plugins, i = 0; - i < legacyPlugins.length; - i++ - ) { - var possiblePlugin = legacyPlugins[i]; - possiblePlugin && - (possiblePlugin = possiblePlugin.extractEvents( - topLevelType, - target, - nativeEvent, - event - )) && - (events = accumulateInto(events, possiblePlugin)); - } - event = events; - null !== event && (eventQueue = accumulateInto(eventQueue, event)); - event = eventQueue; - eventQueue = null; - if (event) { - forEachAccumulated(event, executeDispatchesAndReleaseTopLevel); - if (eventQueue) - throw Error( - "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." - ); - if (hasError) - throw ( - ((event = caughtError), - (hasError = !1), - (caughtError = null), - event) - ); - } + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + renderLanes |= root[index$3]; + allEntangledLanes &= ~lane; } - }); -} -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, - cancelCallback$1 = Scheduler.unstable_cancelCallback, - shouldYield = Scheduler.unstable_shouldYield, - requestPaint = Scheduler.unstable_requestPaint, - now$1 = Scheduler.unstable_now, - ImmediatePriority = Scheduler.unstable_ImmediatePriority, - UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, - NormalPriority$1 = Scheduler.unstable_NormalPriority, - IdlePriority = Scheduler.unstable_IdlePriority, - log$1 = Scheduler.log, - unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, - rendererID = null, - injectedHook = null, - isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); - if (injectedHook && "function" === typeof injectedHook.setStrictMode) - try { - injectedHook.setStrictMode(rendererID, newIsStrictMode); - } catch (err) {} -} -var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log = Math.log, - LN2 = Math.LN2; -function clz32Fallback(x) { - x >>>= 0; - return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; + return renderLanes; } -var nextTransitionUpdateLane = 256, - nextTransitionDeferredLane = 262144, - nextRetryLane = 4194304; -function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & 42; - if (0 !== pendingSyncLanes) return pendingSyncLanes; - switch (lanes & -lanes) { +function computeExpirationTime(lane, currentTime) { + switch (lane) { case 1: - return 1; case 2: - return 2; case 4: - return 4; case 8: - return 8; - case 16: - return 16; - case 32: - return 32; - case 64: - return 64; - case 128: - return 128; - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - return lanes & -lanes; - case 262144: - case 524288: - case 1048576: - case 2097152: - return lanes & 3932160; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - return lanes & 62914560; - case 67108864: - return 67108864; - case 134217728: - return 134217728; - case 268435456: - return 268435456; - case 536870912: - return 536870912; - case 1073741824: - return 0; - default: - return lanes; - } -} -function getNextLanes(root, wipLanes, rootHasPendingCommit) { - var pendingLanes = root.pendingLanes; - if (0 === pendingLanes) return 0; - var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes; - root = root.warmLanes; - var nonIdlePendingLanes = pendingLanes & 134217727; - 0 !== nonIdlePendingLanes - ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : rootHasPendingCommit || - ((rootHasPendingCommit = nonIdlePendingLanes & ~root), - 0 !== rootHasPendingCommit && - (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : rootHasPendingCommit || - ((rootHasPendingCommit = pendingLanes & ~root), - 0 !== rootHasPendingCommit && - (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); - return 0 === nextLanes - ? 0 - : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (rootHasPendingCommit = wipLanes & -wipLanes), - suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) - ? wipLanes - : nextLanes; -} -function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); -} -function getEntangledLanes(root, renderLanes) { - 0 !== (renderLanes & 8) && (renderLanes |= renderLanes & 32); - var allEntangledLanes = root.entangledLanes; - if (0 !== allEntangledLanes) - for ( - root = root.entanglements, allEntangledLanes &= renderLanes; - 0 < allEntangledLanes; - - ) { - var index$6 = 31 - clz32(allEntangledLanes), - lane = 1 << index$6; - renderLanes |= root[index$6]; - allEntangledLanes &= ~lane; - } - return renderLanes; -} -function computeExpirationTime(lane, currentTime) { - switch (lane) { - case 1: - case 2: - case 4: - case 8: - case 64: - return currentTime + 250; + case 64: + return currentTime + 250; case 16: case 32: case 128: @@ -1679,18 +591,18 @@ function markRootFinished( 0 < remainingLanes; ) { - var index$9 = 31 - clz32(remainingLanes), - lane = 1 << index$9; - entanglements[index$9] = 0; - expirationTimes[index$9] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$9]; + var index$6 = 31 - clz32(remainingLanes), + lane = 1 << index$6; + entanglements[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$9] = null, index$9 = 0; - index$9 < hiddenUpdatesForLane.length; - index$9++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$9]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } remainingLanes &= ~lane; @@ -1714,10 +626,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$10 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$10; - (lane & entangledLanes) | (root[index$10] & entangledLanes) && - (root[index$10] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -1768,9 +680,9 @@ function getBumpedLaneForHydration(root, renderLanes) { function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$11 = 31 - clz32(lanes), - lane = 1 << index$11; - root[index$11].add(fiber); + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + root[index$8].add(fiber); lanes &= ~lane; } } @@ -1782,16 +694,16 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$12 = 31 - clz32(lanes); - root = 1 << index$12; - index$12 = pendingUpdatersLaneMap[index$12]; - 0 < index$12.size && - (index$12.forEach(function (fiber) { + var index$9 = 31 - clz32(lanes); + root = 1 << index$9; + index$9 = pendingUpdatersLaneMap[index$9]; + 0 < index$9.size && + (index$9.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$12.clear()); + index$9.clear()); lanes &= ~root; } } @@ -1805,8909 +717,8508 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -function getNearestMountedFiber(fiber) { - for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; ) - (node = nextNode), - 0 !== (node.flags & 4098) && (fiber = node.return), - (nextNode = node.return); - for (; node.return; ) node = node.return; - return 3 === node.tag ? fiber : null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); +var prefix, suffix; +function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$13 = parentA.child; child$13; ) { - if (child$13 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$13 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$13 = child$13.sibling; - } - if (!didFindChild) { - for (child$13 = parentB.child; child$13; ) { - if (child$13 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$13 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; + return "\n" + prefix + name + suffix; +} +var reentry = !1; +function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + reentry = !0; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$10) { + control = x$10; + } + Fake = !1; + try { + var prevProps = Object.getOwnPropertyDescriptor( + fn.prototype, + "props" + ); + Object.defineProperty(fn.prototype, "props", { + configurable: !0, + set: function () { + throw Error(); + } + }); + Fake = !0; + new fn(); + } finally { + Fake && + (void 0 !== prevProps + ? Object.defineProperty(fn.prototype, "props", prevProps) + : delete fn.prototype.props); + } + } + } else { + try { + throw Error(); + } catch (x$11) { + control = x$11; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - child$13 = child$13.sibling; + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); + return [null, null]; } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} -function traverseVisibleInstancesAndTextInstances( - child, - searchWithinHosts, - fn, - a, - b, - c -) { - for (; null !== child; ) { - if ( - ((5 === child.tag || 27 === child.tag || 6 === child.tag) && - fn(child, a, b, c)) || - ((22 !== child.tag || null === child.memoizedState) && - (searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) && - traverseVisibleInstancesAndTextInstances( - child.child, - searchWithinHosts, - fn, - a, - b, - c - )) - ) - return !0; - child = child.sibling; + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + namePropDescriptor = RunInRootFrame = 0; + RunInRootFrame < sampleLines.length && + !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); + + ) + RunInRootFrame++; + for ( + ; + namePropDescriptor < controlLines.length && + !controlLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + if ( + RunInRootFrame === sampleLines.length || + namePropDescriptor === controlLines.length + ) + for ( + RunInRootFrame = sampleLines.length - 1, + namePropDescriptor = controlLines.length - 1; + 1 <= RunInRootFrame && + 0 <= namePropDescriptor && + sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; + + ) + namePropDescriptor--; + for ( + ; + 1 <= RunInRootFrame && 0 <= namePropDescriptor; + RunInRootFrame--, namePropDescriptor-- + ) + if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { + if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { + do + if ( + (RunInRootFrame--, + namePropDescriptor--, + 0 > namePropDescriptor || + sampleLines[RunInRootFrame] !== + controlLines[namePropDescriptor]) + ) { + var frame = + "\n" + + sampleLines[RunInRootFrame].replace(" at new ", " at "); + fn.displayName && + frame.includes("") && + (frame = frame.replace("", fn.displayName)); + return frame; + } + while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + } + break; + } + } + } finally { + (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); } - return !1; + return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(previousPrepareStackTrace) + : ""; } -function getFragmentParentInstanceOrContainerFiber(fiber) { - for (fiber = fiber.return; null !== fiber; ) { - if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber; - fiber = fiber.return; +function describeFiber(fiber, childFiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return fiber.child !== childFiber && null !== childFiber + ? describeBuiltInComponentFrame("Suspense Fallback") + : describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return describeNativeComponentFrame(fiber.type, !1); + case 11: + return describeNativeComponentFrame(fiber.type.render, !1); + case 1: + return describeNativeComponentFrame(fiber.type, !0); + case 31: + return describeBuiltInComponentFrame("Activity"); + case 30: + return describeBuiltInComponentFrame("ViewTransition"); + default: + return ""; } - return null; } -function findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child, - state -) { - for (; null !== child; ) { - if (child === self) state.foundSelf = !0; - else if (5 === child.tag || 27 === child.tag || 6 === child.tag) { - if (state.foundSelf) return (result[1] = child), !0; - result[0] = child; - } else if ( - (22 !== child.tag || null === child.memoizedState) && - findFragmentInstanceOrTextInstanceSiblings( - result, - self, - child.child, - state - ) - ) - return !0; - child = child.sibling; +function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = "", + previous = null; + do + (info += describeFiber(workInProgress, previous)), + (previous = workInProgress), + (workInProgress = workInProgress.return); + while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; } - return !1; } -var valueStack = [], - index = -1; -function createCursor(defaultValue) { - return { current: defaultValue }; +function shim$1() { + throw Error( + "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." + ); } -function pop(cursor) { - 0 > index || - ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); +function shim() { + throw Error( + "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." + ); } -function push(cursor, value) { - index++; - valueStack[index] = cursor.current; - cursor.current = value; +var fabricCreateViewTransitionInstance = + reactPrivateInterface.fabricUIManager.createViewTransitionInstance, + fabricStartViewTransition = + reactPrivateInterface.fabricUIManager.startViewTransition, + fabricStartViewTransitionReadyFinished = + reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished; +function ViewTransitionPseudoElement(pseudo, name) { + this._pseudo = pseudo; + this._name = name; } -var emptyContextObject = {}, - globalClientIdCounter$1 = 0; -function getViewTransitionName(props, instance) { - if (null != props.name && "auto" !== props.name) return props.name; - if (null !== instance.autoName) return instance.autoName; - props = pendingEffectsRoot.identifierPrefix; - var globalClientId = globalClientIdCounter$1++; - props = "_" + props + "t_" + globalClientId.toString(32) + "_"; - return (instance.autoName = props); +function measureClonedInstance() { + return { + rect: { x: 0, y: 0, width: 0, height: 0 }, + abs: !1, + clip: !1, + view: !0 + }; } -function getClassNameByType(classByType) { - if (null == classByType || "string" === typeof classByType) - return classByType; - var className = null, - activeTypes = pendingTransitionTypes; - if (null !== activeTypes) - for (var i = 0; i < activeTypes.length; i++) { - var match = classByType[activeTypes[i]]; - if (null != match) { - if ("none" === match) return "none"; - className = null == className ? match : className + (" " + match); - } - } - return null == className ? classByType.default : className; +function createViewTransitionInstance(name) { + var tag = allocateTag(); + fabricCreateViewTransitionInstance(name, tag); + return { + name: name, + old: new ViewTransitionPseudoElement("old", name), + new: new ViewTransitionPseudoElement("new", name) + }; } -function getViewTransitionClassName(defaultClass, eventClass) { - defaultClass = getClassNameByType(defaultClass); - eventClass = getClassNameByType(eventClass); - return null == eventClass - ? "auto" === defaultClass - ? null - : defaultClass - : "auto" === eventClass - ? null - : eventClass; -} -function is(x, y) { - return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); -} -var objectIs = "function" === typeof Object.is ? Object.is : is, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - hasOwnProperty = Object.prototype.hasOwnProperty, - supportsUserTiming = - "undefined" !== typeof console && - "function" === typeof console.timeStamp && - !0, - currentTrack = "Blocking"; -function setCurrentTrackFromLanes(lanes) { - currentTrack = - lanes & 63 - ? "Blocking" - : lanes & 64 - ? "Gesture" - : lanes & 4194176 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; -} -function logComponentTrigger(fiber, startTime, endTime, trigger) { - supportsUserTiming && - ((reusableComponentOptions.start = startTime), - (reusableComponentOptions.end = endTime), - (reusableComponentDevToolDetails.color = "warning"), - (reusableComponentDevToolDetails.tooltipText = trigger), - (reusableComponentDevToolDetails.properties = null), - performance.measure(trigger, reusableComponentOptions), - performance.clearMeasures(trigger)); -} -function logComponentReappeared(fiber, startTime, endTime) { - logComponentTrigger(fiber, startTime, endTime, "Reconnect"); +function startViewTransition( + suspendedState, + rootContainer, + transitionTypes, + mutationCallback, + layoutCallback, + afterMutationCallback, + spawnedWorkCallback, + passiveCallback +) { + suspendedState = fabricStartViewTransition(function () { + mutationCallback(); + layoutCallback(); + afterMutationCallback(); + }); + if (null == suspendedState) + return mutationCallback(), layoutCallback(), spawnedWorkCallback(), null; + suspendedState.ready.then(function () { + spawnedWorkCallback(); + fabricStartViewTransitionReadyFinished(); + }); + suspendedState.finished.finally(function () { + passiveCallback(); + }); + return suspendedState; } -var reusableComponentDevToolDetails = { - color: "primary", - properties: null, - tooltipText: "", - track: "Components \u269b" +var createNode = reactPrivateInterface.fabricUIManager.createNode, + cloneNodeWithNewChildren = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = + reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, + createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, + appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, + appendChildNodeToSet = reactPrivateInterface.fabricUIManager.appendChildToSet, + completeRoot$1 = reactPrivateInterface.fabricUIManager.completeRoot, + registerEventHandler = + reactPrivateInterface.fabricUIManager.registerEventHandler, + FabricDiscretePriority = + reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, + FabricContinuousPriority = + reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, + FabricIdlePriority = + reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, + fabricGetCurrentEventPriority = + reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, + fabricSuspendOnActiveViewTransition = + reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, + extraDevToolsConfig = { + getInspectorDataForInstance: void 0, + getInspectorDataForViewAtPoint: function () { + throw Error( + "getInspectorDataForViewAtPoint() is not available in production." + ); + } }, - reusableComponentOptions = { - start: -0, - end: -0, - detail: { devtools: reusableComponentDevToolDetails } + getViewConfigForType = + reactPrivateInterface.ReactNativeViewConfigRegistry.get, + nextReactTag = 2; +function allocateTag() { + var tag = nextReactTag; + nextReactTag += 2; + return tag; +} +registerEventHandler && registerEventHandler(dispatchEvent); +var PROD_HOST_CONTEXT = { isInAParentText: !0 }; +function createTextInstance( + text, + rootContainerInstance, + hostContext, + internalInstanceHandle +) { + hostContext = allocateTag(); + return { + node: createNode( + hostContext, + "RCTRawText", + rootContainerInstance.containerTag, + { text: text }, + internalInstanceHandle + ) }; -function logComponentRender(fiber, startTime, endTime, wasHydrated) { - var name = getComponentNameFromFiber(fiber); - if (null !== name && supportsUserTiming) { - var alternate = fiber.alternate, - selfTime = fiber.actualDuration; - if (null === alternate || alternate.child !== fiber.child) - for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) - selfTime -= fiber.actualDuration; - console.timeStamp( - name, - startTime, - endTime, - "Components \u269b", - void 0, - 0.5 > selfTime - ? wasHydrated - ? "tertiary-light" - : "primary-light" - : 10 > selfTime - ? wasHydrated - ? "tertiary" - : "primary" - : 100 > selfTime - ? wasHydrated - ? "tertiary-dark" - : "primary-dark" - : "error" - ); +} +function getPublicInstance(instance) { + if (null != instance.canonical) { + if (null == instance.canonical.publicInstance) { + var $jscomp$nullish$tmp0; + instance.canonical.publicInstance = + reactPrivateInterface.createPublicInstance( + instance.canonical.nativeTag, + instance.canonical.viewConfig, + instance.canonical.internalInstanceHandle, + null != ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) + ? $jscomp$nullish$tmp0 + : null + ); + instance.canonical.publicRootInstance = null; + } + return instance.canonical.publicInstance; } + return null != instance.containerInfo + ? instance.containerInfo.publicInstance + : null; } -function logComponentErrored(fiber, startTime, endTime) { - supportsUserTiming && - ((fiber = getComponentNameFromFiber(fiber)), - null !== fiber && - console.timeStamp( - fiber, - startTime, - endTime, - "Components \u269b", - void 0, - "error" - )); +function getPublicInstanceFromHostFiber(fiber) { + fiber = getPublicInstance(fiber.stateNode); + if (null === fiber) + throw Error("Expected to find a host node. This is a bug in React."); + return fiber; } -function logComponentEffect(fiber, startTime, endTime, selfTime, errors) { - null !== errors - ? supportsUserTiming && - ((selfTime = getComponentNameFromFiber(fiber)), - null !== selfTime && - console.timeStamp( - selfTime, - startTime, - endTime, - "Components \u269b", - void 0, - "error" - )) - : ((fiber = getComponentNameFromFiber(fiber)), - null !== fiber && - supportsUserTiming && - console.timeStamp( - fiber, - startTime, - endTime, - "Components \u269b", - void 0, - 1 > selfTime - ? "secondary-light" - : 100 > selfTime - ? "secondary" - : 500 > selfTime - ? "secondary-dark" - : "error" - )); +var currentUpdatePriority = 0; +function resolveUpdatePriority() { + if (0 !== currentUpdatePriority) return currentUpdatePriority; + var currentEventPriority = fabricGetCurrentEventPriority + ? fabricGetCurrentEventPriority() + : null; + if (null != currentEventPriority) + switch (currentEventPriority) { + case FabricDiscretePriority: + return 2; + case FabricContinuousPriority: + return 8; + case FabricIdlePriority: + return 268435456; + } + return 32; } -function logSuspendedRenderPhase(startTime, endTime, lanes) { - !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - "Prewarm", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" - ); +var schedulerEvent = void 0; +function resolveEventType() { + var event = global.event; + event && event !== schedulerEvent + ? event.type + ? (event = event.type) + : ((event = event.dispatchConfig), + (event = + null == event || null == event.phasedRegistrationNames + ? null + : (event = + event.phasedRegistrationNames.bubbled || + event.phasedRegistrationNames.captured) + ? event.startsWith("on") + ? event.slice(2).toLowerCase() + : event.toLowerCase() + : null)) + : (event = null); + return event; } -function logSuspendedWithDelayPhase(startTime, endTime, lanes) { - !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - "Suspended", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" - ); +function resolveEventTimeStamp() { + var event = global.event; + return event && event !== schedulerEvent ? event.timeStamp : -1.1; } -function logErroredRenderPhase(startTime, endTime) { - !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - "Errored", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "error" +var scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; +function cloneHiddenInstance(instance) { + var node = instance.node, + updatePayload = reactPrivateInterface.createAttributePayload( + { style: { display: "none" } }, + instance.canonical.viewConfig.validAttributes ); + return { + node: cloneNodeWithNewProps(node, updatePayload), + canonical: instance.canonical + }; } -function logCommitErrored(startTime, endTime) { - !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - "Errored", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "error" - ); +function FragmentInstance(fragmentFiber) { + this._fragmentFiber = fragmentFiber; + this._observers = null; } -function logCommitPhase(startTime, endTime, errors, abortedViewTransition) { - null !== errors - ? logCommitErrored(startTime, endTime) - : !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - abortedViewTransition ? "Commit Interrupted View Transition" : "Commit", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - abortedViewTransition ? "error" : "secondary-dark" - ); +FragmentInstance.prototype.observeUsing = function (observer) { + null === this._observers && (this._observers = new Set()); + this._observers.add(observer); + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + observeChild, + observer, + void 0, + void 0 + ); +}; +function observeChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.observe(child); + return !1; } -function logAnimatingPhase(startTime, endTime) { - !supportsUserTiming || - endTime <= startTime || - console.timeStamp( - "Animating", - startTime, - endTime, - currentTrack, - "Scheduler \u269b", - "secondary-dark" - ); +FragmentInstance.prototype.unobserveUsing = function (observer) { + var observers = this._observers; + null !== observers && + observers.has(observer) && + (observers.delete(observer), + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + unobserveChild, + observer, + void 0, + void 0 + )); +}; +function unobserveChild(child, observer) { + child = getPublicInstanceFromHostFiber(child); + observer.unobserve(child); + return !1; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; +FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; + var children = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectChildren, + children, + void 0, + void 0 + ); + if (0 === children.length) { + children = getPublicInstanceFromHostFiber(parentHostFiber); + parentHostFiber = this._fragmentFiber; + var parentResult = children.compareDocumentPosition(otherNode); + var result = parentResult; + children === otherNode + ? (result = Node.DOCUMENT_POSITION_CONTAINS) + : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && + ((children = [null, null]), + (result = getFragmentParentInstanceOrContainerFiber(parentHostFiber)), + null !== result && + findFragmentInstanceOrTextInstanceSiblings( + children, + parentHostFiber, + result.child, + { foundSelf: !1 } + ), + (parentHostFiber = children[1]), + null === parentHostFiber + ? (result = Node.DOCUMENT_POSITION_PRECEDING) + : ((otherNode = + getPublicInstanceFromHostFiber( + parentHostFiber + ).compareDocumentPosition(otherNode)), + (result = + 0 === otherNode || otherNode & Node.DOCUMENT_POSITION_FOLLOWING + ? Node.DOCUMENT_POSITION_FOLLOWING + : Node.DOCUMENT_POSITION_PRECEDING))); + return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; + parentHostFiber = getPublicInstanceFromHostFiber(children[0]); + children = getPublicInstanceFromHostFiber(children[children.length - 1]); + result = parentHostFiber.compareDocumentPosition(otherNode); + var lastResult = children.compareDocumentPosition(otherNode); + parentResult = + result & Node.DOCUMENT_POSITION_CONTAINED_BY || + lastResult & Node.DOCUMENT_POSITION_CONTAINED_BY; + lastResult = + result & Node.DOCUMENT_POSITION_FOLLOWING && + lastResult & Node.DOCUMENT_POSITION_PRECEDING; + return parentHostFiber === otherNode || + children === otherNode || + parentResult || + lastResult + ? Node.DOCUMENT_POSITION_CONTAINED_BY + : result; +}; +function collectChildren(child, collection) { + collection.push(child); + return !1; } -var contextStackCursor = createCursor(null), - contextFiberStackCursor = createCursor(null), - rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null); -function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance); - push(contextFiberStackCursor, fiber); - push(contextStackCursor, null); - fiber = PROD_HOST_CONTEXT; - pop(contextStackCursor); - push(contextStackCursor, fiber); +FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { + var parentHostFiber = getFragmentParentInstanceOrContainerFiber( + this._fragmentFiber + ); + return null === parentHostFiber + ? this + : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( + getRootNodeOptions + ); +}; +FragmentInstance.prototype.getClientRects = function () { + var rects = []; + traverseVisibleInstancesAndTextInstances( + this._fragmentFiber.child, + !1, + collectClientRects, + rects, + void 0, + void 0 + ); + return rects; +}; +function collectClientRects(child, rects) { + child = getPublicInstanceFromHostFiber(child); + rects.push(child.getBoundingClientRect()); + return !1; } -function popHostContainer() { - pop(contextStackCursor); - pop(contextFiberStackCursor); - pop(rootInstanceStackCursor); +function addFragmentHandleToFiber(child, fragmentInstance) { + child = getPublicInstanceFromHostFiber(child); + null != child && addFragmentHandleToInstance(child, fragmentInstance); + return !1; } -function pushHostContext(fiber) { - var stateHook = fiber.memoizedState; - null !== stateHook && - ((HostTransitionContext._currentValue2 = stateHook.memoizedState), - push(hostTransitionProviderCursor, fiber)); - stateHook = contextStackCursor.current; - stateHook !== stateHook && - (push(contextFiberStackCursor, fiber), push(contextStackCursor, stateHook)); -} -function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor), pop(contextFiberStackCursor)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor), - (HostTransitionContext._currentValue2 = null)); +function addFragmentHandleToInstance(instance, fragmentInstance) { + null == instance.reactFragments && (instance.reactFragments = new Set()); + instance.reactFragments.add(fragmentInstance); } -var hydrationErrors = null; -function upgradeHydrationErrorsToRecoverable() { - var queuedErrors = hydrationErrors; - null !== queuedErrors && - (null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = queuedErrors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - queuedErrors - ), - (hydrationErrors = null)); - return queuedErrors; +function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { + if (null != childInstance.canonical) { + var publicInstance = getPublicInstance(childInstance); + if (null !== fragmentInstance._observers) { + if (null == publicInstance) + throw Error("Expected to find a host node. This is a bug in React."); + fragmentInstance._observers.forEach(function (observer) { + observer.observe(publicInstance); + }); + } + addFragmentHandleToInstance(publicInstance, fragmentInstance); + } } -var valueCursor = createCursor(null), - currentlyRenderingFiber$1 = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue2); - context._currentValue2 = nextValue; +var HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, + scheduleMicrotask = + "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout, + valueStack = [], + index = -1; +function createCursor(defaultValue) { + return { current: defaultValue }; } -function popProvider(context) { - context._currentValue2 = valueCursor.current; - pop(valueCursor); +function pop(cursor) { + 0 > index || + ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); } -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } +function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; } -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else - 13 === fiber.tag && - null !== fiber.memoizedState && - null === fiber.memoizedState.dehydrated - ? ((fiber.lanes |= renderLanes), - (nextFiber = fiber.alternate), - null !== nextFiber && (nextFiber.lanes |= renderLanes), - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ), - (nextFiber = fiber.child), - (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) - : (nextFiber = fiber.child); - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } +var emptyContextObject = {}, + globalClientIdCounter$1 = 0; +function getViewTransitionName(props, instance) { + if (null != props.name && "auto" !== props.name) return props.name; + if (null !== instance.autoName) return instance.autoName; + props = pendingEffectsRoot.identifierPrefix; + var globalClientId = globalClientIdCounter$1++; + props = "_" + props + "t_" + globalClientId.toString(32) + "_"; + return (instance.autoName = props); } -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); +function getClassNameByType(classByType) { + if (null == classByType || "string" === typeof classByType) + return classByType; + var className = null, + activeTypes = pendingTransitionTypes; + if (null !== activeTypes) + for (var i = 0; i < activeTypes.length; i++) { + var match = classByType[activeTypes[i]]; + if (null != match) { + if ("none" === match) return "none"; + className = null == className ? match : className + (" " + match); } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - return null !== current; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; + return null == className ? classByType.default : className; } -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber$1 = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); +function getViewTransitionClassName(defaultClass, eventClass) { + defaultClass = getClassNameByType(defaultClass); + eventClass = getClassNameByType(eventClass); + return null == eventClass + ? "auto" === defaultClass + ? null + : defaultClass + : "auto" === eventClass + ? null + : eventClass; } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber$1, context); +function noop() {} +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue2; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); +var objectIs = "function" === typeof Object.is ? Object.is : is, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error }); - }; + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); + hasOwnProperty = Object.prototype.hasOwnProperty, + supportsUserTiming = + "undefined" !== typeof console && + "function" === typeof console.timeStamp && + !0, + currentTrack = "Blocking"; +function setCurrentTrackFromLanes(lanes) { + currentTrack = + lanes & 63 + ? "Blocking" + : lanes & 64 + ? "Gesture" + : lanes & 4194176 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; } -function queueTransitionTypes(root, transitionTypes) { - if (0 !== (root.pendingLanes & 4194048)) { - var queued = root.transitionTypes; - null === queued && (queued = root.transitionTypes = []); - for (root = 0; root < transitionTypes.length; root++) { - var transitionType = transitionTypes[root]; - -1 === queued.indexOf(transitionType) && queued.push(transitionType); - } - } +function logComponentTrigger(fiber, startTime, endTime, trigger) { + supportsUserTiming && + ((reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + (reusableComponentDevToolDetails.color = "warning"), + (reusableComponentDevToolDetails.tooltipText = trigger), + (reusableComponentDevToolDetails.properties = null), + performance.measure(trigger, reusableComponentOptions), + performance.clearMeasures(trigger)); } -var entangledTransitionTypes = null; -function claimQueuedTransitionTypes(root) { - var claimed = root.transitionTypes; - root.transitionTypes = null; - return claimed; +function logComponentReappeared(fiber, startTime, endTime) { + logComponentTrigger(fiber, startTime, endTime, "Reconnect"); } -var now = Scheduler.unstable_now, - renderStartTime = -0, - commitStartTime = -0, - commitEndTime = -0, - commitErrors = null, - profilerStartTime = -1.1, - profilerEffectDuration = -0, - componentEffectDuration = -0, - componentEffectStartTime = -1.1, - componentEffectEndTime = -1.1, - componentEffectErrors = null, - componentEffectSpawnedUpdate = !1, - blockingClampTime = -0, - blockingUpdateTime = -1.1, - blockingUpdateType = 0, - blockingEventTime = -1.1, - blockingEventType = null, - blockingEventRepeatTime = -1.1, - blockingSuspendedTime = -1.1, - transitionClampTime = -0, - transitionStartTime = -1.1, - transitionUpdateTime = -1.1, - transitionUpdateType = 0, - transitionEventTime = -1.1, - transitionEventType = null, - transitionEventRepeatTime = -1.1, - transitionSuspendedTime = -1.1, - retryClampTime = -0, - idleClampTime = -0, - animatingLanes = 0, - yieldReason = 0, - yieldStartTime = -1.1; -function startUpdateTimerByLane(lane) { - if (0 !== (lane & 127)) { - if (0 > blockingUpdateTime) { - blockingUpdateTime = now(); - 0 !== (executionContext & 6) && - ((componentEffectSpawnedUpdate = !0), (blockingUpdateType = 1)); - lane = resolveEventTimeStamp(); - var newEventType$19 = resolveEventType(); - lane !== blockingEventRepeatTime || newEventType$19 !== blockingEventType - ? (blockingEventRepeatTime = -1.1) - : null !== newEventType$19 && (blockingUpdateType = 1); - blockingEventTime = lane; - blockingEventType = newEventType$19; - } - } else if ( - 0 !== (lane & 4194048) && - 0 > transitionUpdateTime && - ((transitionUpdateTime = now()), 0 > transitionStartTime) - ) { - lane = resolveEventTimeStamp(); - newEventType$19 = resolveEventType(); - if ( - lane !== transitionEventRepeatTime || - newEventType$19 !== transitionEventType - ) - transitionEventRepeatTime = -1.1; - transitionEventTime = lane; - transitionEventType = newEventType$19; +var reusableComponentDevToolDetails = { + color: "primary", + properties: null, + tooltipText: "", + track: "Components \u269b" + }, + reusableComponentOptions = { + start: -0, + end: -0, + detail: { devtools: reusableComponentDevToolDetails } + }; +function logComponentRender(fiber, startTime, endTime, wasHydrated) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var alternate = fiber.alternate, + selfTime = fiber.actualDuration; + if (null === alternate || alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + console.timeStamp( + name, + startTime, + endTime, + "Components \u269b", + void 0, + 0.5 > selfTime + ? wasHydrated + ? "tertiary-light" + : "primary-light" + : 10 > selfTime + ? wasHydrated + ? "tertiary" + : "primary" + : 100 > selfTime + ? wasHydrated + ? "tertiary-dark" + : "primary-dark" + : "error" + ); } } -function pushNestedEffectDurations() { - var prevEffectDuration = profilerEffectDuration; - profilerEffectDuration = 0; - return prevEffectDuration; -} -function popNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration = prevEffectDuration; - return elapsedTime; -} -function bubbleNestedEffectDurations(prevEffectDuration) { - var elapsedTime = profilerEffectDuration; - profilerEffectDuration += prevEffectDuration; - return elapsedTime; -} -function resetComponentEffectTimers() { - componentEffectEndTime = componentEffectStartTime = -1.1; -} -function pushComponentEffectStart() { - var prevEffectStart = componentEffectStartTime; - componentEffectStartTime = -1.1; - return prevEffectStart; +function logComponentErrored(fiber, startTime, endTime) { + supportsUserTiming && + ((fiber = getComponentNameFromFiber(fiber)), + null !== fiber && + console.timeStamp( + fiber, + startTime, + endTime, + "Components \u269b", + void 0, + "error" + )); } -function popComponentEffectStart(prevEffectStart) { - 0 <= prevEffectStart && (componentEffectStartTime = prevEffectStart); +function logComponentEffect(fiber, startTime, endTime, selfTime, errors) { + null !== errors + ? supportsUserTiming && + ((selfTime = getComponentNameFromFiber(fiber)), + null !== selfTime && + console.timeStamp( + selfTime, + startTime, + endTime, + "Components \u269b", + void 0, + "error" + )) + : ((fiber = getComponentNameFromFiber(fiber)), + null !== fiber && + supportsUserTiming && + console.timeStamp( + fiber, + startTime, + endTime, + "Components \u269b", + void 0, + 1 > selfTime + ? "secondary-light" + : 100 > selfTime + ? "secondary" + : 500 > selfTime + ? "secondary-dark" + : "error" + )); } -function pushComponentEffectDuration() { - var prevEffectDuration = componentEffectDuration; - componentEffectDuration = -0; - return prevEffectDuration; +function logSuspendedRenderPhase(startTime, endTime, lanes) { + !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + "Prewarm", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" + ); } -function popComponentEffectDuration(prevEffectDuration) { - 0 <= prevEffectDuration && (componentEffectDuration = prevEffectDuration); +function logSuspendedWithDelayPhase(startTime, endTime, lanes) { + !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + "Suspended", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" + ); } -function pushComponentEffectErrors() { - var prevErrors = componentEffectErrors; - componentEffectErrors = null; - return prevErrors; +function logErroredRenderPhase(startTime, endTime) { + !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + "Errored", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "error" + ); } -function pushComponentEffectDidSpawnUpdate() { - var prev = componentEffectSpawnedUpdate; - componentEffectSpawnedUpdate = !1; - return prev; +function logCommitErrored(startTime, endTime) { + !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + "Errored", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "error" + ); } -var currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); +function logCommitPhase(startTime, endTime, errors, abortedViewTransition) { + null !== errors + ? logCommitErrored(startTime, endTime) + : !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + abortedViewTransition ? "Commit Interrupted View Transition" : "Commit", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? "error" : "secondary-dark" + ); } -function stopProfilerTimerIfRunningAndRecordDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - fiber.selfBaseDuration = elapsedTime; - profilerStartTime = -1; - } +function logAnimatingPhase(startTime, endTime) { + !supportsUserTiming || + endTime <= startTime || + console.timeStamp( + "Animating", + startTime, + endTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + ); } -function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - profilerStartTime = -1; +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function recordEffectDuration() { - if (0 <= profilerStartTime) { - var endTime = now(), - elapsedTime = endTime - profilerStartTime; - profilerStartTime = -1; - profilerEffectDuration += elapsedTime; - componentEffectDuration += elapsedTime; - componentEffectEndTime = endTime; - } +var contextStackCursor = createCursor(null), + contextFiberStackCursor = createCursor(null), + rootInstanceStackCursor = createCursor(null), + hostTransitionProviderCursor = createCursor(null); +function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor, null); + pop(contextStackCursor); + push(contextStackCursor, PROD_HOST_CONTEXT); } -function recordEffectError(errorInfo) { - null === componentEffectErrors && (componentEffectErrors = []); - componentEffectErrors.push(errorInfo); - null === commitErrors && (commitErrors = []); - commitErrors.push(errorInfo); +function popHostContainer() { + pop(contextStackCursor); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); } -function startEffectTimer() { - profilerStartTime = now(); - 0 > componentEffectStartTime && - (componentEffectStartTime = profilerStartTime); +function pushHostContext(fiber) { + var stateHook = fiber.memoizedState; + null !== stateHook && + ((HostTransitionContext._currentValue2 = stateHook.memoizedState), + push(hostTransitionProviderCursor, fiber)); + stateHook = contextStackCursor.current; + stateHook !== stateHook && + (push(contextFiberStackCursor, fiber), push(contextStackCursor, stateHook)); } -function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); +function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor), pop(contextFiberStackCursor)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor), + (HostTransitionContext._currentValue2 = null)); } -function noop() {} -var firstScheduledRoot = null, - lastScheduledRoot = null, - didScheduleMicrotask = !1, - mightHavePendingSyncWork = !1, - isFlushingWork = !1, - currentEventTransitionLane = 0; -function ensureRootIsScheduled(root) { - root !== lastScheduledRoot && - null === root.next && - (null === lastScheduledRoot - ? (firstScheduledRoot = lastScheduledRoot = root) - : (lastScheduledRoot = lastScheduledRoot.next = root)); - mightHavePendingSyncWork = !0; - didScheduleMicrotask || - ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); +var hydrationErrors = null; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { - if (!isFlushingWork && mightHavePendingSyncWork) { - isFlushingWork = !0; - do { - var didPerformSomeWork = !1; - for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || 0 === root.tag) - if (0 !== syncTransitionLanes) { - var pendingLanes = root.pendingLanes; - if (0 === pendingLanes) var JSCompiler_inline_result = 0; - else { - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes; - JSCompiler_inline_result = - (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; - JSCompiler_inline_result &= - pendingLanes & ~(suspendedLanes & ~pingedLanes); - JSCompiler_inline_result = - JSCompiler_inline_result & 201326741 - ? (JSCompiler_inline_result & 201326741) | 1 - : JSCompiler_inline_result - ? JSCompiler_inline_result | 2 - : 0; - } - 0 !== JSCompiler_inline_result && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, JSCompiler_inline_result)); - } else - (JSCompiler_inline_result = workInProgressRootRenderLanes), - (JSCompiler_inline_result = getNextLanes( - root, - root === workInProgressRoot ? JSCompiler_inline_result : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root, JSCompiler_inline_result) || - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, JSCompiler_inline_result)); - root = root.next; - } - } while (didPerformSomeWork); - isFlushingWork = !1; - } +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue2); + context._currentValue2 = nextValue; } -function processRootScheduleInImmediateTask() { - schedulerEvent = global.event; - processRootScheduleInMicrotask(); +function popProvider(context) { + context._currentValue2 = valueCursor.current; + pop(valueCursor); } -function processRootScheduleInMicrotask() { - mightHavePendingSyncWork = didScheduleMicrotask = !1; - for ( - var currentTime = now$1(), prev = null, root = firstScheduledRoot; - null !== root; - - ) { - var next = root.next, - nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); - 0 === nextLanes - ? ((root.next = null), - null === prev ? (firstScheduledRoot = next) : (prev.next = next), - null === next && (lastScheduledRoot = prev)) - : ((prev = root), - 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); - root = next; +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) || - flushSyncWorkAcrossRoots_impl(0, !1); - 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); } -function scheduleTaskForRootDuringMicrotask(root, currentTime) { +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else + 13 === fiber.tag && + null !== fiber.memoizedState && + null === fiber.memoizedState.dehydrated + ? ((fiber.lanes |= renderLanes), + (nextFiber = fiber.alternate), + null !== nextFiber && (nextFiber.lanes |= renderLanes), + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + workInProgress + ), + (nextFiber = fiber.child), + (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) + : (nextFiber = fiber.child); + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } +} +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; for ( - var suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - expirationTimes = root.expirationTimes, - lanes = root.pendingLanes & -62914561; - 0 < lanes; + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7, - expirationTime = expirationTimes[index$7]; - if (-1 === expirationTime) { - if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$7] = computeExpirationTime(lane, currentTime); - } else expirationTime <= currentTime && (root.expiredLanes |= lane); - lanes &= ~lane; + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); + } + parent = parent.return; } - currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - ); - pingedLanes = root.callbackNode; - if ( - 0 === suspendedLanes || - (root === currentTime && - (2 === workInProgressSuspendedReason || - 9 === workInProgressSuspendedReason)) || - null !== root.cancelPendingCommit - ) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackNode = null), - (root.callbackPriority = 0) + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree ); - if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) + workInProgress.flags |= 262144; + return null !== current; +} +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + ) { - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + if ( + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } - null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; + return !1; } -function performWorkOnRootViaSchedulerTask(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; - schedulerEvent = global.event; - if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) - return (root.callbackNode = null), (root.callbackPriority = 0), null; - var originalCallbackNode = root.callbackNode; - 0 === pendingDelayedCommitReason && (pendingDelayedCommitReason = 2); - if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) - return null; - var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, - null !== root.cancelPendingCommit || -1 !== root.timeoutHandle - ); - if (0 === workInProgressRootRenderLanes$jscomp$0) return null; - performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); - scheduleTaskForRootDuringMicrotask(root, now$1()); - return null != root.callbackNode && root.callbackNode === originalCallbackNode - ? performWorkOnRootViaSchedulerTask.bind(null, root) - : null; +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function performSyncWorkOnRoot(root, lanes) { - if (flushPendingEffects()) return null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - performWorkOnRoot(root, lanes, !0); +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function scheduleImmediateRootScheduleTask() { - scheduleMicrotask(function () { - 0 !== (executionContext & 6) - ? scheduleCallback$3( - ImmediatePriority, - processRootScheduleInImmediateTask - ) - : processRootScheduleInMicrotask(); - }); -} -function requestTransitionLane() { - if (0 === currentEventTransitionLane) { - var actionScopeLane = currentEntangledLane; - 0 === actionScopeLane && - ((actionScopeLane = nextTransitionUpdateLane), - (nextTransitionUpdateLane <<= 1), - 0 === (nextTransitionUpdateLane & 261888) && - (nextTransitionUpdateLane = 256)); - currentEventTransitionLane = actionScopeLane; - } - return currentEventTransitionLane; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null; -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 readContextForConsumer(consumer, context) { + var value = context._currentValue2; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -function pingEngtangledActionScope() { - if ( - 0 === --currentEntangledPendingCount && - (-1 < transitionUpdateTime || (transitionStartTime = -1.1), - (entangledTransitionTypes = null), - 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])(); - } +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } -function 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 releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$2(NormalPriority, function () { + cache.controller.abort(); + }); } -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - globalMostRecentTransitionTime = now$1(); - if ( - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then - ) { - if (0 > transitionStartTime && 0 > transitionUpdateTime) { - transitionStartTime = now(); - var newEventTime = resolveEventTimeStamp(), - newEventType = resolveEventType(); - if ( - newEventTime !== transitionEventRepeatTime || - newEventType !== transitionEventType - ) - transitionEventRepeatTime = -1.1; - transitionEventTime = newEventTime; - transitionEventType = newEventType; +function queueTransitionTypes(root, transitionTypes) { + if (0 !== (root.pendingLanes & 4194048)) { + var queued = root.transitionTypes; + null === queued && (queued = root.transitionTypes = []); + for (root = 0; root < transitionTypes.length; root++) { + var transitionType = transitionTypes[root]; + -1 === queued.indexOf(transitionType) && queued.push(transitionType); } - entangleAsyncAction(transition, returnValue); } - if (null !== entangledTransitionTypes) - for (newEventTime = firstScheduledRoot; null !== newEventTime; ) - queueTransitionTypes(newEventTime, entangledTransitionTypes), - (newEventTime = newEventTime.next); - newEventTime = transition.types; - if (null !== newEventTime) { - for (newEventType = firstScheduledRoot; null !== newEventType; ) - queueTransitionTypes(newEventType, newEventTime), - (newEventType = newEventType.next); - if (0 !== currentEntangledLane) { - newEventType = entangledTransitionTypes; - null === newEventType && (newEventType = entangledTransitionTypes = []); - for (var i = 0; i < newEventTime.length; i++) { - var transitionType = newEventTime[i]; - -1 === newEventType.indexOf(transitionType) && - newEventType.push(transitionType); - } +} +var entangledTransitionTypes = null; +function claimQueuedTransitionTypes(root) { + var claimed = root.transitionTypes; + root.transitionTypes = null; + return claimed; +} +var now = Scheduler.unstable_now, + renderStartTime = -0, + commitStartTime = -0, + commitEndTime = -0, + commitErrors = null, + profilerStartTime = -1.1, + profilerEffectDuration = -0, + componentEffectDuration = -0, + componentEffectStartTime = -1.1, + componentEffectEndTime = -1.1, + componentEffectErrors = null, + componentEffectSpawnedUpdate = !1, + blockingClampTime = -0, + blockingUpdateTime = -1.1, + blockingUpdateType = 0, + blockingEventTime = -1.1, + blockingEventType = null, + blockingEventRepeatTime = -1.1, + blockingSuspendedTime = -1.1, + transitionClampTime = -0, + transitionStartTime = -1.1, + transitionUpdateTime = -1.1, + transitionUpdateType = 0, + transitionEventTime = -1.1, + transitionEventType = null, + transitionEventRepeatTime = -1.1, + transitionSuspendedTime = -1.1, + retryClampTime = -0, + idleClampTime = -0, + animatingLanes = 0, + yieldReason = 0, + yieldStartTime = -1.1; +function startUpdateTimerByLane(lane) { + if (0 !== (lane & 127)) { + if (0 > blockingUpdateTime) { + blockingUpdateTime = now(); + 0 !== (executionContext & 6) && + ((componentEffectSpawnedUpdate = !0), (blockingUpdateType = 1)); + lane = resolveEventTimeStamp(); + var newEventType$17 = resolveEventType(); + lane !== blockingEventRepeatTime || newEventType$17 !== blockingEventType + ? (blockingEventRepeatTime = -1.1) + : null !== newEventType$17 && (blockingUpdateType = 1); + blockingEventTime = lane; + blockingEventType = newEventType$17; } + } else if ( + 0 !== (lane & 4194048) && + 0 > transitionUpdateTime && + ((transitionUpdateTime = now()), 0 > transitionStartTime) + ) { + lane = resolveEventTimeStamp(); + newEventType$17 = resolveEventType(); + if ( + lane !== transitionEventRepeatTime || + newEventType$17 !== transitionEventType + ) + transitionEventRepeatTime = -1.1; + transitionEventTime = lane; + transitionEventType = newEventType$17; } - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; } -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue2, pool: cacheFromPool }; +function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; } -function shallowEqual(objA, objB) { - if (objectIs(objA, objB)) return !0; - if ( - "object" !== typeof objA || - null === objA || - "object" !== typeof objB || - null === objB - ) - return !1; - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return !1; - for (keysB = 0; keysB < keysA.length; keysB++) { - var currentKey = keysA[keysB]; - if ( - !hasOwnProperty.call(objB, currentKey) || - !objectIs(objA[currentKey], objB[currentKey]) - ) - return !1; - } - return !0; +function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; } -var SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; +function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; } -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop, noop), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - thenableState = thenable.reason; - checkIfUseWrappedInAsyncCatch(thenableState); - if (void 0 === thenableState && !("reason" in thenable)) - throw Error( - "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." - ); - throw thenableState; - default: - if ("string" === typeof thenable.status) thenable.then(noop, noop); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error( - "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } +function resetComponentEffectTimers() { + componentEffectEndTime = componentEffectStartTime = -1.1; } -function resolveLazy(lazyType) { - try { - var init = lazyType._init; - return init(lazyType._payload); - } catch (x) { - if (null !== x && "object" === typeof x && "function" === typeof x.then) - throw ((suspendedThenable = x), SuspenseException); - throw x; - } +function pushComponentEffectStart() { + var prevEffectStart = componentEffectStartTime; + componentEffectStartTime = -1.1; + return prevEffectStart; } -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; +function popComponentEffectStart(prevEffectStart) { + 0 <= prevEffectStart && (componentEffectStartTime = prevEffectStart); } -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); +function pushComponentEffectDuration() { + var prevEffectDuration = componentEffectDuration; + componentEffectDuration = -0; + return prevEffectDuration; } -var thenableState$1 = null, - thenableIndexCounter$1 = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - return trackUsedThenable(thenableState$1, thenable, index); +function popComponentEffectDuration(prevEffectDuration) { + 0 <= prevEffectDuration && (componentEffectDuration = prevEffectDuration); } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +function pushComponentEffectErrors() { + var prevErrors = componentEffectErrors; + componentEffectErrors = null; + return prevErrors; } -function throwOnInvalidObjectTypeImpl(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 pushComponentEffectDidSpawnUpdate() { + var prev = componentEffectSpawnedUpdate; + componentEffectSpawnedUpdate = !1; + return prev; } -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.index, currentFirstChild) - : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 134217730; - return lastPlacedIndex; +var currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); +} +function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 134217730); - return newFiber; +} +function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; +} +function recordEffectDuration() { + if (0 <= profilerStartTime) { + var endTime = now(), + elapsedTime = endTime - profilerStartTime; + profilerStartTime = -1; + profilerEffectDuration += elapsedTime; + componentEffectDuration += elapsedTime; + componentEffectEndTime = endTime; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (returnFiber = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - coerceRef(returnFiber, element), - returnFiber - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes - ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; - } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes +} +function recordEffectError(errorInfo) { + null === componentEffectErrors && (componentEffectErrors = []); + componentEffectErrors.push(errorInfo); + null === commitErrors && (commitErrors = []); + commitErrors.push(errorInfo); +} +function startEffectTimer() { + profilerStartTime = now(); + 0 > componentEffectStartTime && + (componentEffectStartTime = profilerStartTime); +} +function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); +} +var firstScheduledRoot = null, + lastScheduledRoot = null, + didScheduleMicrotask = !1, + mightHavePendingSyncWork = !1, + isFlushingWork = !1, + currentEventTransitionLane = 0; +function ensureRootIsScheduled(root) { + root !== lastScheduledRoot && + null === root.next && + (null === lastScheduledRoot + ? (firstScheduledRoot = lastScheduledRoot = root) + : (lastScheduledRoot = lastScheduledRoot.next = root)); + mightHavePendingSyncWork = !0; + didScheduleMicrotask || + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); +} +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes) { + if (!isFlushingWork && mightHavePendingSyncWork) { + isFlushingWork = !0; + do { + var didPerformSomeWork = !1; + for (var root = firstScheduledRoot; null !== root; ) { + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + JSCompiler_inline_result = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + JSCompiler_inline_result &= + pendingLanes & ~(suspendedLanes & ~pingedLanes); + JSCompiler_inline_result = + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 + : JSCompiler_inline_result + ? JSCompiler_inline_result | 2 + : 0; + } + 0 !== JSCompiler_inline_result && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root, + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - createChild(returnFiber, newChild, lanes) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectTypeImpl(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 - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + root = root.next; } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectTypeImpl(returnFiber, newChild); - } - return null; + } while (didPerformSomeWork); + isFlushingWork = !1; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes +} +function processRootScheduleInImmediateTask() { + schedulerEvent = global.event; + processRootScheduleInMicrotask(); +} +function processRootScheduleInMicrotask() { + mightHavePendingSyncWork = didScheduleMicrotask = !1; + for ( + var currentTime = now$1(), prev = null, root = firstScheduledRoot; + null !== root; + ) { - 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 ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild) || getIteratorFn(newChild)) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectTypeImpl(returnFiber, newChild); - } - return null; + var next = root.next, + nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); + 0 === nextLanes + ? ((root.next = null), + null === prev ? (firstScheduledRoot = next) : (prev.next = next), + null === next && (lastScheduledRoot = prev)) + : ((prev = root), + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); + root = next; } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes + (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) || + flushSyncWorkAcrossRoots_impl(0); + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); +} +function scheduleTaskForRootDuringMicrotask(root, currentTime) { + for ( + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + expirationTimes = root.expirationTimes, + lanes = root.pendingLanes & -62914561; + 0 < lanes; + ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - ((newFiber = nextOldFiber.alternate), - null !== newFiber && - oldFiber.delete(null === newFiber.key ? newIdx : newFiber.key)), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - return resultingFirstChild; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + lanes &= ~lane; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes + currentTime = workInProgressRoot; + suspendedLanes = workInProgressRootRenderLanes; + suspendedLanes = getNextLanes( + root, + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); + pingedLanes = root.callbackNode; + if ( + 0 === suspendedLanes || + (root === currentTime && + (2 === workInProgressSuspendedReason || + 9 === workInProgressSuspendedReason)) || + null !== root.cancelPendingCommit + ) + return ( + null !== pingedLanes && + null !== pingedLanes && + cancelCallback$1(pingedLanes), + (root.callbackNode = null), + (root.callbackPriority = 0) + ); + if ( + 0 === (suspendedLanes & 3) || + checkIfRootIsPrerendering(root, suspendedLanes) ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - return resultingFirstChild; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - ((nextOldFiber = step.alternate), - null !== nextOldFiber && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - )), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - return resultingFirstChild; + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + schedulerEvent = global.event; + if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; + var originalCallbackNode = root.callbackNode; + 0 === pendingDelayedCommitReason && (pendingDelayedCommitReason = 2); + if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return null != root.callbackNode && root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPendingEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); +} +function scheduleImmediateRootScheduleTask() { + scheduleMicrotask(function () { + 0 !== (executionContext & 6) + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); + }); +} +function requestTransitionLane() { + if (0 === currentEventTransitionLane) { + var actionScopeLane = currentEntangledLane; + 0 === actionScopeLane && + ((actionScopeLane = nextTransitionUpdateLane), + (nextTransitionUpdateLane <<= 1), + 0 === (nextTransitionUpdateLane & 261888) && + (nextTransitionUpdateLane = 256)); + currentEventTransitionLane = actionScopeLane; + } + return currentEventTransitionLane; +} +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null; +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), + (entangledTransitionTypes = null), + null !== currentEntangledListeners) ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - void 0 === newChild.props.ref && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (newChild = resolveLazy(newChild)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); + 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 (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - 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." - ); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectTypeImpl(returnFiber, newChild); + }; + 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 ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter$1 = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState$1 = null; - return firstChildFiber; - } catch (x) { + ); + return thenableWithOverride; +} +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + globalMostRecentTransitionTime = now$1(); + if ( + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then + ) { + if (0 > transitionStartTime && 0 > transitionUpdateTime) { + transitionStartTime = now(); + var newEventTime = resolveEventTimeStamp(), + newEventType = resolveEventType(); if ( - x === SuspenseException || - x === SuspenseActionException || - (0 === (returnFiber.mode & 1) && - "object" === typeof x && - null !== x && - "function" === typeof x.then) + newEventTime !== transitionEventRepeatTime || + newEventType !== transitionEventType ) - throw x; - var fiber = createFiberImplClass(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { + transitionEventRepeatTime = -1.1; + transitionEventTime = newEventTime; + transitionEventType = newEventType; } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - concurrentQueues = [], - concurrentQueuesIndex = 0, - concurrentlyUpdatedLanes = 0; -function finishQueueingConcurrentUpdates() { - for ( - var endIndex = concurrentQueuesIndex, - i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); - i < endIndex; - - ) { - var fiber = concurrentQueues[i]; - concurrentQueues[i++] = null; - var queue = concurrentQueues[i]; - concurrentQueues[i++] = null; - var update = concurrentQueues[i]; - concurrentQueues[i++] = null; - var lane = concurrentQueues[i]; - concurrentQueues[i++] = null; - if (null !== queue && null !== update) { - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + entangleAsyncAction(transition, returnValue); + } + if (null !== entangledTransitionTypes) + for (newEventTime = firstScheduledRoot; null !== newEventTime; ) + queueTransitionTypes(newEventTime, entangledTransitionTypes), + (newEventTime = newEventTime.next); + newEventTime = transition.types; + if (null !== newEventTime) { + for (newEventType = firstScheduledRoot; null !== newEventType; ) + queueTransitionTypes(newEventType, newEventTime), + (newEventType = newEventType.next); + if (0 !== currentEntangledLane) { + newEventType = entangledTransitionTypes; + null === newEventType && (newEventType = entangledTransitionTypes = []); + for (var i = 0; i < newEventTime.length; i++) { + var transitionType = newEventTime[i]; + -1 === newEventType.indexOf(transitionType) && + newEventType.push(transitionType); + } } - 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); } + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function enqueueUpdate$1(fiber, queue, update, lane) { - concurrentQueues[concurrentQueuesIndex++] = fiber; - concurrentQueues[concurrentQueuesIndex++] = queue; - concurrentQueues[concurrentQueuesIndex++] = update; - concurrentQueues[concurrentQueuesIndex++] = lane; - concurrentlyUpdatedLanes |= lane; - fiber.lanes |= lane; - fiber = fiber.alternate; - null !== fiber && (fiber.lanes |= lane); -} -function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { - enqueueUpdate$1(fiber, queue, update, lane); - return getRootForUpdatedFiber(fiber); -} -function enqueueConcurrentRenderForLane(fiber, lane) { - enqueueUpdate$1(fiber, null, null, lane); - return getRootForUpdatedFiber(fiber); +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { - sourceFiber.lanes |= lane; - var alternate = sourceFiber.alternate; - null !== alternate && (alternate.lanes |= lane); - for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) - (parent.childLanes |= lane), - (alternate = parent.alternate), - null !== alternate && (alternate.childLanes |= lane), - 22 === parent.tag && - ((sourceFiber = parent.stateNode), - null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), - (sourceFiber = parent), - (parent = parent.return); - return 3 === sourceFiber.tag - ? ((parent = sourceFiber.stateNode), - isHidden && - null !== update && - ((isHidden = 31 - clz32(lane)), - (sourceFiber = parent.hiddenUpdates), - (alternate = sourceFiber[isHidden]), - null === alternate - ? (sourceFiber[isHidden] = [update]) - : alternate.push(update), - (update.lane = lane | 536870912)), - parent) - : null; +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue2, pool: cacheFromPool }; } -function getRootForUpdatedFiber(sourceFiber) { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - Error( - "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." - )) - ); - for (var parent = sourceFiber.return; null !== parent; ) - (sourceFiber = parent), (parent = sourceFiber.return); - return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return !0; + if ( + "object" !== typeof objA || + null === objA || + "object" !== typeof objB || + null === objB + ) + return !1; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return !1; + for (keysB = 0; keysB < keysA.length; keysB++) { + var currentKey = keysA[keysB]; + if ( + !hasOwnProperty.call(objB, currentKey) || + !objectIs(objA[currentKey], objB[currentKey]) + ) + return !1; + } + return !0; } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +var SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); -} -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; -} -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop, noop), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + thenableState = thenable.reason; + checkIfUseWrappedInAsyncCatch(thenableState); + if (void 0 === thenableState && !("reason" in thenable)) + throw Error( + "A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`." + ); + throw thenableState; + default: + if ("string" === typeof thenable.status) thenable.then(noop, noop); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error( + "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); +function resolveLazy(lazyType) { + try { + var init = lazyType._init; + return init(lazyType._payload); + } catch (x) { + if (null !== x && "object" === typeof x && "function" === typeof x.then) + throw ((suspendedThenable = x), SuspenseException); + throw x; } } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; +} +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +var thenableState$1 = null, + thenableIndexCounter$1 = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + return trackUsedThenable(thenableState$1, thenable, index); } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, - renderLanes -) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectTypeImpl(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 createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; - break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); - break a; - case 2: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null === currentFirstChild.key + ? existingChildren.set(currentFirstChild.index, currentFirstChild) + : existingChildren.set(currentFirstChild.key, 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 |= 2), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 134217730; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 134217730); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (returnFiber = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + coerceRef(returnFiber, element), + returnFiber + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) ) - callCallback(callbacks[updateQueue], context); -} -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); -} -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); -} -var suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); -} -function pushDehydratedActivitySuspenseHandler(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, fiber); - null === shellBoundary && (shellBoundary = fiber); -} -function pushOffscreenSuspenseHandler(fiber) { - 22 === fiber.tag - ? (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary && (shellBoundary = fiber)) - : reuseSuspenseHandlerOnStack(); -} -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); -} -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); -} -var suspenseStackCursor = createCursor(0); -function pushSuspenseListContext(fiber, newContext) { - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); - push(suspenseStackCursor, newContext); -} -function popSuspenseListContext(fiber) { - pop(suspenseStackCursor); - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); -} -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if (null !== state && (null === state.dehydrated || shim$1() || shim$1())) - return node; - } else if ( - 19 === node.tag && - "independent" !== 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 ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; } - return null; -} -var renderLanes = 0, - currentlyRenderingFiber = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - thenableIndexCounter = 0, - thenableState = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); -} -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; -} -function renderWithHooks( - current, - workInProgress, - Component, - props, - secondArg, - nextRenderLanes -) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; -} -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter = 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)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); - thenableIndexCounter = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." + 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 ); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber.flags |= 1024); - return maybeThenable; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter = 0; - thenableState = null; -} -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; -} -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + return ( + (newChild = resolveLazy(newChild)), + createChild(returnFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild ); - throw Error("Rendered more hooks than during the previous render."); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(returnFiber, newChild); } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -} -function useThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - thenable = trackUsedThenable(thenableState, thenable, index); - index = currentlyRenderingFiber; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_RECOVERABLE_TYPE) return; - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error("An unsupported type was passed to use(): " + String(usable)); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); + return null; } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "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; + 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 + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (newChild = resolveLazy(newChild)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(returnFiber, newChild); } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + return null; } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$55 = !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, - gesture: null, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - gesture: null, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - gesture: update.gesture, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$55 && - ((reducer = currentEntangledActionThenable), null !== reducer)) + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; -} -function updateSyncExternalStore(subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = updateWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - nextSnapshot - ); - snapshotChanged && - ((hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - subscribe = - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && - 0 !== (workInProgressHook.memoizedState.tag & 1)); - pushSimpleEffect( - subscribe ? 9 : 8, - { destroy: void 0 }, - updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), - null - ); - if (subscribe) { - fiber.flags |= 2048; - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - 0 !== (renderLanes & 127) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - } - return nextSnapshot; -} -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); -} -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); -} -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && - (startUpdateTimerByLane(2), 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); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + return ( + (newChild = resolveLazy(newChild)), + updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) + ); } + if (isArrayImpl(newChild) || getIteratorFn(newChild)) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(returnFiber, newChild); } + return null; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; -} -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); -} -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload -) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update action 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); + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - }; - 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 = {}; - currentTransition.types = - null !== prevTransition ? prevTransition.types : null; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - null !== prevTransition && - null !== currentTransition.types && - (prevTransition.types = currentTransition.types), - (ReactSharedInternals.T = prevTransition); - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$59) { - onActionError(actionQueue, node, error$59); - } -} -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); -} -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); -} -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - 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) { - var stateHook = mountWorkInProgressHook(); - stateHook.memoizedState = stateHook.baseState = initialStateProp; - var stateQueue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - stateHook.queue = stateQueue; - stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); - stateQueue.dispatch = stateHook; - stateQueue = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !1, - stateQueue.queue - ); - stateQueue = mountWorkInProgressHook(); - var actionQueue = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - stateQueue.queue = actionQueue; - stateHook = dispatchActionState.bind( - null, - currentlyRenderingFiber, - actionQueue, - setPendingState, - stateHook - ); - actionQueue.dispatch = stateHook; - stateQueue.memoizedState = action; - return [initialStateProp, stateHook, !1]; -} -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); -} -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber.flags |= 2048), - pushSimpleEffect( - 9, - { destroy: void 0 }, - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; -} -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; -} -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; -} -function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.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 updateRef() { - return updateWorkInProgressHook().memoizedState; -} -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - { destroy: void 0 }, - create, - 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 = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); -} -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); -} -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function useEffectEventImpl(payload) { - currentlyRenderingFiber.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } -} -function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if (0 !== (executionContext & 2)) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild ); - return ref.impl.apply(void 0, arguments); - }; -} -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); -} -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); -} -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); -} -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); -} -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; -} -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + return resultingFirstChild; } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + ((newFiber = nextOldFiber.alternate), + null !== newFiber && + oldFiber.delete(null === newFiber.key ? newIdx : newFiber.key)), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; } - hook.memoizedState = [prevState, deps]; - return prevState; -} -function mountDeferredValueImpl(hook, value, initialValue) { - if ( - void 0 === initialValue || - (0 !== (renderLanes & 1073741824) && - 0 === (workInProgressRootRenderLanes & 261930)) - ) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; -} -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if ( - 0 === (renderLanes & 106) || - (0 !== (renderLanes & 1073741824) && - 0 === (workInProgressRootRenderLanes & 261930)) - ) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; -} -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - currentTransition.types = - null !== prevTransition ? prevTransition.types : null; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then + function 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, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (currentUpdatePriority = previousPriority), - null !== prevTransition && - null !== currentTransition.types && - (prevTransition.types = currentTransition.types), - (ReactSharedInternals.T = prevTransition); - } -} -function useHostTransitionStatus() { - return readContext(HostTransitionContext); -} -function updateId() { - return updateWorkInProgressHook().memoizedState; -} -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; -} -function refreshCache(fiber) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = { cache: createCache() }; - fiber.payload = provider; - return; + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + return resultingFirstChild; } - provider = provider.return; + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + ((nextOldFiber = step.alternate), + null !== nextOldFiber && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + )), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; } -} -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - action = { - lane: lane, - revertLane: 0, - gesture: null, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber); - dispatchSetStateInternal(fiber, queue, action, lane) && - startUpdateTimerByLane(lane); -} -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - gesture: null, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + void 0 === newChild.props.ref && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); + } + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 + (newChild = resolveLazy(newChild)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) ); - } catch (error) { - } finally { } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + 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." + ); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectTypeImpl(returnFiber, newChild); + } + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - gesture: null, - action: action, - hasEagerState: !1, - eagerState: null, - next: null + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter$1 = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState$1 = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber || - (null !== alternate && alternate === currentlyRenderingFiber) - ); +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + concurrentQueues = [], + concurrentQueuesIndex = 0, + concurrentlyUpdatedLanes = 0; +function finishQueueingConcurrentUpdates() { + for ( + var endIndex = concurrentQueuesIndex, + i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); + i < endIndex; + + ) { + var fiber = concurrentQueues[i]; + concurrentQueues[i++] = null; + var queue = concurrentQueues[i]; + concurrentQueues[i++] = null; + var update = concurrentQueues[i]; + concurrentQueues[i++] = null; + var lane = concurrentQueues[i]; + concurrentQueues[i++] = null; + if (null !== queue && null !== update) { + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); + } } -function 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 enqueueUpdate$1(fiber, queue, update, lane) { + concurrentQueues[concurrentQueuesIndex++] = fiber; + concurrentQueues[concurrentQueuesIndex++] = queue; + concurrentQueues[concurrentQueuesIndex++] = update; + concurrentQueues[concurrentQueuesIndex++] = lane; + concurrentlyUpdatedLanes |= lane; + fiber.lanes |= lane; + fiber = fiber.alternate; + null !== fiber && (fiber.lanes |= lane); } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194048)) { - var queueLanes = queue.lanes; +function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + enqueueUpdate$1(fiber, queue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function enqueueConcurrentRenderForLane(fiber, lane) { + enqueueUpdate$1(fiber, null, null, lane); + return getRootForUpdatedFiber(fiber); +} +function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + for (var isHidden = !1, parent = sourceFiber.return; null !== parent; ) + (parent.childLanes |= lane), + (alternate = parent.alternate), + null !== alternate && (alternate.childLanes |= lane), + 22 === parent.tag && + ((sourceFiber = parent.stateNode), + null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), + (sourceFiber = parent), + (parent = parent.return); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; +} +function getRootForUpdatedFiber(sourceFiber) { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error( + "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." + )) + ); + for (var parent = sourceFiber.return; null !== parent; ) + (sourceFiber = parent), (parent = sourceFiber.return); + return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; +} +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; +} +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); +} +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +} +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { + var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; - queue.lanes = lane; + fiber.lanes = lane; markRootEntangled(root, lane); } } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError, - useHostTransitionStatus: throwInvalidHookError, - useFormState: throwInvalidHookError, - useActionState: throwInvalidHookError, - useOptimistic: throwInvalidHookError, - useMemoCache: throwInvalidHookError, - useCacheRefresh: throwInvalidHookError, - useEffectEvent: throwInvalidHookError - }, - HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; +} +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } +} +function processUpdateQueue( + workInProgress$jscomp$0, + props, + instance$jscomp$0, + renderLanes +) { + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); + } + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; + } +} +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error( + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback + ); + callback.call(context); +} +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); +} +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; +} +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); +} +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); +} +var suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushDehydratedActivitySuspenseHandler(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, fiber); + null === shellBoundary && (shellBoundary = fiber); +} +function pushOffscreenSuspenseHandler(fiber) { + 22 === fiber.tag + ? (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary && (shellBoundary = fiber)) + : reuseSuspenseHandlerOnStack(); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function pushSuspenseListContext(fiber, newContext) { + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); + push(suspenseStackCursor, newContext); +} +function popSuspenseListContext(fiber) { + pop(suspenseStackCursor); + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); +} +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if (null !== state && (null === state.dehydrated || shim$1() || shim$1())) + return node; + } else if ( + 19 === node.tag && + "independent" !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; +} +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + thenableIndexCounter = 0, + thenableState = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); +} +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; +} +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; +} +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter = 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)); +} +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); + thenableIndexCounter = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - if (null === workInProgressRoot) + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; +} +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; +} +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; + } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter = 0; + thenableState = null; +} +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; +} +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." + "Update hook called on initial render. This is likely a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 127) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - hook.memoizedState = nextSnapshot; - var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - { destroy: void 0 }, - updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), - null - ); - return nextSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix, - globalClientId = globalClientIdCounter++; - identifierPrefix = - "_" + identifierPrefix + "r_" + globalClientId.toString(32) + "_"; - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; + throw Error("Rendered more hooks than during the previous render."); } - }, - HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; +} +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; +} +function useThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + thenable = trackUsedThenable(thenableState, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; +} +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_RECOVERABLE_TYPE) return; + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); +} +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; +} +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; +} +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); +} +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "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 = 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$53 = !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, + gesture: null, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$53 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$53 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + gesture: null, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + gesture: update.gesture, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$53 && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; +} +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; +} +function updateSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + nextSnapshot + ); + snapshotChanged && + ((hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + subscribe = + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && + 0 !== (workInProgressHook.memoizedState.tag & 1)); + pushSimpleEffect( + subscribe ? 9 : 8, + { destroy: void 0 }, + updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), + null + ); + if (subscribe) { + fiber.flags |= 2048; + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh, - useEffectEvent: updateEvent - }, - HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: rerenderActionState, - useActionState: rerenderActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh, - useEffectEvent: updateEvent - }; -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + 0 !== (renderLanes & 127) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + return nextSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } -var classComponentUpdater = { - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +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) && + (startUpdateTimerByLane(2), 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 checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function constructClassInstance(workInProgress, ctor, props) { - var context = emptyContextObject, - contextType = ctor.contextType; - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - ctor = new ctor(props, context); - workInProgress.memoizedState = - null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; - ctor.updater = classComponentUpdater; - workInProgress.stateNode = ctor; - ctor._reactInternals = workInProgress; - return ctor; +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; } -function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = {}; - initializeUpdateQueue(workInProgress); - var contextType = ctor.contextType; - instance.context = - "object" === typeof contextType && null !== contextType - ? readContext(contextType) - : emptyContextObject; - instance.state = workInProgress.memoizedState; - contextType = ctor.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), - (instance.state = workInProgress.memoizedState)); - "function" === typeof ctor.getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ((ctor = instance.state), - "function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount(), - ctor !== instance.state && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null), - processUpdateQueue(workInProgress, newProps, instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (instance.state = workInProgress.memoizedState)); - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308); +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update action 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)); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$61 in Component) - void 0 === newProps[propName$61] && - (newProps[propName$61] = Component[propName$61]); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + currentTransition.types = + null !== prevTransition ? prevTransition.types : null; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + null !== prevTransition && + null !== currentTransition.types && + (prevTransition.types = currentTransition.types), + (ReactSharedInternals.T = prevTransition); + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$57) { + onActionError(actionQueue, node, error$57); + } +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - return newProps; + 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) { + var stateHook = mountWorkInProgressHook(); + stateHook.memoizedState = stateHook.baseState = initialStateProp; + var stateQueue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + stateHook.queue = stateQueue; + stateHook = dispatchSetState.bind(null, currentlyRenderingFiber, stateQueue); + stateQueue.dispatch = stateHook; + stateQueue = mountStateImpl(!1); + var setPendingState = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + stateQueue.queue + ); + stateQueue = mountWorkInProgressHook(); + var actionQueue = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + stateQueue.queue = actionQueue; + stateHook = dispatchActionState.bind( + null, + currentlyRenderingFiber, + actionQueue, + setPendingState, + stateHook + ); + actionQueue.dispatch = stateHook; + stateQueue.memoizedState = action; + return [initialStateProp, stateHook, !1]; } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e) { - setTimeout(function () { - throw e; - }); - } +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + { destroy: void 0 }, + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; } -function logCaughtError(root, boundary, errorInfo) { - try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e) { - setTimeout(function () { - throw e; - }); - } +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; } -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; } -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; +function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.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 initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); +function updateRef() { + return updateWorkInProgressHook().memoizedState; } -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - "function" === typeof value.then - ) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - currentSourceFiber = sourceFiber.tag; - 0 !== (sourceFiber.mode & 1) || - (0 !== currentSourceFiber && - 11 !== currentSourceFiber && - 15 !== currentSourceFiber) || - ((currentSourceFiber = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), - (sourceFiber.memoizedState = currentSourceFiber.memoizedState), - (sourceFiber.lanes = currentSourceFiber.lanes)) - : ((sourceFiber.updateQueue = null), - (sourceFiber.memoizedState = null))); - currentSourceFiber = suspenseHandlerStackCursor.current; - if (null !== currentSourceFiber) { - switch (currentSourceFiber.tag) { - case 31: - case 13: - case 19: - return ( - sourceFiber.mode & 1 && - (null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === currentSourceFiber.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3)), - (currentSourceFiber.flags &= -257), - 0 === (currentSourceFiber.mode & 1) - ? currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)) - : ((currentSourceFiber.flags |= 65536), - (currentSourceFiber.lanes = rootRenderLanes)), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? (currentSourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - currentSourceFiber.mode & 1 && - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - if (currentSourceFiber.mode & 1) - return ( - (currentSourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (currentSourceFiber.flags |= 16384) - : ((returnFiber = currentSourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (currentSourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - currentSourceFiber.tag + - "). This is a bug in React." - ); - } - if (1 === root.tag) - return ( - attachPingListener(root, value, rootRenderLanes), - renderDidSuspendDelayIfPossible(), - !1 - ); - value = Error( - "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." - ); - } - currentSourceFiber = createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + { destroy: void 0 }, + create, + void 0 === deps ? null : deps ); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) - : workInProgressRootConcurrentErrors.push(currentSourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate(returnFiber.stateNode, value, root)), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - sourceFiber = returnFiber.type; - currentSourceFiber = returnFiber.stateNode; - if ( - 0 === (returnFiber.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== currentSourceFiber && - "function" === typeof currentSourceFiber.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - currentSourceFiber - )))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - value - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - break; - case 22: - if (null !== returnFiber.memoizedState) - return (returnFiber.flags |= 65536), !1; - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; } -var SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); } -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); } -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); } -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); +function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if (0 !== (executionContext & 2)) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." + ); + return ref.impl.apply(void 0, arguments); + }; +} +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); } -function updateOffscreenComponent( - current, - workInProgress, - renderLanes, - nextProps -) { - var nextChildren = nextProps.children, - prevState = null !== current ? current.memoizedState : null; - null === current && - null === workInProgress.stateNode && - (workInProgress.stateNode = { - _visibility: 1, - _pendingMarkers: null, - _retryCache: null, - _transitions: null - }); - if ("hidden" === nextProps.mode) { - if (0 !== (workInProgress.flags & 128)) { - prevState = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextProps = workInProgress.child = current.child; - for (nextChildren = 0; null !== nextProps; ) - (nextChildren = - nextChildren | nextProps.lanes | nextProps.childLanes), - (nextProps = nextProps.sibling); - nextProps = nextChildren & ~prevState; - } else (nextProps = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - prevState, - renderLanes, - nextProps - ); +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +} +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; +} +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - if (0 === (workInProgress.mode & 1)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else + } + hook.memoizedState = [prevState, deps]; + return prevState; +} +function mountDeferredValueImpl(hook, value, initialValue) { + if ( + void 0 === initialValue || + objectIs(value, initialValue) || + (0 !== (renderLanes & 1073741824) && + 0 === (workInProgressRootRenderLanes & 261930)) + ) + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + hook.memoizedState = { value: initialValue, isInitial: !0 }; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl( + hook, + prevValue, + prevIsInitial, + value, + initialValue +) { + if (prevIsInitial) { + if (objectIs(value, prevValue)) + return (hook.memoizedState = { value: value, isInitial: !1 }), value; + if (void 0 !== initialValue) return ( - (nextProps = workInProgress.lanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes, - nextProps - ) + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack()); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + } + 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 & 106) || + (0 !== (renderLanes & 1073741824) && + 0 === (workInProgressRootRenderLanes & 261930)) + ) + return ( + (didReceiveUpdate = !0), + (hook.memoizedState = { value: value, isInitial: !1 }), + value + ); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } -function bailoutOffscreenComponent(current, workInProgress) { - (null !== current && 22 === current.tag) || - null !== workInProgress.stateNode || - (workInProgress.stateNode = { - _visibility: 1, - _pendingMarkers: null, - _retryCache: null, - _transitions: null - }); - return workInProgress.sibling; +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + currentTransition.types = + null !== prevTransition ? prevTransition.types : null; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); + } finally { + (currentUpdatePriority = previousPriority), + null !== prevTransition && + null !== currentTransition.types && + (prevTransition.types = currentTransition.types), + (ReactSharedInternals.T = prevTransition); + } } -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes, - remainingChildLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue2, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - workInProgress.childLanes = remainingChildLanes; - return null; +function useHostTransitionStatus() { + return readContext(HostTransitionContext); } -function mountActivityChildren(workInProgress, nextProps) { - nextProps = mountWorkInProgressOffscreenFiber( - { mode: nextProps.mode, children: nextProps.children }, - workInProgress.mode - ); - nextProps.ref = workInProgress.ref; - workInProgress.child = nextProps; - nextProps.return = workInProgress; - return nextProps; +function updateId() { + return updateWorkInProgressHook().memoizedState; } -function retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountActivityChildren(workInProgress, workInProgress.pendingProps); - current.flags |= 2; - popSuspenseHandler(workInProgress); - workInProgress.memoizedState = null; - return current; +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; } -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 4194816); +function refreshCache(fiber) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = { cache: createCache() }; + fiber.payload = provider; + return; + } + provider = provider.return; + } +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(); + action = { + lane: lane, + revertLane: 0, + gesture: null, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane) && + startUpdateTimerByLane(lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + gesture: null, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { + } finally { + } + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 4194816; } + return !1; +} +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + gesture: null, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; +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 updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - constructClassInstance(workInProgress, Component, nextProps), - mountClassInstance(workInProgress, Component, nextProps, renderLanes), - (nextProps = !0); - else if (null === current) { - var instance = workInProgress.stateNode, - unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - instance.props = oldProps; - var oldContext = instance.context, - contextType = Component.contextType, - nextContext = emptyContextObject; - "object" === typeof contextType && - null !== contextType && - (nextContext = readContext(contextType)); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType = - "function" === typeof getDerivedStateFromProps || - "function" === typeof instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== nextContext) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - nextContext - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - nextContext - )) - ? (contextType || - ("function" !== typeof instance.UNSAFE_componentWillMount && - "function" !== typeof instance.componentWillMount) || - ("function" === typeof instance.componentWillMount && - instance.componentWillMount(), - "function" === typeof instance.UNSAFE_componentWillMount && - instance.UNSAFE_componentWillMount()), - "function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (instance.props = nextProps), - (instance.state = oldContext), - (instance.context = nextContext), - (nextProps = oldProps)) - : ("function" === typeof instance.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - instance = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - nextContext = workInProgress.memoizedProps; - contextType = resolveClassComponentProps(Component, nextContext); - instance.props = contextType; - getDerivedStateFromProps = workInProgress.pendingProps; - oldState = instance.context; - oldContext = Component.contextType; - oldProps = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (oldProps = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof instance.getSnapshotBeforeUpdate) || - ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof instance.componentWillReceiveProps) || - ((nextContext !== getDerivedStateFromProps || oldState !== oldProps) && - callComponentWillReceiveProps( - workInProgress, - instance, - nextProps, - oldProps - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - nextContext !== getDerivedStateFromProps || - oldState !== newState || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType, - nextProps, - oldState, - newState, - oldProps - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (oldContext || - ("function" !== typeof instance.UNSAFE_componentWillUpdate && - "function" !== typeof instance.componentWillUpdate) || - ("function" === typeof instance.componentWillUpdate && - instance.componentWillUpdate(nextProps, newState, oldProps), - "function" === typeof instance.UNSAFE_componentWillUpdate && - instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldProps - )), - "function" === typeof instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof instance.componentDidUpdate || - (nextContext === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (nextContext === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (instance.props = nextProps), - (instance.state = newState), - (instance.context = oldProps), - (nextProps = contextType)) - : ("function" !== typeof instance.componentDidUpdate || - (nextContext === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof instance.getSnapshotBeforeUpdate || - (nextContext === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194048)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - return finishClassComponent( - current, - workInProgress, - Component, - nextProps, - !1, - renderLanes - ); } -function finishClassComponent( - current, - workInProgress, - Component, - shouldUpdate, - hasContext, - renderLanes -) { - markRef(current, workInProgress); - hasContext = 0 !== (workInProgress.flags & 128); - if (!shouldUpdate && !hasContext) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - shouldUpdate = workInProgress.stateNode; - hasContext && "function" !== typeof Component.getDerivedStateFromError - ? ((Component = null), (profilerStartTime = -1)) - : (Component = shouldUpdate.render()); - workInProgress.flags |= 1; - null !== current && hasContext - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError, + useEffectEvent: throwInvalidHookError + }, + HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( null, - Component, - renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes); - workInProgress.memoizedState = shouldUpdate.state; - return workInProgress.child; -} -var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0, - hydrationErrors: null -}; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - didSuspend = nextProps.children; - nextProps = nextProps.fallback; - if (showFallback) { - reuseSuspenseHandlerOnStack(); - showFallback = workInProgress.mode; - var progressedPrimaryFragment = workInProgress.child; - didSuspend = { mode: "hidden", children: didSuspend }; - 0 === (showFallback & 1) && null !== progressedPrimaryFragment - ? ((progressedPrimaryFragment.childLanes = 0), - (progressedPrimaryFragment.pendingProps = didSuspend), - workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = -0), - (progressedPrimaryFragment.actualStartTime = -1.1), - (progressedPrimaryFragment.selfBaseDuration = -0), - (progressedPrimaryFragment.treeBaseDuration = -0))) - : (progressedPrimaryFragment = mountWorkInProgressOffscreenFiber( - didSuspend, - showFallback - )); - nextProps = createFiberFromFragment( - nextProps, - showFallback, - renderLanes, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 127) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + { destroy: void 0 }, + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), null ); - progressedPrimaryFragment.return = workInProgress; - nextProps.return = workInProgress; - progressedPrimaryFragment.sibling = nextProps; - workInProgress.child = progressedPrimaryFragment; - nextProps = workInProgress.child; - nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes + return nextSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = + "_" + identifierPrefix + "r_" + globalClientId.toString(32) + "_"; + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(null, nextProps); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." + ); + return ref.impl.apply(void 0, arguments); + }; } - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, didSuspend); - } - progressedPrimaryFragment = current.memoizedState; - if (null !== progressedPrimaryFragment) { - var dehydrated = progressedPrimaryFragment.dehydrated; - if (null !== dehydrated) - return updateDehydratedSuspenseComponent( - current, - workInProgress, - didSuspend, - JSCompiler_temp, - nextProps, - dehydrated, - progressedPrimaryFragment, - renderLanes + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(), + prevState = currentHook.memoizedState; + return updateDeferredValueImpl( + hook, + prevState.value, + prevState.isInitial, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh, + useEffectEvent: updateEvent + }, + HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + if (null === currentHook) + return mountDeferredValueImpl(hook, value, initialValue); + var prevState = currentHook.memoizedState; + return updateDeferredValueImpl( + hook, + prevState.value, + prevState.isInitial, + value, + initialValue ); - } - if (showFallback) { - reuseSuspenseHandlerOnStack(); - showFallback = nextProps.fallback; - didSuspend = workInProgress.mode; - progressedPrimaryFragment = current.child; - dehydrated = progressedPrimaryFragment.sibling; - var primaryChildProps = { mode: "hidden", children: nextProps.children }; - 0 === (didSuspend & 1) && workInProgress.child !== progressedPrimaryFragment - ? ((nextProps = workInProgress.child), - (nextProps.childLanes = 0), - (nextProps.pendingProps = primaryChildProps), - workInProgress.mode & 2 && - ((nextProps.actualDuration = -0), - (nextProps.actualStartTime = -1.1), - (nextProps.selfBaseDuration = - progressedPrimaryFragment.selfBaseDuration), - (nextProps.treeBaseDuration = - progressedPrimaryFragment.treeBaseDuration)), - (workInProgress.deletions = null)) - : ((nextProps = createWorkInProgress( - progressedPrimaryFragment, - primaryChildProps - )), - (nextProps.subtreeFlags = - progressedPrimaryFragment.subtreeFlags & 1206910976)); - null !== dehydrated - ? (showFallback = createWorkInProgress(dehydrated, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - didSuspend, - renderLanes, - null - )), - (showFallback.flags |= 2)); - showFallback.return = workInProgress; - nextProps.return = workInProgress; - nextProps.sibling = showFallback; - workInProgress.child = nextProps; - bailoutOffscreenComponent(null, nextProps); - nextProps = workInProgress.child; - showFallback = current.child.memoizedState; - null === showFallback - ? (showFallback = mountSuspenseOffscreenState(renderLanes)) - : ((didSuspend = showFallback.cachePool), - null !== didSuspend - ? ((progressedPrimaryFragment = CacheContext._currentValue2), - (didSuspend = - didSuspend.parent !== progressedPrimaryFragment - ? { - parent: progressedPrimaryFragment, - pool: progressedPrimaryFragment - } - : didSuspend)) - : (didSuspend = getSuspendedCache()), - (showFallback = { - baseLanes: showFallback.baseLanes | renderLanes, - cachePool: didSuspend - })); - nextProps.memoizedState = showFallback; - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(current.child, nextProps); - } - pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_temp = current.child; - current = JSCompiler_temp.sibling; - JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { - mode: "visible", - children: nextProps.children - }); - 0 === (workInProgress.mode & 1) && (JSCompiler_temp.lanes = renderLanes); - JSCompiler_temp.return = workInProgress; - JSCompiler_temp.sibling = null; - null !== current && - ((renderLanes = workInProgress.deletions), - null === renderLanes - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : renderLanes.push(current)); - workInProgress.child = JSCompiler_temp; - workInProgress.memoizedState = null; - return JSCompiler_temp; -} -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); -} -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - offscreenProps = createFiberImplClass(22, offscreenProps, null, mode); - offscreenProps.lanes = 0; - return offscreenProps; -} -function retrySuspenseComponentWithoutHydrating( - current, + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh, + useEffectEvent: updateEvent + }; +function applyDerivedStateFromProps( workInProgress, - renderLanes + ctor, + getDerivedStateFromProps, + nextProps ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function updateDehydratedSuspenseComponent( - current, - workInProgress, - didSuspend, - didPrimaryChildrenDefer, - nextProps, - suspenseInstance, - suspenseState, - renderLanes -) { - if (didSuspend) { - if (workInProgress.flags & 256) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) - ); - if (null !== workInProgress.memoizedState) - return ( - reuseSuspenseHandlerOnStack(), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - null - ); - reuseSuspenseHandlerOnStack(); - suspenseState = nextProps.fallback; - didSuspend = workInProgress.mode; - nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - didSuspend - ); - suspenseState = createFiberFromFragment( - suspenseState, - didSuspend, - renderLanes, - null - ); - suspenseState.flags |= 2; - nextProps.return = workInProgress; - suspenseState.return = workInProgress; - nextProps.sibling = suspenseState; - workInProgress.child = nextProps; - 0 !== (workInProgress.mode & 1) && - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - nextProps = workInProgress.child; - nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); - nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - didPrimaryChildrenDefer, - renderLanes - ); - workInProgress.memoizedState = SUSPENDED_MARKER; - return bailoutOffscreenComponent(null, nextProps); - } - pushPrimaryTreeSuspenseHandler(workInProgress); - if (shim$1()) - return ( - (didPrimaryChildrenDefer = shim$1().digest), - "" !== didPrimaryChildrenDefer && - ((nextProps = Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (nextProps.stack = ""), - (nextProps.digest = didPrimaryChildrenDefer), - (didPrimaryChildrenDefer = { - value: nextProps, - source: null, - stack: null - }), - null === hydrationErrors - ? (hydrationErrors = [didPrimaryChildrenDefer]) - : hydrationErrors.push(didPrimaryChildrenDefer)), - retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1); - didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes); - if (didReceiveUpdate || didPrimaryChildrenDefer) { - if (null !== currentTreeHiddenStackCursor.current) - return retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - didPrimaryChildrenDefer = workInProgressRoot; - if ( - null !== didPrimaryChildrenDefer && - ((nextProps = getBumpedLaneForHydration( - didPrimaryChildrenDefer, - renderLanes - )), - 0 !== nextProps && nextProps !== suspenseState.retryLane) - ) - throw ( - ((suspenseState.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps), - SelectiveHydrationException) - ); - shim$1() || renderDidSuspendDelayIfPossible(); - return retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); +var classComponentUpdater = { + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); } - if (shim$1()) - return ( - (workInProgress.flags |= 192), - (workInProgress.child = current.child), - null - ); - current = mountSuspensePrimaryChildren(workInProgress, nextProps.children); - current.flags |= 134221824; - return current; +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function findLastContentRow(firstChild) { - for (var lastContentRow = null; null !== firstChild; ) { - var currentRow = firstChild.alternate; - null !== currentRow && - null === findFirstSuspended(currentRow) && - (lastContentRow = firstChild); - firstChild = firstChild.sibling; +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - return lastContentRow; + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$61 in Component) + void 0 === newProps[propName$61] && + (newProps[propName$61] = Component[propName$61]); + } + return newProps; } -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode, - treeForkCount -) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode, - treeForkCount: treeForkCount - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode), - (renderState.treeForkCount = treeForkCount)); +function defaultOnRecoverableError(error) { + reportGlobalError(error); } -function reverseChildren(fiber) { - var row = fiber.child; - for (fiber.child = null; null !== row; ) { - var nextRow = row.sibling; - row.sibling = fiber.child; - fiber.child = row; - row = nextRow; +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e) { + setTimeout(function () { + throw e; + }); } } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - var suspenseContext = suspenseStackCursor.current; - if (workInProgress.flags & 128) - return pushSuspenseListContext(workInProgress, suspenseContext), null; - var shouldForceFallback = 0 !== (suspenseContext & 2); - shouldForceFallback - ? ((suspenseContext = (suspenseContext & 1) | 2), - (workInProgress.flags |= 128)) - : (suspenseContext &= 1); - pushSuspenseListContext(workInProgress, suspenseContext); - "backwards" === revealOrder && null !== current - ? (reverseChildren(current), - reconcileChildren(current, workInProgress, nextProps, renderLanes), - reverseChildren(current)) - : reconcileChildren(current, workInProgress, nextProps, renderLanes); - if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null; - else - switch (revealOrder) { - case "backwards": - renderLanes = findLastContentRow(workInProgress.child); - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null), - reverseChildren(workInProgress)); - initSuspenseListRenderState( - workInProgress, - !0, - revealOrder, - null, - tailMode, - 0 - ); - break; - case "unstable_legacy-backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode, - 0 +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e) { + setTimeout(function () { + throw e; + }); + } +} +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; +} +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; +} +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); +} +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes +) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + "function" === typeof value.then + ) { + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + returnFiber = suspenseHandlerStackCursor.current; + if (null !== returnFiber) { + switch (returnFiber.tag) { + case 31: + case 13: + case 19: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === returnFiber.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3), + (returnFiber.flags &= -257), + (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? (returnFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (returnFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (returnFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error( + "Unexpected Suspense handler tag (" + + returnFiber.tag + + "). This is a bug in React." + ); + } + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; + } + var error = createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [error]) + : workInProgressRootConcurrentErrors.push(error); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate(returnFiber.stateNode, value, root)), + enqueueCapturedUpdate(returnFiber, root), + !1 ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0, 0); - break; - case "independent": - workInProgress.memoizedState = null; - break; - default: - (renderLanes = findLastContentRow(workInProgress.child)), - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)), - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode, - 0 + case 1: + sourceFiber = returnFiber.type; + error = returnFiber.stateNode; + if ( + 0 === (returnFiber.flags & 128) && + ("function" === typeof sourceFiber.getDerivedStateFromError || + (null !== error && + "function" === typeof error.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(error)))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + value + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 ); + break; + case 22: + if (null !== returnFiber.memoizedState) + return (returnFiber.flags |= 65536), !1; } - return workInProgress.child; -} -function updateContextProvider(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - pushProvider(workInProgress, workInProgress.type, newProps.value); - reconcileChildren(current, workInProgress, newProps.children, renderLanes); - return workInProgress.child; -} -function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { - 0 === (workInProgress.mode & 1) && - null !== current && - ((current.alternate = null), - (workInProgress.alternate = null), - (workInProgress.flags |= 2)); + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, +var SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; + current.child, + nextChildren, + renderLanes + ); } -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; +function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } -function attemptEarlyBailoutIfNoScheduledUpdate( +function updateMemoComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 31: - if (null !== workInProgress.memoizedState) - return ( - (workInProgress.flags |= 128), - pushDehydratedActivitySuspenseHandler(workInProgress), - null - ); - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - stateNode = propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ); - var primaryChildLanes = workInProgress.child.childLanes; - if (stateNode || 0 !== (renderLanes & primaryChildLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - if (workInProgress.flags & 128) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - primaryChildLanes = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (primaryChildLanes) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - primaryChildLanes = workInProgress.memoizedState; - null !== primaryChildLanes && - ((primaryChildLanes.rendering = null), - (primaryChildLanes.tail = null), - (primaryChildLanes.lastEffect = null)); - pushSuspenseListContext(workInProgress, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - (workInProgress.lanes = 0), - updateOffscreenComponent( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, - renderLanes, - workInProgress.pendingProps + type, + nextProps, + renderLanes ) ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) - if (current.memoizedProps !== workInProgress.pendingProps) - didReceiveUpdate = !0; - else { +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else didReceiveUpdate = !1; - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - var elementType = workInProgress.elementType; - a: if ( - (resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (current = workInProgress.pendingProps), - (elementType = resolveLazy(elementType)), - (workInProgress.type = elementType), - "function" === typeof elementType) - ) - shouldConstruct(elementType) - ? ((current = resolveClassComponentProps(elementType, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) { - var $$typeof = elementType.$$typeof; - if ($$typeof === REACT_FORWARD_REF_TYPE) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if ($$typeof === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if ($$typeof === REACT_CONTEXT_TYPE) { - workInProgress.tag = 10; - workInProgress.type = elementType; - workInProgress = updateContextProvider( - null, - workInProgress, - renderLanes - ); - break a; - } - } - workInProgress = getComponentNameFromType(elementType) || elementType; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - workInProgress + - ". Lazy element type must resolve to a class or function." - ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - elementType, - $$typeof, - renderLanes - ) - ); - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - if (null === current) - throw Error("Should have a current fiber. This is a bug in React."); - var nextProps = workInProgress.pendingProps; - $$typeof = workInProgress.memoizedState; - elementType = $$typeof.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - nextProps = workInProgress.memoizedState; - var nextCache = nextProps.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== $$typeof.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - suspendIfUpdateReadFromEntangledAsyncAction(); - $$typeof = nextProps.element; - $$typeof === elementType - ? (workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )) - : (reconcileChildren(current, workInProgress, $$typeof, renderLanes), - (workInProgress = workInProgress.child)); - return workInProgress; - case 26: - case 27: - case 5: - return ( - pushHostContext(workInProgress), - (elementType = workInProgress.pendingProps.children), - null !== workInProgress.memoizedState && - (($$typeof = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue2 = $$typeof)), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 6: - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (elementType = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - elementType, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - (elementType = workInProgress.pendingProps), - markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent( + current, + workInProgress, + renderLanes, + nextProps +) { + var nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + null === current && + null === workInProgress.stateNode && + (workInProgress.stateNode = { + _visibility: 1, + _pendingMarkers: null, + _retryCache: null, + _transitions: null + }); + if ("hidden" === nextProps.mode) { + if (0 !== (workInProgress.flags & 128)) { + prevState = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextProps = workInProgress.child = current.child; + for (nextChildren = 0; null !== nextProps; ) + (nextChildren = + nextChildren | nextProps.lanes | nextProps.childLanes), + (nextProps = nextProps.sibling); + nextProps = nextChildren & ~prevState; + } else (nextProps = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + prevState, + renderLanes, + nextProps ); - case 12: + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = -0), - (elementType.passiveEffectDuration = -0), - reconcileChildren( + (nextProps = workInProgress.lanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, + renderLanes, + nextProps + ) ); - case 10: - return updateContextProvider(current, workInProgress, renderLanes); - case 9: - return ( - ($$typeof = workInProgress.type._context), - (elementType = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - ($$typeof = readContext($$typeof)), - (elementType = elementType($$typeof)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), - workInProgress.child + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack()); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function bailoutOffscreenComponent(current, workInProgress) { + (null !== current && 22 === current.tag) || + null !== workInProgress.stateNode || + (workInProgress.stateNode = { + _visibility: 1, + _pendingMarkers: null, + _retryCache: null, + _transitions: null + }); + return workInProgress.sibling; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes, + remainingChildLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue2, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + workInProgress.childLanes = remainingChildLanes; + return null; +} +function mountActivityChildren(workInProgress, nextProps) { + nextProps = mountWorkInProgressOffscreenFiber( + { mode: nextProps.mode, children: nextProps.children }, + workInProgress.mode + ); + nextProps.ref = workInProgress.ref; + workInProgress.child = nextProps; + nextProps.return = workInProgress; + return nextProps; +} +function retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountActivityChildren(workInProgress, workInProgress.pendingProps); + current.flags |= 2; + popSuspenseHandler(workInProgress); + workInProgress.memoizedState = null; + return current; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 4194816); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - case 14: - return updateMemoComponent( - current, + if (null === current || current.ref !== ref) + workInProgress.flags |= 4194816; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + var context = emptyContextObject, + contextType = Component.contextType; + "object" === typeof contextType && + null !== contextType && + (context = readContext(contextType)); + context = new Component(nextProps, context); + workInProgress.memoizedState = + null !== context.state && void 0 !== context.state ? context.state : null; + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + context = workInProgress.stateNode; + context.props = nextProps; + context.state = workInProgress.memoizedState; + context.refs = {}; + initializeUpdateQueue(workInProgress); + contextType = Component.contextType; + context.context = + "object" === typeof contextType && null !== contextType + ? readContext(contextType) + : emptyContextObject; + context.state = workInProgress.memoizedState; + contextType = Component.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps( workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( + Component, + contextType, + nextProps + ), + (context.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ((contextType = context.state), + "function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount(), + contextType !== context.state && + classComponentUpdater.enqueueReplaceState(context, context.state, null), + processUpdateQueue(workInProgress, nextProps, context, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (context.state = workInProgress.memoizedState)); + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308); + nextProps = !0; + } else if (null === current) { + context = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + context.props = oldProps; + var oldContext = context.context, + contextType$jscomp$0 = Component.contextType; + contextType = emptyContextObject; + "object" === typeof contextType$jscomp$0 && + null !== contextType$jscomp$0 && + (contextType = readContext(contextType$jscomp$0)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps; + contextType$jscomp$0 = + "function" === typeof getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + context, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ("function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount()), + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (context.props = nextProps), + (context.state = oldContext), + (context.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + context = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + contextType = workInProgress.memoizedProps; + contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); + context.props = contextType$jscomp$0; + getDerivedStateFromProps = workInProgress.pendingProps; + oldState = context.context; + oldContext = Component.contextType; + oldProps = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (oldProps = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof context.getSnapshotBeforeUpdate) || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && + callComponentWillReceiveProps( + workInProgress, + context, + nextProps, + oldProps + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + contextType !== getDerivedStateFromProps || + oldState !== newState || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType$jscomp$0 = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType$jscomp$0, + nextProps, + oldState, + newState, + oldProps + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (oldContext || + ("function" !== typeof context.UNSAFE_componentWillUpdate && + "function" !== typeof context.componentWillUpdate) || + ("function" === typeof context.componentWillUpdate && + context.componentWillUpdate(nextProps, newState, oldProps), + "function" === typeof context.UNSAFE_componentWillUpdate && + context.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldProps + )), + "function" === typeof context.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof context.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (context.props = nextProps), + (context.state = newState), + (context.context = oldProps), + (nextProps = contextType$jscomp$0)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + context = nextProps; + markRef(current, workInProgress); + nextProps = 0 !== (workInProgress.flags & 128); + context || nextProps + ? ((context = workInProgress.stateNode), + nextProps && "function" !== typeof Component.getDerivedStateFromError + ? ((Component = null), (profilerStartTime = -1)) + : (Component = context.render()), + (workInProgress.flags |= 1), + null !== current && nextProps + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes), + (workInProgress.memoizedState = context.state), + (current = workInProgress.child)) + : (current = bailoutOnAlreadyFinishedWork( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes - ); - case 17: + )); + return current; +} +function mountLazyComponent(workInProgress, elementType, renderLanes) { + var props = workInProgress.pendingProps; + elementType = resolveLazy(elementType); + workInProgress.type = elementType; + if ("function" === typeof elementType) { + if (shouldConstruct(elementType)) return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (props = resolveClassComponentProps(elementType, props)), (workInProgress.tag = 1), - prepareToReadContext(workInProgress), - constructClassInstance(workInProgress, elementType, $$typeof), - mountClassInstance(workInProgress, elementType, $$typeof, renderLanes), - finishClassComponent( + updateClassComponent( null, workInProgress, elementType, - !0, - !1, + props, renderLanes ) ); - case 28: + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + elementType, + props, + renderLanes + ); + } + if (void 0 !== elementType && null !== elementType) { + var $$typeof = elementType.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) + return ( + (workInProgress.tag = 11), + updateForwardRef(null, workInProgress, elementType, props, renderLanes) + ); + if ($$typeof === REACT_MEMO_TYPE) return ( - (elementType = workInProgress.type), - ($$typeof = resolveClassComponentProps( - elementType, - workInProgress.pendingProps - )), - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), - (workInProgress.tag = 0), - updateFunctionComponent( + (workInProgress.tag = 14), + updateMemoComponent( null, workInProgress, elementType, - $$typeof, + props, renderLanes ) ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 31: - $$typeof = workInProgress.pendingProps; - nextProps = 0 !== (workInProgress.flags & 128); - workInProgress.flags &= -129; - if (null === current) - workInProgress = mountActivityChildren(workInProgress, $$typeof); - else if (((elementType = current.memoizedState), null !== elementType)) - b: { - pushDehydratedActivitySuspenseHandler(workInProgress); - if (nextProps) { - if (workInProgress.flags & 256) { - workInProgress.flags &= -257; - workInProgress = retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - break b; - } - if (null !== workInProgress.memoizedState) { - workInProgress.child = current.child; - workInProgress.flags |= 128; - workInProgress = null; - break b; - } - throw Error( - "Client rendering an Activity suspended it again. This is a bug in React." - ); - } - didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ); - nextProps = 0 !== (renderLanes & current.childLanes); - if (didReceiveUpdate || nextProps) { - if (null === currentTreeHiddenStackCursor.current) { - $$typeof = workInProgressRoot; - if ( - null !== $$typeof && - ((nextProps = getBumpedLaneForHydration($$typeof, renderLanes)), - 0 !== nextProps && nextProps !== elementType.retryLane) - ) - throw ( - ((elementType.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber($$typeof, current, nextProps), - SelectiveHydrationException) - ); - renderDidSuspendDelayIfPossible(); - } - workInProgress = retryActivityComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - (workInProgress = mountActivityChildren(workInProgress, $$typeof)), - (workInProgress.flags |= 134221824); - } - else - (renderLanes = createWorkInProgress(current.child, { - mode: $$typeof.mode, - children: $$typeof.children - })), - (renderLanes.ref = workInProgress.ref), - (workInProgress.child = renderLanes), - (renderLanes.return = workInProgress), - (workInProgress = renderLanes); - return workInProgress; - case 22: - return updateOffscreenComponent( - current, - workInProgress, - renderLanes, - workInProgress.pendingProps - ); - case 24: + if ($$typeof === REACT_CONTEXT_TYPE) return ( - prepareToReadContext(workInProgress), - (elementType = readContext(CacheContext)), - null === current - ? (($$typeof = peekCacheFromPool()), - null === $$typeof && - (($$typeof = workInProgressRoot), - (nextProps = createCache()), - ($$typeof.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && ($$typeof.pooledCacheLanes |= renderLanes), - ($$typeof = nextProps)), - (workInProgress.memoizedState = { - parent: elementType, - cache: $$typeof - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, $$typeof)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - ($$typeof = current.memoizedState), - (nextProps = workInProgress.memoizedState), - $$typeof.parent !== elementType - ? (($$typeof = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = $$typeof), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - $$typeof), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== $$typeof.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (workInProgress.tag = 10), + (workInProgress.type = elementType), + updateContextProvider(null, workInProgress, renderLanes) ); - case 30: + } + workInProgress = getComponentNameFromType(elementType) || elementType; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + workInProgress + + ". Lazy element type must resolve to a class or function." + ); +} +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + didSuspend = nextProps.children; + nextProps = nextProps.fallback; + if (showFallback) return ( - null === workInProgress.stateNode && - (workInProgress.stateNode = { - autoName: null, - paired: null, - clones: null, - ref: null - }), - (elementType = workInProgress.pendingProps), - null != elementType.name && - "auto" !== elementType.name && - (workInProgress.flags |= null === current ? 18882560 : 18874368), - null !== current && current.memoizedProps.name !== elementType.name - ? (workInProgress.flags |= 4194816) - : markRef(current, workInProgress), - reconcileChildren( + reuseSuspenseHandlerOnStack(), + (showFallback = workInProgress.mode), + (didSuspend = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: didSuspend }, + showFallback + )), + (nextProps = createFiberFromFragment( + nextProps, + showFallback, + renderLanes, + null + )), + (didSuspend.return = workInProgress), + (nextProps.return = workInProgress), + (didSuspend.sibling = nextProps), + (workInProgress.child = didSuspend), + (nextProps = workInProgress.child), + (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - elementType.children, + JSCompiler_temp, renderLanes - ), - workInProgress.child + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(null, nextProps) ); - case 29: - throw workInProgress.pendingProps; + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, didSuspend); } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." + var prevState = current.memoizedState; + if (null !== prevState) { + var dehydrated = prevState.dehydrated; + if (null !== dehydrated) + return updateDehydratedSuspenseComponent( + current, + workInProgress, + didSuspend, + JSCompiler_temp, + nextProps, + dehydrated, + prevState, + renderLanes + ); + } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(), + (showFallback = nextProps.fallback), + (didSuspend = workInProgress.mode), + (prevState = current.child), + (dehydrated = prevState.sibling), + (nextProps = updateWorkInProgressOffscreenFiber(prevState, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = prevState.subtreeFlags & 1206910976), + null !== dehydrated + ? (showFallback = createWorkInProgress(dehydrated, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + didSuspend, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + bailoutOffscreenComponent(null, nextProps), + (nextProps = workInProgress.child), + (showFallback = current.child.memoizedState), + null === showFallback + ? (showFallback = mountSuspenseOffscreenState(renderLanes)) + : ((didSuspend = showFallback.cachePool), + null !== didSuspend + ? ((prevState = CacheContext._currentValue2), + (didSuspend = + didSuspend.parent !== prevState + ? { parent: prevState, pool: prevState } + : didSuspend)) + : (didSuspend = getSuspendedCache()), + (showFallback = { + baseLanes: showFallback.baseLanes | renderLanes, + cachePool: didSuspend + })), + (nextProps.memoizedState = showFallback), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + bailoutOffscreenComponent(current.child, nextProps) + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = updateWorkInProgressOffscreenFiber(renderLanes, { + mode: "visible", + children: nextProps.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; +} +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function doesRequireClone(current, completedWork) { - if (null !== current && current.child === completedWork.child) return !1; - if (0 !== (completedWork.flags & 16)) return !0; - for (current = completedWork.child; null !== current; ) { - if (0 !== (current.flags & 8218) || 0 !== (current.subtreeFlags & 8218)) - return !0; - current = current.sibling; - } - return !1; +function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + offscreenProps = createFiberImplClass(22, offscreenProps, null, mode); + offscreenProps.lanes = 0; + return offscreenProps; } -function appendAllChildren( - parent, +function updateWorkInProgressOffscreenFiber(current, offscreenProps) { + return createWorkInProgress(current, offscreenProps); +} +function retrySuspenseComponentWithoutHydrating( + current, workInProgress, - needsVisibilityToggle, - isHidden + renderLanes ) { - for (var node = workInProgress.child; null !== node; ) { - if (5 === node.tag) { - var instance = node.stateNode; - needsVisibilityToggle && - isHidden && - (instance = cloneHiddenInstance(instance)); - appendChildNode(parent.node, instance.node); - } else if (6 === node.tag) { - instance = node.stateNode; - if (needsVisibilityToggle && isHidden) - throw Error("Not yet implemented."); - appendChildNode(parent.node, instance.node); - } else if (4 !== node.tag) - if (22 === node.tag && null !== node.memoizedState) - (instance = node.child), - null !== instance && (instance.return = node), - appendAllChildren(parent, node, !0, !0); - else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === workInProgress) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === workInProgress) return; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function appendAllChildrenToContainer( - containerChildSet, +function updateDehydratedSuspenseComponent( + current, workInProgress, - needsVisibilityToggle, - isHidden + didSuspend, + didPrimaryChildrenDefer, + nextProps, + suspenseInstance, + suspenseState, + renderLanes ) { - for ( - var hasOffscreenComponentChild = !1, node = workInProgress.child; - null !== node; - - ) { - if (5 === node.tag) { - var instance = node.stateNode; - needsVisibilityToggle && - isHidden && - (instance = cloneHiddenInstance(instance)); - appendChildNodeToSet(containerChildSet, instance.node); - } else if (6 === node.tag) { - instance = node.stateNode; - if (needsVisibilityToggle && isHidden) - throw Error("Not yet implemented."); - appendChildNodeToSet(containerChildSet, instance.node); - } else if (4 !== node.tag) - if (22 === node.tag && null !== node.memoizedState) - (hasOffscreenComponentChild = node.child), - null !== hasOffscreenComponentChild && - (hasOffscreenComponentChild.return = node), - appendAllChildrenToContainer(containerChildSet, node, !0, !0), - (hasOffscreenComponentChild = !0); - else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === workInProgress) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === workInProgress) - return hasOffscreenComponentChild; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; + if (didSuspend) { + if (workInProgress.flags & 256) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) + ); + if (null !== workInProgress.memoizedState) + return ( + reuseSuspenseHandlerOnStack(), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + null + ); + reuseSuspenseHandlerOnStack(); + suspenseState = nextProps.fallback; + didSuspend = workInProgress.mode; + nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + didSuspend + ); + suspenseState = createFiberFromFragment( + suspenseState, + didSuspend, + renderLanes, + null + ); + suspenseState.flags |= 2; + nextProps.return = workInProgress; + suspenseState.return = workInProgress; + nextProps.sibling = suspenseState; + workInProgress.child = nextProps; + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + nextProps = workInProgress.child; + nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes); + nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + didPrimaryChildrenDefer, + renderLanes + ); + workInProgress.memoizedState = SUSPENDED_MARKER; + return bailoutOffscreenComponent(null, nextProps); } - return hasOffscreenComponentChild; + pushPrimaryTreeSuspenseHandler(workInProgress); + if (shim$1()) + return ( + (didPrimaryChildrenDefer = shim$1().digest), + "" !== didPrimaryChildrenDefer && + ((nextProps = Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (nextProps.stack = ""), + (nextProps.digest = didPrimaryChildrenDefer), + (didPrimaryChildrenDefer = { + value: nextProps, + source: null, + stack: null + }), + null === hydrationErrors + ? (hydrationErrors = [didPrimaryChildrenDefer]) + : hydrationErrors.push(didPrimaryChildrenDefer)), + retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1); + didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || didPrimaryChildrenDefer) { + if (null !== currentTreeHiddenStackCursor.current) + return retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + didPrimaryChildrenDefer = workInProgressRoot; + if ( + null !== didPrimaryChildrenDefer && + ((nextProps = getBumpedLaneForHydration( + didPrimaryChildrenDefer, + renderLanes + )), + 0 !== nextProps && nextProps !== suspenseState.retryLane) + ) + throw ( + ((suspenseState.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps), + SelectiveHydrationException) + ); + shim$1() || renderDidSuspendDelayIfPossible(); + return retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } + if (shim$1()) + return ( + (workInProgress.flags |= 192), + (workInProgress.child = current.child), + null + ); + current = mountSuspensePrimaryChildren(workInProgress, nextProps.children); + current.flags |= 134221824; + return current; } -function updateHostContainer(current, workInProgress) { - if (doesRequireClone(current, workInProgress)) { - current = workInProgress.stateNode; - var newChildSet = createChildNodeSet(); - appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1); - current.pendingChildren = newChildSet; - workInProgress.flags |= 4; +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +} +function findLastContentRow(firstChild) { + for (var lastContentRow = null; null !== firstChild; ) { + var currentRow = firstChild.alternate; + null !== currentRow && + null === findFirstSuspended(currentRow) && + (lastContentRow = firstChild); + firstChild = firstChild.sibling; } + return lastContentRow; } -function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue && (workInProgress.flags |= 4); - workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode, + treeForkCount +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode, + treeForkCount: treeForkCount + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode), + (renderState.treeForkCount = treeForkCount)); } -function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { - switch (renderState.tailMode) { - case "visible": - break; - case "collapsed": - for ( - var tailNode = renderState.tail, lastTailNode = null; - null !== tailNode; - - ) - null !== tailNode.alternate && (lastTailNode = tailNode), - (tailNode = tailNode.sibling); - null === lastTailNode - ? hasRenderedATailFallback || null === renderState.tail - ? (renderState.tail = null) - : (renderState.tail.sibling = null) - : (lastTailNode.sibling = null); - break; - default: - hasRenderedATailFallback = renderState.tail; - for (tailNode = null; null !== hasRenderedATailFallback; ) - null !== hasRenderedATailFallback.alternate && - (tailNode = hasRenderedATailFallback), - (hasRenderedATailFallback = hasRenderedATailFallback.sibling); - null === tailNode ? (renderState.tail = null) : (tailNode.sibling = null); +function reverseChildren(fiber) { + var row = fiber.child; + for (fiber.child = null; null !== row; ) { + var nextRow = row.sibling; + row.sibling = fiber.child; + fiber.child = row; + row = nextRow; } } -function bubbleProperties(completedWork) { - var didBailout = - null !== completedWork.alternate && - completedWork.alternate.child === completedWork.child, - newChildLanes = 0, - subtreeFlags = 0; - if (didBailout) - if (0 !== (completedWork.mode & 2)) { - for ( - var treeBaseDuration$98 = completedWork.selfBaseDuration, - child$99 = completedWork.child; - null !== child$99; - - ) - (newChildLanes |= child$99.lanes | child$99.childLanes), - (subtreeFlags |= child$99.subtreeFlags & 1206910976), - (subtreeFlags |= child$99.flags & 1206910976), - (treeBaseDuration$98 += child$99.treeBaseDuration), - (child$99 = child$99.sibling); - completedWork.treeBaseDuration = treeBaseDuration$98; - } else - for ( - treeBaseDuration$98 = completedWork.child; - null !== treeBaseDuration$98; - - ) - (newChildLanes |= - treeBaseDuration$98.lanes | treeBaseDuration$98.childLanes), - (subtreeFlags |= treeBaseDuration$98.subtreeFlags & 1206910976), - (subtreeFlags |= treeBaseDuration$98.flags & 1206910976), - (treeBaseDuration$98.return = completedWork), - (treeBaseDuration$98 = treeBaseDuration$98.sibling); - else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$98 = completedWork.actualDuration; - child$99 = completedWork.selfBaseDuration; - for (var child = completedWork.child; null !== child; ) - (newChildLanes |= child.lanes | child.childLanes), - (subtreeFlags |= child.subtreeFlags), - (subtreeFlags |= child.flags), - (treeBaseDuration$98 += child.actualDuration), - (child$99 += child.treeBaseDuration), - (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$98; - completedWork.treeBaseDuration = child$99; - } else - for ( - treeBaseDuration$98 = completedWork.child; - null !== treeBaseDuration$98; - - ) - (newChildLanes |= - treeBaseDuration$98.lanes | treeBaseDuration$98.childLanes), - (subtreeFlags |= treeBaseDuration$98.subtreeFlags), - (subtreeFlags |= treeBaseDuration$98.flags), - (treeBaseDuration$98.return = completedWork), - (treeBaseDuration$98 = treeBaseDuration$98.sibling); - completedWork.subtreeFlags |= subtreeFlags; - completedWork.childLanes = newChildLanes; - return didBailout; -} -function completeWork(current, workInProgress, renderLanes) { - var newProps = workInProgress.pendingProps; - switch (workInProgress.tag) { - case 28: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return bubbleProperties(workInProgress), null; - case 1: - return bubbleProperties(workInProgress), null; - case 3: - return ( - (renderLanes = workInProgress.stateNode), - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - popHostContainer(), - renderLanes.pendingContext && - ((renderLanes.context = renderLanes.pendingContext), - (renderLanes.pendingContext = null)), - (null !== current && null !== current.child) || - null === current || - (current.memoizedState.isDehydrated && - 0 === (workInProgress.flags & 256)) || - ((workInProgress.flags |= 1024), - upgradeHydrationErrorsToRecoverable()), - updateHostContainer(current, workInProgress), - bubbleProperties(workInProgress), - null - ); - case 26: - case 27: - case 5: - popHostContext(workInProgress); - var type = workInProgress.type; - if (null !== current && null != workInProgress.stateNode) - if ( - ((renderLanes = current.stateNode), - (type = current.memoizedProps), - (current = doesRequireClone(current, workInProgress)) || - type !== newProps) - ) { - b: { - type = reactPrivateInterface.diffAttributePayloads( - type, - newProps, - renderLanes.canonical.viewConfig.validAttributes - ); - renderLanes.canonical.currentProps = newProps; - newProps = renderLanes.node; - if (current) - newProps = - null !== type - ? cloneNodeWithNewChildrenAndProps(newProps, type) - : cloneNodeWithNewChildren(newProps); - else if (null !== type) - newProps = cloneNodeWithNewProps(newProps, type); - else { - newProps = renderLanes; - break b; - } - newProps = { node: newProps, canonical: renderLanes.canonical }; - } - newProps === renderLanes - ? (workInProgress.stateNode = renderLanes) - : ((workInProgress.flags |= 8), - (workInProgress.stateNode = newProps), - current && appendAllChildren(newProps, workInProgress, !1, !1)); - } else workInProgress.stateNode = renderLanes; - else { - if (!newProps) { - if (null === workInProgress.stateNode) - throw Error( - "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." - ); - bubbleProperties(workInProgress); - workInProgress.subtreeFlags &= -33554433; - return null; - } - current = rootInstanceStackCursor.current; - renderLanes = allocateTag(); - type = getViewConfigForType(type); - var updatePayload = reactPrivateInterface.createAttributePayload( - newProps, - type.validAttributes - ); - current = { - node: createNode( - renderLanes, - type.uiViewClassName, - current.containerTag, - updatePayload, - workInProgress - ), - canonical: { - nativeTag: renderLanes, - viewConfig: type, - currentProps: newProps, - internalInstanceHandle: workInProgress, - publicInstance: null, - publicRootInstance: current.publicInstance - } - }; - workInProgress.flags |= 8; - appendAllChildren(current, workInProgress, !1, !1); - workInProgress.stateNode = current; - } - bubbleProperties(workInProgress); - workInProgress.subtreeFlags &= -33554433; - workInProgress.flags &= -16777217; - return null; - case 6: - if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps - ? ((current = rootInstanceStackCursor.current), - (renderLanes = contextStackCursor.current), - (workInProgress.flags |= 8), - (workInProgress.stateNode = createTextInstance( - newProps, - current, - renderLanes, - workInProgress - ))) - : (workInProgress.stateNode = current.stateNode); - else { - if ("string" !== typeof newProps && null === workInProgress.stateNode) - throw Error( - "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." - ); - current = rootInstanceStackCursor.current; - renderLanes = contextStackCursor.current; - workInProgress.flags |= 8; - workInProgress.stateNode = createTextInstance( - newProps, - current, - renderLanes, - workInProgress - ); +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + var suspenseContext = suspenseStackCursor.current; + if (workInProgress.flags & 128) + return pushSuspenseListContext(workInProgress, suspenseContext), null; + var shouldForceFallback = 0 !== (suspenseContext & 2); + shouldForceFallback + ? ((suspenseContext = (suspenseContext & 1) | 2), + (workInProgress.flags |= 128)) + : (suspenseContext &= 1); + pushSuspenseListContext(workInProgress, suspenseContext); + "backwards" === revealOrder && null !== current + ? (reverseChildren(current), + reconcileChildren(current, workInProgress, nextProps, renderLanes), + reverseChildren(current)) + : reconcileChildren(current, workInProgress, nextProps, renderLanes); + if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; } - bubbleProperties(workInProgress); - return null; - case 31: - renderLanes = workInProgress.memoizedState; - if (null === current || null !== current.memoizedState) { - if (null !== renderLanes) { - if (null === current) { - throw Error( - "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." - ); - throw Error( - "Expected prepareToHydrateHostActivityInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." - ); - } - 0 === (workInProgress.flags & 128) && - (renderLanes = workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - null !== renderLanes && - ((current = workInProgress.child), - null !== current && - (workInProgress.treeBaseDuration -= current.treeBaseDuration)); - current = !1; - } else - (renderLanes = upgradeHydrationErrorsToRecoverable()), - null !== current && - null !== current.memoizedState && - (current.memoizedState.hydrationErrors = renderLanes), - (current = !0); - if (!current) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; - } - if (0 !== (workInProgress.flags & 128)) - throw Error( - "Client rendering an Activity suspended it again. This is a bug in React." - ); + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; } - bubbleProperties(workInProgress); - return null; - case 13: - newProps = workInProgress.memoizedState; - if ( - null === current || - (null !== current.memoizedState && - null !== current.memoizedState.dehydrated) - ) { - type = newProps; - if (null !== type && null !== type.dehydrated) { - if (null === current) { - throw Error( - "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." - ); - throw Error( - "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." - ); - } - 0 === (workInProgress.flags & 128) && - (type = workInProgress.memoizedState = null); - workInProgress.flags |= 4; - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - null !== type && - ((type = workInProgress.child), - null !== type && - (workInProgress.treeBaseDuration -= type.treeBaseDuration)); - type = !1; - } else - (type = upgradeHydrationErrorsToRecoverable()), - null !== current && - null !== current.memoizedState && - (current.memoizedState.hydrationErrors = type), - (type = !0); - if (!type) { - if (workInProgress.flags & 256) - return popSuspenseHandler(workInProgress), workInProgress; - popSuspenseHandler(workInProgress); - return null; + current.sibling.return = current.return; + current = current.sibling; + } + switch (revealOrder) { + case "backwards": + renderLanes = findLastContentRow(workInProgress.child); + null === renderLanes + ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null), + reverseChildren(workInProgress)); + initSuspenseListRenderState( + workInProgress, + !0, + revealOrder, + null, + tailMode, + 0 + ); + break; + case "unstable_legacy-backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; } - popSuspenseHandler(workInProgress); - if (0 !== (workInProgress.flags & 128)) - return ( - (workInProgress.lanes = renderLanes), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress - ); - renderLanes = null !== newProps; - current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), - null !== newProps.alternate && - null !== newProps.alternate.memoizedState && - null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (updatePayload = null), - null !== newProps.memoizedState && - null !== newProps.memoizedState.cachePool && - (updatePayload = newProps.memoizedState.cachePool.pool), - updatePayload !== type && (newProps.flags |= 2048)); - renderLanes !== current && - renderLanes && - (workInProgress.child.flags |= 8192); - scheduleRetryEffect(workInProgress, workInProgress.updateQueue); - bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && - renderLanes && - ((current = workInProgress.child), - null !== current && - (workInProgress.treeBaseDuration -= current.treeBaseDuration)); - return null; - case 4: - return ( - popHostContainer(), - updateHostContainer(current, workInProgress), - (workInProgress.flags |= 67108864), - bubbleProperties(workInProgress), - null - ); - case 10: - return ( - popProvider(workInProgress.type), bubbleProperties(workInProgress), null + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode, + 0 ); - case 17: - return bubbleProperties(workInProgress), null; - case 19: - popSuspenseListContext(workInProgress); - newProps = workInProgress.memoizedState; - if (null === newProps) return bubbleProperties(workInProgress), null; - type = 0 !== (workInProgress.flags & 128); - updatePayload = newProps.rendering; - if (null === updatePayload) - if (type) cutOffTailIfNeeded(newProps, !1); - else { - if ( - 0 !== workInProgressRootExitStatus || - (null !== current && 0 !== (current.flags & 128)) - ) - for (current = workInProgress.child; null !== current; ) { - updatePayload = findFirstSuspended(current); - if (null !== updatePayload) { - workInProgress.flags |= 128; - cutOffTailIfNeeded(newProps, !1); - current = updatePayload.updateQueue; - workInProgress.updateQueue = current; - scheduleRetryEffect(workInProgress, current); - workInProgress.subtreeFlags = 0; - current = renderLanes; - for (renderLanes = workInProgress.child; null !== renderLanes; ) - resetWorkInProgress(renderLanes, current), - (renderLanes = renderLanes.sibling); - pushSuspenseListContext( - workInProgress, - (suspenseStackCursor.current & 1) | 2 - ); - return workInProgress.child; - } - current = current.sibling; - } - null !== newProps.tail && - now$1() > workInProgressRootRenderTargetTime && - ((workInProgress.flags |= 128), - (type = !0), - cutOffTailIfNeeded(newProps, !1), - (workInProgress.lanes = 4194304)); - } - else { - if (!type) - if ( - ((current = findFirstSuspended(updatePayload)), null !== current) - ) { - if ( - ((workInProgress.flags |= 128), - (type = !0), - (current = current.updateQueue), - (workInProgress.updateQueue = current), - scheduleRetryEffect(workInProgress, current), - cutOffTailIfNeeded(newProps, !0), - null === newProps.tail && - "collapsed" !== newProps.tailMode && - "visible" !== newProps.tailMode && - !updatePayload.alternate) - ) - return bubbleProperties(workInProgress), null; - } else - 2 * now$1() - newProps.renderingStartTime > - workInProgressRootRenderTargetTime && - 536870912 !== renderLanes && - ((workInProgress.flags |= 128), - (type = !0), - cutOffTailIfNeeded(newProps, !1), - (workInProgress.lanes = 4194304)); - newProps.isBackwards - ? ((updatePayload.sibling = workInProgress.child), - (workInProgress.child = updatePayload)) - : ((current = newProps.last), - null !== current - ? (current.sibling = updatePayload) - : (workInProgress.child = updatePayload), - (newProps.last = updatePayload)); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0, 0); + break; + case "independent": + workInProgress.memoizedState = null; + break; + default: + (renderLanes = findLastContentRow(workInProgress.child)), + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)), + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode, + 0 + ); + } + return workInProgress.child; +} +function updateContextProvider(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + pushProvider(workInProgress, workInProgress.type, newProps.value); + reconcileChildren(current, workInProgress, newProps.children, renderLanes); + return workInProgress.child; +} +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; +} +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; +} +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes +) { + switch (workInProgress.tag) { + case 3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 31: + if (null !== workInProgress.memoizedState) + return ( + (workInProgress.flags |= 128), + pushDehydratedActivitySuspenseHandler(workInProgress), + null + ); + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + stateNode = propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ); + var primaryChildLanes = workInProgress.child.childLanes; + if (stateNode || 0 !== (renderLanes & primaryChildLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; } - if (null !== newProps.tail) { - current = newProps.tail; - a: { - for (renderLanes = current; null !== renderLanes; ) { - if (null !== renderLanes.alternate) { - renderLanes = !1; - break a; - } - renderLanes = renderLanes.sibling; - } - renderLanes = !0; - } - newProps.rendering = current; - newProps.tail = current.sibling; - newProps.renderingStartTime = now$1(); - current.sibling = null; - updatePayload = suspenseStackCursor.current; - updatePayload = type ? (updatePayload & 1) | 2 : updatePayload & 1; - "visible" !== newProps.tailMode && - "collapsed" !== newProps.tailMode && - renderLanes - ? ((renderLanes = updatePayload), - push(suspenseHandlerStackCursor, workInProgress), - push(suspenseStackCursor, renderLanes), - null === shellBoundary && (shellBoundary = workInProgress)) - : pushSuspenseListContext(workInProgress, updatePayload); - return current; + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + if (workInProgress.flags & 128) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + primaryChildLanes = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (primaryChildLanes) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; } - bubbleProperties(workInProgress); - return null; + primaryChildLanes = workInProgress.memoizedState; + null !== primaryChildLanes && + ((primaryChildLanes.rendering = null), + (primaryChildLanes.tail = null), + (primaryChildLanes.lastEffect = null)); + pushSuspenseListContext(workInProgress, suspenseStackCursor.current); + if (stateNode) break; + else return null; case 22: - case 23: return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - (newProps = null !== workInProgress.memoizedState), - null !== current - ? (null !== current.memoizedState) !== newProps && - (workInProgress.flags |= 8192) - : newProps && (workInProgress.flags |= 8192), - newProps && 0 !== (workInProgress.mode & 1) - ? 0 !== (renderLanes & 536870912) && - 0 === (workInProgress.flags & 128) && - (bubbleProperties(workInProgress), - workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), - (renderLanes = workInProgress.updateQueue), - null !== renderLanes && - scheduleRetryEffect(workInProgress, renderLanes.retryQueue), - (renderLanes = null), - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (renderLanes = current.memoizedState.cachePool.pool), - (newProps = null), - null !== workInProgress.memoizedState && - null !== workInProgress.memoizedState.cachePool && - (newProps = workInProgress.memoizedState.cachePool.pool), - newProps !== renderLanes && (workInProgress.flags |= 2048), - null !== current && pop(resumedCache), - null + (workInProgress.lanes = 0), + updateOffscreenComponent( + current, + workInProgress, + renderLanes, + workInProgress.pendingProps + ) ); case 24: - return ( - (renderLanes = null), - null !== current && (renderLanes = current.memoizedState.cache), - workInProgress.memoizedState.cache !== renderLanes && - (workInProgress.flags |= 2048), - popProvider(CacheContext), - bubbleProperties(workInProgress), - null - ); - case 25: - return null; - case 30: - return ( - (workInProgress.flags |= 33554432), - bubbleProperties(workInProgress), - null - ); - case 29: - return null; + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } -function unwindWork(current, workInProgress) { +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if (current.memoizedProps !== workInProgress.pendingProps) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else didReceiveUpdate = !1; + workInProgress.lanes = 0; switch (workInProgress.tag) { + case 16: + return mountLazyComponent( + workInProgress, + workInProgress.elementType, + renderLanes + ); + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); case 1: - return ( - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null + var Component$84 = workInProgress.type, + resolvedProps = resolveClassComponentProps( + Component$84, + workInProgress.pendingProps + ); + return updateClassComponent( + current, + workInProgress, + Component$84, + resolvedProps, + renderLanes ); case 3: - return ( - popProvider(CacheContext), - popHostContainer(), - (current = workInProgress.flags), - 0 !== (current & 65536) && 0 === (current & 128) - ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) - : null - ); + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + if (null === current) + throw Error("Should have a current fiber. This is a bug in React."); + var nextProps = workInProgress.pendingProps; + resolvedProps = workInProgress.memoizedState; + Component$84 = resolvedProps.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + nextProps = workInProgress.memoizedState; + var nextCache = nextProps.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== resolvedProps.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + resolvedProps = nextProps.element; + resolvedProps === Component$84 + ? (workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + )) + : (reconcileChildren( + current, + workInProgress, + resolvedProps, + renderLanes + ), + (workInProgress = workInProgress.child)); + return workInProgress; case 26: case 27: case 5: - return popHostContext(workInProgress), null; - case 31: - if ( + return ( + pushHostContext(workInProgress), + (Component$84 = workInProgress.pendingProps.children), null !== workInProgress.memoizedState && - (popSuspenseHandler(workInProgress), null === workInProgress.alternate) - ) - throw Error( - "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." - ); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null; + ((resolvedProps = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue2 = resolvedProps)), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component$84, renderLanes), + workInProgress.child + ); + case 6: + return null; case 13: - popSuspenseHandler(workInProgress); - current = workInProgress.memoizedState; - if ( - null !== current && - null !== current.dehydrated && - null === workInProgress.alternate - ) - throw Error( - "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." - ); - current = workInProgress.flags; - return current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null; - case 19: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: return ( - popSuspenseListContext(workInProgress), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - (current = workInProgress.memoizedState), - null !== current && - ((current.rendering = null), (current.tail = null)), - (workInProgress.flags |= 4), - workInProgress) - : null + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (Component$84 = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component$84, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + Component$84, + renderLanes + ), + workInProgress.child ); - case 4: - return popHostContainer(), null; - case 10: - return popProvider(workInProgress.type), null; - case 22: - case 23: + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: return ( - popSuspenseHandler(workInProgress), - popHiddenContext(), - null !== current && pop(resumedCache), - (current = workInProgress.flags), - current & 65536 - ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && - transferActualDuration(workInProgress), - workInProgress) - : null + (Component$84 = workInProgress.pendingProps), + markRef(current, workInProgress), + reconcileChildren(current, workInProgress, Component$84, renderLanes), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (Component$84 = workInProgress.stateNode), + (Component$84.effectDuration = -0), + (Component$84.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - case 24: - return popProvider(CacheContext), null; - case 25: - return null; - default: - return null; - } -} -function unwindInterruptedWork(current, interruptedWork) { - switch (interruptedWork.tag) { - case 3: - popProvider(CacheContext); - popHostContainer(); - break; - case 26: - case 27: - case 5: - popHostContext(interruptedWork); - break; - case 4: - popHostContainer(); - break; - case 31: - null !== interruptedWork.memoizedState && - popSuspenseHandler(interruptedWork); - break; - case 13: - popSuspenseHandler(interruptedWork); - break; - case 19: - popSuspenseListContext(interruptedWork); - break; case 10: - popProvider(interruptedWork.type); - break; - case 22: - case 23: - popSuspenseHandler(interruptedWork); - popHiddenContext(); - null !== current && pop(resumedCache); - break; - case 24: - popProvider(CacheContext); - } -} -function shouldProfile(current) { - return 0 !== (current.mode & 2); -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork), - recordEffectDuration()) - : commitHookEffectListMount(hookFlags, finishedWork); -} -function commitHookLayoutUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordEffectDuration()) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor + return updateContextProvider(current, workInProgress, renderLanes); + case 9: + return ( + (resolvedProps = workInProgress.type._context), + (Component$84 = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (resolvedProps = readContext(resolvedProps)), + (Component$84 = Component$84(resolvedProps)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, Component$84, renderLanes), + workInProgress.child ); -} -function commitHookEffectListMount(flags, finishedWork) { - try { - var updateQueue = finishedWork.updateQueue, - lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== lastEffect) { - var firstEffect = lastEffect.next; - updateQueue = firstEffect; - do { - if ((updateQueue.tag & flags) === flags) { - lastEffect = void 0; - var create = updateQueue.create, - inst = updateQueue.inst; - lastEffect = create(); - inst.destroy = lastEffect; - } - updateQueue = updateQueue.next; - } while (updateQueue !== firstEffect); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor$jscomp$0 -) { - try { - var updateQueue = finishedWork.updateQueue, - lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== lastEffect) { - var firstEffect = lastEffect.next; - updateQueue = firstEffect; - do { - if ((updateQueue.tag & flags) === flags) { - var inst = updateQueue.inst, - destroy = inst.destroy; - if (void 0 !== destroy) { - inst.destroy = void 0; - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy; - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, - nearestMountedAncestor, - error + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 31: + resolvedProps = workInProgress.pendingProps; + nextProps = 0 !== (workInProgress.flags & 128); + workInProgress.flags &= -129; + if (null === current) + workInProgress = mountActivityChildren(workInProgress, resolvedProps); + else if (((Component$84 = current.memoizedState), null !== Component$84)) + b: { + pushDehydratedActivitySuspenseHandler(workInProgress); + if (nextProps) { + if (workInProgress.flags & 256) { + workInProgress.flags &= -257; + workInProgress = retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes ); + break b; } - } - } - updateQueue = updateQueue.next; - } while (updateQueue !== firstEffect); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork), - recordEffectDuration()) - : commitHookEffectListMount(hookFlags, finishedWork); -} -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? (startEffectTimer(), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordEffectDuration()) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance -) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) { - startEffectTimer(); - try { - instance.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - recordEffectDuration(); - } else - try { - instance.componentWillUnmount(); - } catch (error$133) { - captureCommitPhaseError(current, nearestMountedAncestor, error$133); - } -} -function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = getPublicInstance(current.stateNode); - break; - case 30: - var instance = current.stateNode, - name = getViewTransitionName(current.memoizedProps, instance); - if (null === instance.ref || instance.ref.name !== name) - instance.ref = createViewTransitionInstance(name); - instanceToUse = instance.ref; - break; - case 7: - if (null === current.stateNode) { - var fragmentInstance = new FragmentInstance(current); - traverseVisibleInstancesAndTextInstances( - current.child, - !1, - addFragmentHandleToFiber, - fragmentInstance, - void 0, - void 0 + if (null !== workInProgress.memoizedState) { + workInProgress.child = current.child; + workInProgress.flags |= 128; + workInProgress = null; + break b; + } + throw Error( + "Client rendering an Activity suspended it again. This is a bug in React." ); - current.stateNode = fragmentInstance; - } - instanceToUse = current.stateNode; - break; - default: - instanceToUse = current.stateNode; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startEffectTimer(), (current.refCleanup = ref(instanceToUse)); - } finally { - recordEffectDuration(); - } - else current.refCleanup = ref(instanceToUse); - else ref.current = instanceToUse; - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } -} -function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startEffectTimer(), refCleanup(); - } finally { - recordEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startEffectTimer(), ref(null); - } finally { - recordEffectDuration(current); } - else ref(null); - } catch (error$135) { - captureCommitPhaseError(current, nearestMountedAncestor, error$135); - } - else ref.current = null; -} -function commitProfilerUpdate( - finishedWork, - current, - commitStartTime, - effectDuration -) { - try { - var _finishedWork$memoize = finishedWork.memoizedProps, - id = _finishedWork$memoize.id, - onCommit = _finishedWork$memoize.onCommit, - onRender = _finishedWork$memoize.onRender; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - id, + didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ); + nextProps = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || nextProps) { + if (null === currentTreeHiddenStackCursor.current) { + resolvedProps = workInProgressRoot; + if ( + null !== resolvedProps && + ((nextProps = getBumpedLaneForHydration( + resolvedProps, + renderLanes + )), + 0 !== nextProps && nextProps !== Component$84.retryLane) + ) + throw ( + ((Component$84.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(resolvedProps, current, nextProps), + SelectiveHydrationException) + ); + renderDidSuspendDelayIfPossible(); + } + workInProgress = retryActivityComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + (workInProgress = mountActivityChildren( + workInProgress, + resolvedProps + )), + (workInProgress.flags |= 134221824); + } + else + (current = updateWorkInProgressOffscreenFiber(current.child, { + mode: resolvedProps.mode, + children: resolvedProps.children + })), + (current.ref = workInProgress.ref), + (workInProgress.child = current), + (current.return = workInProgress), + (workInProgress = current); + return workInProgress; + case 22: + return updateOffscreenComponent( current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - commitStartTime + workInProgress, + renderLanes, + workInProgress.pendingProps ); - "function" === typeof onCommit && - onCommit(id, current, effectDuration, commitStartTime); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + case 24: + return ( + prepareToReadContext(workInProgress), + (Component$84 = readContext(CacheContext)), + null === current + ? ((resolvedProps = peekCacheFromPool()), + null === resolvedProps && + ((resolvedProps = workInProgressRoot), + (nextProps = createCache()), + (resolvedProps.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && + (resolvedProps.pooledCacheLanes |= renderLanes), + (resolvedProps = nextProps)), + (workInProgress.memoizedState = { + parent: Component$84, + cache: resolvedProps + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, resolvedProps)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (resolvedProps = current.memoizedState), + (nextProps = workInProgress.memoizedState), + resolvedProps.parent !== Component$84 + ? ((resolvedProps = { + parent: Component$84, + cache: Component$84 + }), + (workInProgress.memoizedState = resolvedProps), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + resolvedProps), + pushProvider(workInProgress, CacheContext, Component$84)) + : ((Component$84 = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component$84), + Component$84 !== resolvedProps.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 30: + return ( + null === workInProgress.stateNode && + (workInProgress.stateNode = { + autoName: null, + paired: null, + clones: null, + ref: null + }), + (Component$84 = workInProgress.pendingProps), + null != Component$84.name && + "auto" !== Component$84.name && + (workInProgress.flags |= null === current ? 18882560 : 18874368), + null !== current && current.memoizedProps.name !== Component$84.name + ? (workInProgress.flags |= 4194816) + : markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + Component$84.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } -var viewTransitionMutationContext = !1; -function pushMutationContext() { - var prev = viewTransitionMutationContext; - viewTransitionMutationContext = !1; - return prev; +function doesRequireClone(current, completedWork) { + if (null !== current && current.child === completedWork.child) return !1; + if (0 !== (completedWork.flags & 16)) return !0; + for (current = completedWork.child; null !== current; ) { + if (0 !== (current.flags & 8218) || 0 !== (current.subtreeFlags & 8218)) + return !0; + current = current.sibling; + } + return !1; } -function commitFragmentInstanceInsertionEffects(fiber) { - for (var parent = fiber.return; null !== parent; ) { - isFragmentInstanceParent(parent) && - commitNewChildToFragmentInstance(fiber.stateNode, parent.stateNode); - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; +function appendAllChildren( + parent, + workInProgress, + needsVisibilityToggle, + isHidden +) { + for (var node = workInProgress.child; null !== node; ) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && + isHidden && + (instance = cloneHiddenInstance(instance)); + appendChildNode(parent.node, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) + throw Error("Not yet implemented."); + appendChildNode(parent.node, instance.node); + } else if (4 !== node.tag) + if (22 === node.tag && null !== node.memoizedState) + (instance = node.child), + null !== instance && (instance.return = node), + appendAllChildren(parent, node, !0, !0); + else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } } -function commitFragmentInstanceDeletionEffects(fiber) { - for (var parent = fiber.return; null !== parent; ) { - if (isFragmentInstanceParent(parent)) { - var fragmentInstance = parent.stateNode; - var childInstance = fiber.stateNode; - null != childInstance.canonical && - ((childInstance = getPublicInstance(childInstance)), - null != childInstance.reactFragments && - childInstance.reactFragments.delete(fragmentInstance)); +function appendAllChildrenToContainer( + containerChildSet, + workInProgress, + needsVisibilityToggle, + isHidden +) { + for ( + var hasOffscreenComponentChild = !1, node = workInProgress.child; + null !== node; + + ) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && + isHidden && + (instance = cloneHiddenInstance(instance)); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) + throw Error("Not yet implemented."); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (4 !== node.tag) + if (22 === node.tag && null !== node.memoizedState) + (hasOffscreenComponentChild = node.child), + null !== hasOffscreenComponentChild && + (hasOffscreenComponentChild.return = node), + appendAllChildrenToContainer(containerChildSet, node, !0, !0), + (hasOffscreenComponentChild = !0); + else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === workInProgress) + return hasOffscreenComponentChild; + node = node.return; } - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; + node.sibling.return = node.return; + node = node.sibling; } + return hasOffscreenComponentChild; } -function isFragmentInstanceHostBoundary(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || !1; +function updateHostContainer(current, workInProgress) { + if (doesRequireClone(current, workInProgress)) { + current = workInProgress.stateNode; + var newChildSet = createChildNodeSet(); + appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1); + current.pendingChildren = newChildSet; + workInProgress.flags |= 4; + } } -function isFragmentInstanceParent(fiber) { - return fiber && 7 === fiber.tag && null !== fiber.stateNode; +function scheduleRetryEffect(workInProgress, retryQueue) { + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } -function commitHostMount(finishedWork) { - try { - throw Error( - "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue." - ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); +function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "visible": + break; + case "collapsed": + for ( + var tailNode = renderState.tail, lastTailNode = null; + null !== tailNode; + + ) + null !== tailNode.alternate && (lastTailNode = tailNode), + (tailNode = tailNode.sibling); + null === lastTailNode + ? hasRenderedATailFallback || null === renderState.tail + ? (renderState.tail = null) + : (renderState.tail.sibling = null) + : (lastTailNode.sibling = null); + break; + default: + hasRenderedATailFallback = renderState.tail; + for (tailNode = null; null !== hasRenderedATailFallback; ) + null !== hasRenderedATailFallback.alternate && + (tailNode = hasRenderedATailFallback), + (hasRenderedATailFallback = hasRenderedATailFallback.sibling); + null === tailNode ? (renderState.tail = null) : (tailNode.sibling = null); } } -function commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances -) { - if (5 === finishedWork.tag) { - if ( - (5 === finishedWork.tag || - 27 === finishedWork.tag || - 6 === finishedWork.tag) && - null === finishedWork.alternate && - null !== parentFragmentInstances - ) - for (var i = 0; i < parentFragmentInstances.length; i++) - commitNewChildToFragmentInstance( - finishedWork.stateNode, - parentFragmentInstances[i] - ); - } else if ( - 4 !== finishedWork.tag && - ((finishedWork = finishedWork.child), null !== finishedWork) - ) +function bubbleProperties(completedWork) { + var didBailout = + null !== completedWork.alternate && + completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) + if (0 !== (completedWork.mode & 2)) { + for ( + var treeBaseDuration$90 = completedWork.selfBaseDuration, + child$91 = completedWork.child; + null !== child$91; + + ) + (newChildLanes |= child$91.lanes | child$91.childLanes), + (subtreeFlags |= child$91.subtreeFlags & 1206910976), + (subtreeFlags |= child$91.flags & 1206910976), + (treeBaseDuration$90 += child$91.treeBaseDuration), + (child$91 = child$91.sibling); + completedWork.treeBaseDuration = treeBaseDuration$90; + } else + for ( + treeBaseDuration$90 = completedWork.child; + null !== treeBaseDuration$90; + + ) + (newChildLanes |= + treeBaseDuration$90.lanes | treeBaseDuration$90.childLanes), + (subtreeFlags |= treeBaseDuration$90.subtreeFlags & 1206910976), + (subtreeFlags |= treeBaseDuration$90.flags & 1206910976), + (treeBaseDuration$90.return = completedWork), + (treeBaseDuration$90 = treeBaseDuration$90.sibling); + else if (0 !== (completedWork.mode & 2)) { + treeBaseDuration$90 = completedWork.actualDuration; + child$91 = completedWork.selfBaseDuration; + for (var child = completedWork.child; null !== child; ) + (newChildLanes |= child.lanes | child.childLanes), + (subtreeFlags |= child.subtreeFlags), + (subtreeFlags |= child.flags), + (treeBaseDuration$90 += child.actualDuration), + (child$91 += child.treeBaseDuration), + (child = child.sibling); + completedWork.actualDuration = treeBaseDuration$90; + completedWork.treeBaseDuration = child$91; + } else for ( - commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances - ), - finishedWork = finishedWork.sibling; - null !== finishedWork; + treeBaseDuration$90 = completedWork.child; + null !== treeBaseDuration$90; ) - commitImmutablePlacementNodeToFragmentInstances( - finishedWork, - parentFragmentInstances - ), - (finishedWork = finishedWork.sibling); -} -function commitHostPortalContainerChildren( - portal, - finishedWork, - pendingChildren -) { - portal = portal.containerInfo; - try { - completeRoot(portal.containerTag, pendingChildren); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -var shouldStartViewTransition = !1, - appearingViewTransitions = null; -function trackEnterViewTransitions(placement) { - if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432)) - shouldStartViewTransition = !0; -} -var viewTransitionCancelableChildren = null; -function pushViewTransitionCancelableScope() { - var prevChildren = viewTransitionCancelableChildren; - viewTransitionCancelableChildren = null; - return prevChildren; -} -var viewTransitionHostInstanceIdx = 0; -function applyViewTransitionToHostInstances() { - viewTransitionHostInstanceIdx = 0; - return !1; + (newChildLanes |= + treeBaseDuration$90.lanes | treeBaseDuration$90.childLanes), + (subtreeFlags |= treeBaseDuration$90.subtreeFlags), + (subtreeFlags |= treeBaseDuration$90.flags), + (treeBaseDuration$90.return = completedWork), + (treeBaseDuration$90 = treeBaseDuration$90.sibling); + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; } -function commitAppearingPairViewTransitions(placement) { - if (0 !== (placement.subtreeFlags & 18874368)) - for (placement = placement.child; null !== placement; ) { - if (22 !== placement.tag || null === placement.memoizedState) +function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + switch (workInProgress.tag) { + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; + case 1: + return bubbleProperties(workInProgress), null; + case 3: + return ( + (renderLanes = workInProgress.stateNode), + (newProps = null), + null !== current && (newProps = current.memoizedState.cache), + workInProgress.memoizedState.cache !== newProps && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + popHostContainer(), + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)), + (null !== current && null !== current.child) || + null === current || + (current.memoizedState.isDehydrated && + 0 === (workInProgress.flags & 256)) || + ((workInProgress.flags |= 1024), + upgradeHydrationErrorsToRecoverable()), + updateHostContainer(current, workInProgress), + bubbleProperties(workInProgress), + null + ); + case 26: + case 27: + case 5: + popHostContext(workInProgress); + var type = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) if ( - (commitAppearingPairViewTransitions(placement), - 30 === placement.tag && - 0 !== (placement.flags & 18874368) && - placement.stateNode.paired) + ((renderLanes = current.stateNode), + (type = current.memoizedProps), + (current = doesRequireClone(current, workInProgress)) || + type !== newProps) ) { - var props = placement.memoizedProps; - if (null == props.name || "auto" === props.name) + b: { + type = reactPrivateInterface.diffAttributePayloads( + type, + newProps, + renderLanes.canonical.viewConfig.validAttributes + ); + renderLanes.canonical.currentProps = newProps; + newProps = renderLanes.node; + if (current) + newProps = + null !== type + ? cloneNodeWithNewChildrenAndProps(newProps, type) + : cloneNodeWithNewChildren(newProps); + else if (null !== type) + newProps = cloneNodeWithNewProps(newProps, type); + else { + newProps = renderLanes; + break b; + } + newProps = { node: newProps, canonical: renderLanes.canonical }; + } + newProps === renderLanes + ? (workInProgress.stateNode = renderLanes) + : ((workInProgress.flags |= 8), + (workInProgress.stateNode = newProps), + current && appendAllChildren(newProps, workInProgress, !1, !1)); + } else workInProgress.stateNode = renderLanes; + else { + if (!newProps) { + if (null === workInProgress.stateNode) + throw Error( + "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." + ); + bubbleProperties(workInProgress); + workInProgress.subtreeFlags &= -33554433; + return null; + } + current = rootInstanceStackCursor.current; + renderLanes = allocateTag(); + type = getViewConfigForType(type); + var updatePayload = reactPrivateInterface.createAttributePayload( + newProps, + type.validAttributes + ); + current = { + node: createNode( + renderLanes, + type.uiViewClassName, + current.containerTag, + updatePayload, + workInProgress + ), + canonical: { + nativeTag: renderLanes, + viewConfig: type, + currentProps: newProps, + internalInstanceHandle: workInProgress, + publicInstance: null, + publicRootInstance: current.publicInstance + } + }; + workInProgress.flags |= 8; + appendAllChildren(current, workInProgress, !1, !1); + workInProgress.stateNode = current; + } + bubbleProperties(workInProgress); + workInProgress.subtreeFlags &= -33554433; + workInProgress.flags &= -16777217; + return null; + case 6: + if (current && null != workInProgress.stateNode) + current.memoizedProps !== newProps + ? ((current = rootInstanceStackCursor.current), + (renderLanes = contextStackCursor.current), + (workInProgress.flags |= 8), + (workInProgress.stateNode = createTextInstance( + newProps, + current, + renderLanes, + workInProgress + ))) + : (workInProgress.stateNode = current.stateNode); + else { + if ("string" !== typeof newProps && null === workInProgress.stateNode) + throw Error( + "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." + ); + current = rootInstanceStackCursor.current; + renderLanes = contextStackCursor.current; + workInProgress.flags |= 8; + workInProgress.stateNode = createTextInstance( + newProps, + current, + renderLanes, + workInProgress + ); + } + bubbleProperties(workInProgress); + return null; + case 31: + renderLanes = workInProgress.memoizedState; + if (null === current || null !== current.memoizedState) { + if (null !== renderLanes) { + if (null === current) { + throw Error( + "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." + ); + throw Error( + "Expected prepareToHydrateHostActivityInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." + ); + } + 0 === (workInProgress.flags & 128) && + (renderLanes = workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + null !== renderLanes && + ((current = workInProgress.child), + null !== current && + (workInProgress.treeBaseDuration -= current.treeBaseDuration)); + current = !1; + } else + (renderLanes = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = renderLanes), + (current = !0); + if (!current) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; + } + if (0 !== (workInProgress.flags & 128)) + throw Error( + "Client rendering an Activity suspended it again. This is a bug in React." + ); + } + bubbleProperties(workInProgress); + return null; + case 13: + newProps = workInProgress.memoizedState; + if ( + null === current || + (null !== current.memoizedState && + null !== current.memoizedState.dehydrated) + ) { + type = newProps; + if (null !== type && null !== type.dehydrated) { + if (null === current) { throw Error( - "Found a pair with an auto name. This is a bug in React." + "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." ); - "none" !== getViewTransitionClassName(props.default, props.share) && - applyViewTransitionToHostInstances(); + throw Error( + "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." + ); + } + 0 === (workInProgress.flags & 128) && + (type = workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + null !== type && + ((type = workInProgress.child), + null !== type && + (workInProgress.treeBaseDuration -= type.treeBaseDuration)); + type = !1; + } else + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), + (type = !0); + if (!type) { + if (workInProgress.flags & 256) + return popSuspenseHandler(workInProgress), workInProgress; + popSuspenseHandler(workInProgress); + return null; } - placement = placement.sibling; - } -} -function commitEnterViewTransitions(placement, gesture) { - if (30 === placement.tag) { - var state = placement.stateNode, - props = placement.memoizedProps; - getViewTransitionName(props, state); - "none" !== - getViewTransitionClassName( - props.default, - state.paired ? props.share : props.enter - ) - ? applyViewTransitionToHostInstances() && - (commitAppearingPairViewTransitions(placement), - state.paired || - gesture || - scheduleViewTransitionEvent(placement, props.onEnter)) - : commitAppearingPairViewTransitions(placement); - } else if (0 !== (placement.subtreeFlags & 33554432)) - for (placement = placement.child; null !== placement; ) - commitEnterViewTransitions(placement, gesture), - (placement = placement.sibling); - else commitAppearingPairViewTransitions(placement); -} -function commitDeletedPairViewTransitions(deletion) { - if ( - null !== appearingViewTransitions && - 0 !== appearingViewTransitions.size - ) { - var pairs = appearingViewTransitions; - if (0 !== (deletion.subtreeFlags & 18874368)) - for (deletion = deletion.child; null !== deletion; ) { - if (22 !== deletion.tag || null === deletion.memoizedState) { - if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) { - var props = deletion.memoizedProps, - name = props.name; - if (null != name && "auto" !== name) { - var pair = pairs.get(name); - if (void 0 !== pair) { - if ( - "none" !== - getViewTransitionClassName(props.default, props.share) && - applyViewTransitionToHostInstances() - ) { - var oldInstance = deletion.stateNode; - pair.paired = oldInstance; - oldInstance.paired = pair; - scheduleViewTransitionEvent(deletion, props.onShare); - } - pairs.delete(name); - if (0 === pairs.size) break; + } + popSuspenseHandler(workInProgress); + if (0 !== (workInProgress.flags & 128)) + return ( + (workInProgress.lanes = renderLanes), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress + ); + renderLanes = null !== newProps; + current = null !== current && null !== current.memoizedState; + renderLanes && + ((newProps = workInProgress.child), + (type = null), + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (type = newProps.alternate.memoizedState.cachePool.pool), + (updatePayload = null), + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (updatePayload = newProps.memoizedState.cachePool.pool), + updatePayload !== type && (newProps.flags |= 2048)); + renderLanes !== current && + renderLanes && + (workInProgress.child.flags |= 8192); + scheduleRetryEffect(workInProgress, workInProgress.updateQueue); + bubbleProperties(workInProgress); + 0 !== (workInProgress.mode & 2) && + renderLanes && + ((current = workInProgress.child), + null !== current && + (workInProgress.treeBaseDuration -= current.treeBaseDuration)); + return null; + case 4: + return ( + popHostContainer(), + updateHostContainer(current, workInProgress), + (workInProgress.flags |= 67108864), + bubbleProperties(workInProgress), + null + ); + case 10: + return ( + popProvider(workInProgress.type), bubbleProperties(workInProgress), null + ); + case 19: + popSuspenseListContext(workInProgress); + newProps = workInProgress.memoizedState; + if (null === newProps) return bubbleProperties(workInProgress), null; + type = 0 !== (workInProgress.flags & 128); + updatePayload = newProps.rendering; + if (null === updatePayload) + if (type) cutOffTailIfNeeded(newProps, !1); + else { + if ( + 0 !== workInProgressRootExitStatus || + (null !== current && 0 !== (current.flags & 128)) + ) + for (current = workInProgress.child; null !== current; ) { + updatePayload = findFirstSuspended(current); + if (null !== updatePayload) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(newProps, !1); + current = updatePayload.updateQueue; + workInProgress.updateQueue = current; + scheduleRetryEffect(workInProgress, current); + workInProgress.subtreeFlags = 0; + current = renderLanes; + for (renderLanes = workInProgress.child; null !== renderLanes; ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); + pushSuspenseListContext( + workInProgress, + (suspenseStackCursor.current & 1) | 2 + ); + return workInProgress.child; } + current = current.sibling; + } + null !== newProps.tail && + now$1() > workInProgressRootRenderTargetTime && + ((workInProgress.flags |= 128), + (type = !0), + cutOffTailIfNeeded(newProps, !1), + (workInProgress.lanes = 4194304)); + } + else { + if (!type) + if ( + ((current = findFirstSuspended(updatePayload)), null !== current) + ) { + if ( + ((workInProgress.flags |= 128), + (type = !0), + (current = current.updateQueue), + (workInProgress.updateQueue = current), + scheduleRetryEffect(workInProgress, current), + cutOffTailIfNeeded(newProps, !0), + null === newProps.tail && + "collapsed" !== newProps.tailMode && + "visible" !== newProps.tailMode && + !updatePayload.alternate) + ) + return bubbleProperties(workInProgress), null; + } else + 2 * now$1() - newProps.renderingStartTime > + workInProgressRootRenderTargetTime && + 536870912 !== renderLanes && + ((workInProgress.flags |= 128), + (type = !0), + cutOffTailIfNeeded(newProps, !1), + (workInProgress.lanes = 4194304)); + newProps.isBackwards + ? ((updatePayload.sibling = workInProgress.child), + (workInProgress.child = updatePayload)) + : ((current = newProps.last), + null !== current + ? (current.sibling = updatePayload) + : (workInProgress.child = updatePayload), + (newProps.last = updatePayload)); + } + if (null !== newProps.tail) { + current = newProps.tail; + a: { + for (renderLanes = current; null !== renderLanes; ) { + if (null !== renderLanes.alternate) { + renderLanes = !1; + break a; } + renderLanes = renderLanes.sibling; } - commitDeletedPairViewTransitions(deletion); + renderLanes = !0; } - deletion = deletion.sibling; + newProps.rendering = current; + newProps.tail = current.sibling; + newProps.renderingStartTime = now$1(); + current.sibling = null; + updatePayload = suspenseStackCursor.current; + updatePayload = type ? (updatePayload & 1) | 2 : updatePayload & 1; + "visible" !== newProps.tailMode && + "collapsed" !== newProps.tailMode && + renderLanes + ? ((renderLanes = updatePayload), + push(suspenseHandlerStackCursor, workInProgress), + push(suspenseStackCursor, renderLanes), + null === shellBoundary && (shellBoundary = workInProgress)) + : pushSuspenseListContext(workInProgress, updatePayload); + return current; } + bubbleProperties(workInProgress); + return null; + case 22: + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(), + (newProps = null !== workInProgress.memoizedState), + null !== current + ? (null !== current.memoizedState) !== newProps && + (workInProgress.flags |= 8192) + : newProps && (workInProgress.flags |= 8192), + newProps + ? 0 !== (renderLanes & 536870912) && + 0 === (workInProgress.flags & 128) && + (bubbleProperties(workInProgress), + workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) + : bubbleProperties(workInProgress), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), + null !== workInProgress.memoizedState && + null !== workInProgress.memoizedState.cachePool && + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), + null !== current && pop(resumedCache), + null + ); + case 24: + return ( + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && + (workInProgress.flags |= 2048), + popProvider(CacheContext), + bubbleProperties(workInProgress), + null + ); + case 25: + return null; + case 30: + return ( + (workInProgress.flags |= 33554432), + bubbleProperties(workInProgress), + null + ); } + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } -function commitExitViewTransitions(deletion) { - if (30 === deletion.tag) { - var props = deletion.memoizedProps, - name = getViewTransitionName(props, deletion.stateNode), - pair = - null !== appearingViewTransitions - ? appearingViewTransitions.get(name) - : void 0; - if ( - "none" !== - getViewTransitionClassName( - props.default, - void 0 !== pair ? props.share : props.exit - ) && - applyViewTransitionToHostInstances() - ) - if (void 0 !== pair) { - var oldInstance = deletion.stateNode; - pair.paired = oldInstance; - oldInstance.paired = pair; - appearingViewTransitions.delete(name); - scheduleViewTransitionEvent(deletion, props.onShare); - } else scheduleViewTransitionEvent(deletion, props.onExit); - null !== appearingViewTransitions && - commitDeletedPairViewTransitions(deletion); - } else if (0 !== (deletion.subtreeFlags & 33554432)) - for (deletion = deletion.child; null !== deletion; ) - commitExitViewTransitions(deletion), (deletion = deletion.sibling); - else - null !== appearingViewTransitions && - commitDeletedPairViewTransitions(deletion); -} -function commitNestedViewTransitions(changedParent) { - for (changedParent = changedParent.child; null !== changedParent; ) { - if (30 === changedParent.tag) { - var props = changedParent.memoizedProps, - name = getViewTransitionName(props, changedParent.stateNode); - props = getViewTransitionClassName(props.default, props.update); - changedParent.flags &= -5; - "none" !== props && - applyViewTransitionToHostInstances( - changedParent, - name, - props, - (changedParent.memoizedState = []) +function unwindWork(current, workInProgress) { + switch (workInProgress.tag) { + case 1: + return ( + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null + ); + case 3: + return ( + popProvider(CacheContext), + popHostContainer(), + (current = workInProgress.flags), + 0 !== (current & 65536) && 0 === (current & 128) + ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) + : null + ); + case 26: + case 27: + case 5: + return popHostContext(workInProgress), null; + case 31: + if ( + null !== workInProgress.memoizedState && + (popSuspenseHandler(workInProgress), null === workInProgress.alternate) + ) + throw Error( + "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." ); - } else - 0 !== (changedParent.subtreeFlags & 33554432) && - commitNestedViewTransitions(changedParent); - changedParent = changedParent.sibling; + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null; + case 13: + popSuspenseHandler(workInProgress); + current = workInProgress.memoizedState; + if ( + null !== current && + null !== current.dehydrated && + null === workInProgress.alternate + ) + throw Error( + "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue." + ); + current = workInProgress.flags; + return current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null; + case 19: + return ( + popSuspenseListContext(workInProgress), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + (current = workInProgress.memoizedState), + null !== current && + ((current.rendering = null), (current.tail = null)), + (workInProgress.flags |= 4), + workInProgress) + : null + ); + case 4: + return popHostContainer(), null; + case 10: + return popProvider(workInProgress.type), null; + case 22: + case 23: + return ( + popSuspenseHandler(workInProgress), + popHiddenContext(), + null !== current && pop(resumedCache), + (current = workInProgress.flags), + current & 65536 + ? ((workInProgress.flags = (current & -65537) | 128), + 0 !== (workInProgress.mode & 2) && + transferActualDuration(workInProgress), + workInProgress) + : null + ); + case 24: + return popProvider(CacheContext), null; + case 25: + return null; + default: + return null; } } -function restorePairedViewTransitions(parent) { - if (0 !== (parent.subtreeFlags & 18874368)) - for (parent = parent.child; null !== parent; ) { - if (22 !== parent.tag || null === parent.memoizedState) { - if (30 === parent.tag && 0 !== (parent.flags & 18874368)) { - var instance = parent.stateNode; - null !== instance.paired && (instance.paired = null); - } - restorePairedViewTransitions(parent); - } - parent = parent.sibling; - } -} -function restoreEnterOrExitViewTransitions(fiber) { - if (30 === fiber.tag) - (fiber.stateNode.paired = null), restorePairedViewTransitions(fiber); - else if (0 !== (fiber.subtreeFlags & 33554432)) - for (fiber = fiber.child; null !== fiber; ) - restoreEnterOrExitViewTransitions(fiber), (fiber = fiber.sibling); - else restorePairedViewTransitions(fiber); -} -function measureNestedViewTransitions(changedParent, gesture) { - for (changedParent = changedParent.child; null !== changedParent; ) { - if (30 === changedParent.tag) { - var props = changedParent.memoizedProps, - state = changedParent.stateNode; - getViewTransitionName(props, state); - getViewTransitionClassName(props.default, props.update); - gesture - ? ((props = state.clones), - null !== props && props.map(measureClonedInstance)) - : (changedParent.memoizedState = null); - viewTransitionHostInstanceIdx = 0; - } else - 0 !== (changedParent.subtreeFlags & 33554432) && - measureNestedViewTransitions(changedParent, gesture); - changedParent = changedParent.sibling; +function unwindInterruptedWork(current, interruptedWork) { + switch (interruptedWork.tag) { + case 3: + popProvider(CacheContext); + popHostContainer(); + break; + case 26: + case 27: + case 5: + popHostContext(interruptedWork); + break; + case 4: + popHostContainer(); + break; + case 31: + null !== interruptedWork.memoizedState && + popSuspenseHandler(interruptedWork); + break; + case 13: + popSuspenseHandler(interruptedWork); + break; + case 19: + popSuspenseListContext(interruptedWork); + break; + case 10: + popProvider(interruptedWork.type); + break; + case 22: + case 23: + popSuspenseHandler(interruptedWork); + popHiddenContext(); + null !== current && pop(resumedCache); + break; + case 24: + popProvider(CacheContext); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null, - viewTransitionContextChanged = !1; -function isHydratingParent(current, finishedWork) { - return 31 === finishedWork.tag - ? ((finishedWork = finishedWork.memoizedState), - null !== current.memoizedState && null === finishedWork) - : 13 === finishedWork.tag - ? ((current = current.memoizedState), - (finishedWork = finishedWork.memoizedState), - null !== current && - null !== current.dehydrated && - (null === finishedWork || null === finishedWork.dehydrated)) - : 3 === finishedWork.tag - ? current.memoizedState.isDehydrated && 0 === (finishedWork.flags & 256) - : !1; +function shouldProfile(current) { + return 0 !== (current.mode & 2); } -function commitBeforeMutationEffects(root, firstChild, committedLanes) { - root = (committedLanes & 335544064) === committedLanes; - nextEffect = firstChild; - for (firstChild = root ? 9270 : 1024; null !== nextEffect; ) { - committedLanes = nextEffect; - if (root) { - var deletions = committedLanes.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) - root && commitExitViewTransitions(deletions[i]); - } - if (null === committedLanes.alternate && 0 !== (committedLanes.flags & 2)) - root && trackEnterViewTransitions(committedLanes), - commitBeforeMutationEffects_complete(root); - else { - if (22 === committedLanes.tag && 0 !== (committedLanes.mode & 1)) - if ( - ((deletions = committedLanes.alternate), - null !== committedLanes.memoizedState) - ) { - null !== deletions && - null === deletions.memoizedState && - root && - commitExitViewTransitions(deletions); - commitBeforeMutationEffects_complete(root); - continue; - } else if (null !== deletions && null !== deletions.memoizedState) { - root && trackEnterViewTransitions(committedLanes); - commitBeforeMutationEffects_complete(root); - continue; - } - deletions = committedLanes.child; - 0 !== (committedLanes.subtreeFlags & firstChild) && null !== deletions - ? ((deletions.return = committedLanes), (nextEffect = deletions)) - : (root && commitNestedViewTransitions(committedLanes), - commitBeforeMutationEffects_complete(root)); - } - } - appearingViewTransitions = null; +function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); } -function commitBeforeMutationEffects_complete( - isViewTransitionEligible$jscomp$0 +function commitHookLayoutUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags ) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - isViewTransitionEligible = isViewTransitionEligible$jscomp$0, - current = fiber.alternate, - flags = fiber.flags; - switch (fiber.tag) { - case 1: - if (0 !== (flags & 1024) && null !== current) { - isViewTransitionEligible = void 0; - flags = current.memoizedProps; - current = current.memoizedState; - var instance = fiber.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - fiber.type, - flags - ); - isViewTransitionEligible = instance.getSnapshotBeforeUpdate( - resolvedPrevProps, - current - ); - instance.__reactInternalSnapshotBeforeUpdate = - isViewTransitionEligible; - } catch (error) { - captureCommitPhaseError(fiber, fiber.return, error); - } + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); +} +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; } - break; - case 3: - break; - case 0: - case 11: - case 15: - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - case 30: - isViewTransitionEligible && - null !== current && - ((isViewTransitionEligible = getViewTransitionName( - current.memoizedProps, - current.stateNode - )), - (flags = fiber.memoizedProps), - (flags = getViewTransitionClassName(flags.default, flags.update)), - "none" !== flags && - applyViewTransitionToHostInstances( - current, - isViewTransitionEligible, - flags, - (current.memoizedState = []) - )); - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - current = fiber.sibling; - if (null !== current) { - current.return = fiber.return; - nextEffect = current; - break; + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - nextEffect = fiber.return; - } -} -function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); - break; - case 1: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 4) - if (((finishedRoot = finishedWork.stateNode), null === current)) - if (shouldProfile(finishedWork)) { - startEffectTimer(); - try { - finishedRoot.componentDidMount(); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordEffectDuration(); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$130) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$130 - ); - } - else { - var prevProps = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps - ); - current = current.memoizedState; - if (shouldProfile(finishedWork)) { - startEffectTimer(); - try { - finishedRoot.componentDidUpdate( - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$131) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$131 - ); - } - recordEffectDuration(); - } else + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor$jscomp$0 +) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + if (void 0 !== destroy) { + inst.destroy = void 0; + lastEffect = finishedWork; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + destroy_ = destroy; try { - finishedRoot.componentDidUpdate( - prevProps, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$132) { + destroy_(); + } catch (error) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$132 + lastEffect, + nearestMountedAncestor, + error ); } - } - flags & 64 && commitClassCallbacks(finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 3: - current = pushNestedEffectDurations(); - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { - prevProps = null; - if (null !== finishedWork.child) - switch (finishedWork.child.tag) { - case 27: - case 5: - prevProps = getPublicInstance(finishedWork.child.stateNode); - break; - case 1: - prevProps = finishedWork.child.stateNode; - } - try { - commitCallbacks(flags, prevProps); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - finishedRoot.effectDuration += popNestedEffectDurations(current); - break; - case 27: - case 26: - case 5: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - if (null === current) - if (flags & 4) commitHostMount(finishedWork); - else if (flags & 64) { - finishedRoot = finishedWork.type; - current = finishedWork.memoizedProps; - prevProps = finishedWork.stateNode; - try { - shim$1(prevProps, finishedRoot, current, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); } } - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - flags & 4 - ? ((flags = pushNestedEffectDurations()), - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork), - (finishedRoot = finishedWork.stateNode), - (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), - commitProfilerUpdate( - finishedWork, - current, - commitStartTime, - finishedRoot.effectDuration - )) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 31: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 13: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 64 && - ((finishedRoot = finishedWork.memoizedState), - null !== finishedRoot && - null !== finishedRoot.dehydrated && - (retryDehydratedSuspenseBoundary.bind(null, finishedWork), shim$1())); - break; - case 22: - if (0 !== (finishedWork.mode & 1)) { - if ( - ((flags = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !flags) - ) { - var newOffscreenSubtreeWasHidden = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - current = offscreenSubtreeIsHidden; - prevProps = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = flags; - (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && - !prevProps - ? ((flags = 0), - 0 !== (finishedWork.subtreeFlags & 8772) && (flags |= 1), - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - flags - ), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - )) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = current; - offscreenSubtreeWasHidden = prevProps; - } - } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - break; - case 30: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - break; - case 7: - flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( +} +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags +) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors + nearestMountedAncestor ), - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - 0.05 < componentEffectEndTime - componentEffectStartTime && - (isHydratingParent(finishedWork.return.alternate, finishedWork.return) || - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Mount" - ))); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } +} +function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance +) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + if (shouldProfile(current)) { + startEffectTimer(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + recordEffectDuration(); + } else + try { + instance.componentWillUnmount(); + } catch (error$125) { + captureCommitPhaseError(current, nearestMountedAncestor, error$125); + } +} +function safelyAttachRef(current, nearestMountedAncestor) { + try { + var ref = current.ref; + if (null !== ref) { + switch (current.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(current.stateNode); + break; + case 30: + var instance = current.stateNode, + name = getViewTransitionName(current.memoizedProps, instance); + if (null === instance.ref || instance.ref.name !== name) + instance.ref = createViewTransitionInstance(name); + instanceToUse = instance.ref; + break; + case 7: + if (null === current.stateNode) { + var fragmentInstance = new FragmentInstance(current); + traverseVisibleInstancesAndTextInstances( + current.child, + !1, + addFragmentHandleToFiber, + fragmentInstance, + void 0, + void 0 + ); + current.stateNode = fragmentInstance; + } + instanceToUse = current.stateNode; + break; + default: + instanceToUse = current.stateNode; + } + if ("function" === typeof ref) + if (shouldProfile(current)) + try { + startEffectTimer(), (current.refCleanup = ref(instanceToUse)); + } finally { + recordEffectDuration(); + } + else current.refCleanup = ref(instanceToUse); + else ref.current = instanceToUse; + } + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } } -function recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - parent -) { - for (parent = parent.child; null !== parent; ) - commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), - (parent = parent.sibling); +function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), refCleanup(); + } finally { + recordEffectDuration(current); + } + else refCleanup(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), ref(null); + } finally { + recordEffectDuration(current); + } + else ref(null); + } catch (error$127) { + captureCommitPhaseError(current, nearestMountedAncestor, error$127); + } + else ref.current = null; } -function commitDeletionEffectsOnFiber( - finishedRoot, - nearestMountedAncestor, - deletedFiber +function commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + effectDuration ) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) - try { - injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); - } catch (err) {} - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (deletedFiber.tag) { - case 26: - case 27: - case 5: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor), - commitFragmentInstanceDeletionEffects(deletedFiber); - case 6: - 6 === deletedFiber.tag && - commitFragmentInstanceDeletionEffects(deletedFiber); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 18: - break; - case 4: - commitHostPortalContainerChildren( - deletedFiber.stateNode, - deletedFiber, - createChildNodeSet() - ); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 0: - case 11: - case 14: - case 15: - commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden || - commitHookLayoutUnmountEffects(deletedFiber, nearestMountedAncestor, 4); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 1: - if (!offscreenSubtreeWasHidden) { - safelyDetachRef(deletedFiber, nearestMountedAncestor); - var instance = deletedFiber.stateNode; - "function" === typeof instance.componentWillUnmount && - safelyCallComponentWillUnmount( - deletedFiber, - nearestMountedAncestor, - instance - ); - } - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 21: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 22: - deletedFiber.mode & 1 - ? ((offscreenSubtreeWasHidden = - (instance = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState), - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ), - (offscreenSubtreeWasHidden = instance)) - : recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 30: - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - case 7: - offscreenSubtreeWasHidden || - safelyDetachRef(deletedFiber, nearestMountedAncestor); - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - break; - default: - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber + try { + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime ); + "function" === typeof onCommit && + onCommit(id, current, effectDuration, commitStartTime); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - 0 !== (deletedFiber.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - deletedFiber, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } -function getRetryCache(finishedWork) { - switch (finishedWork.tag) { - case 31: - case 13: - case 19: - var retryCache = finishedWork.stateNode; - null === retryCache && - (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); - return retryCache; - case 22: - return ( - (finishedWork = finishedWork.stateNode), - (retryCache = finishedWork._retryCache), - null === retryCache && - (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), - retryCache - ); - default: - throw Error( - "Unexpected Suspense handler tag (" + - finishedWork.tag + - "). This is a bug in React." - ); +var viewTransitionMutationContext = !1; +function pushMutationContext() { + var prev = viewTransitionMutationContext; + viewTransitionMutationContext = !1; + return prev; +} +function commitFragmentInstanceInsertionEffects(fiber) { + for (var parent = fiber.return; null !== parent; ) { + isFragmentInstanceParent(parent) && + commitNewChildToFragmentInstance(fiber.stateNode, parent.stateNode); + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; } } -function attachSuspenseRetryListeners(finishedWork, wakeables) { - var retryCache = getRetryCache(finishedWork); - wakeables.forEach(function (wakeable) { - if (!retryCache.has(wakeable)) { - retryCache.add(wakeable); - if (isDevToolsPresent) - if (null !== inProgressLanes && null !== inProgressRoot) - restorePendingUpdaters(inProgressRoot, inProgressLanes); - else - throw Error( - "Expected finished root and lanes to be set. This is a bug in React." - ); - var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); - wakeable.then(retry, retry); +function commitFragmentInstanceDeletionEffects(fiber) { + for (var parent = fiber.return; null !== parent; ) { + if (isFragmentInstanceParent(parent)) { + var fragmentInstance = parent.stateNode; + var childInstance = fiber.stateNode; + null != childInstance.canonical && + ((childInstance = getPublicInstance(childInstance)), + null != childInstance.reactFragments && + childInstance.reactFragments.delete(fragmentInstance)); } - }); + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; + } } -function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber, lanes) { - var deletions = parentFiber.deletions; - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i], - root = root$jscomp$0, - returnFiber = parentFiber, - prevEffectStart = pushComponentEffectStart(); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - 0 !== (childToDelete.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - childToDelete, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" - ); - popComponentEffectStart(prevEffectStart); - root = childToDelete.alternate; - null !== root && (root.return = null); - childToDelete.return = null; - } - if (parentFiber.subtreeFlags & 13886) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitMutationEffectsOnFiber(parentFiber, root$jscomp$0, lanes), - (parentFiber = parentFiber.sibling); +function isFragmentInstanceHostBoundary(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || !1; } -function commitMutationEffectsOnFiber(finishedWork, root, lanes) { - var prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - if ( - flags & 4 && - ((current = finishedWork.updateQueue), - (current = null !== current ? current.events : null), - null !== current) - ) - for (var ii = 0; ii < current.length; ii++) { - var _eventPayloads$ii = current[ii]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork), - commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 5)); - break; - case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - flags & 64 && - offscreenSubtreeIsHidden && - ((root = finishedWork.updateQueue), - null !== root && - ((flags = root.callbacks), - null !== flags && - ((lanes = root.shared.hiddenCallbacks), - (root.shared.hiddenCallbacks = - null === lanes ? flags : lanes.concat(flags))))); - break; - case 26: - case 27: - case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - null !== finishedWork.alternate && - (finishedWork.alternate.stateNode = finishedWork.stateNode); - break; - case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - break; - case 3: - current = pushNestedEffectDurations(); - viewTransitionMutationContext = !1; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - flags = root.containerInfo; - lanes = root.pendingChildren; - try { - completeRoot(flags.containerTag, lanes), - (viewTransitionMutationContext = !0); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - root.effectDuration += popNestedEffectDurations(current); - viewTransitionMutationContext = !1; - break; - case 4: - current = pushMutationContext(); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - viewTransitionMutationContext = current; - flags & 4 && - commitHostPortalContainerChildren( - finishedWork.stateNode, - finishedWork, - finishedWork.stateNode.pendingChildren - ); - break; - case 12: - flags = pushNestedEffectDurations(); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - finishedWork.stateNode.effectDuration += - bubbleNestedEffectDurations(flags); - break; - case 31: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; - case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((root = null !== current && null !== current.memoizedState), - null === finishedWork.memoizedState || - root || - (globalMostRecentFallbackTime = now$1())); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; - case 22: - ii = null !== finishedWork.memoizedState; - _eventPayloads$ii = null !== current && null !== current.memoizedState; - if (finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; - offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || _eventPayloads$ii; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - _eventPayloads$ii && - !ii && - !prevOffscreenSubtreeIsHidden && - !prevOffscreenSubtreeWasHidden && - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - ); - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 8192 && - ((root = finishedWork.stateNode), - (root._visibility = ii ? root._visibility & -2 : root._visibility | 1), - !ii || - null === current || - _eventPayloads$ii || - offscreenSubtreeIsHidden || - offscreenSubtreeWasHidden || - 0 === (finishedWork.mode & 1) || - ((root = _eventPayloads$ii || offscreenSubtreeWasHidden), - (lanes = offscreenSubtreeIsHidden), - (current = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = ii || offscreenSubtreeIsHidden), - (offscreenSubtreeWasHidden = root), - recursivelyTraverseDisappearLayoutEffects(finishedWork), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Disconnect" - ), - (offscreenSubtreeIsHidden = lanes), - (offscreenSubtreeWasHidden = current))); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((flags = root.retryQueue), - null !== flags && - ((root.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, flags)))); - break; - case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 4 && - ((root = finishedWork.updateQueue), - null !== root && - ((finishedWork.updateQueue = null), - attachSuspenseRetryListeners(finishedWork, root))); - break; - case 30: - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)); - flags = pushMutationContext(); - ii = (lanes & 335544064) === lanes; - _eventPayloads$ii = finishedWork.memoizedProps; - ii && - "none" !== - getViewTransitionClassName( - _eventPayloads$ii.default, - _eventPayloads$ii.update - ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - ii && - null !== current && - viewTransitionMutationContext && - (finishedWork.flags |= 4); - viewTransitionMutationContext = flags; - break; - case 21: - break; - case 7: - flags & 512 && - (offscreenSubtreeWasHidden || - null === current || - safelyDetachRef(current, current.return)), - current && - null !== current.stateNode && - (current.stateNode._fragmentFiber = finishedWork); - default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - commitReconciliationEffects(finishedWork); +function isFragmentInstanceParent(fiber) { + return fiber && 7 === fiber.tag && null !== fiber.stateNode; +} +function commitHostMount(finishedWork) { + try { + throw Error( + "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue." + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( +} +function commitImmutablePlacementNodeToFragmentInstances( + finishedWork, + parentFragmentInstances +) { + if (5 === finishedWork.tag) { + if ( + (5 === finishedWork.tag || + 27 === finishedWork.tag || + 6 === finishedWork.tag) && + null === finishedWork.alternate && + null !== parentFragmentInstances + ) + for (var i = 0; i < parentFragmentInstances.length; i++) + commitNewChildToFragmentInstance( + finishedWork.stateNode, + parentFragmentInstances[i] + ); + } else if ( + 4 !== finishedWork.tag && + ((finishedWork = finishedWork.child), null !== finishedWork) + ) + for ( + commitImmutablePlacementNodeToFragmentInstances( finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors + parentFragmentInstances ), - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - 0.05 < componentEffectEndTime - componentEffectStartTime && - (isHydratingParent(finishedWork.return.alternate, finishedWork.return) || - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Mount" - ))); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; -} -function commitReconciliationEffects(finishedWork) { - var flags = finishedWork.flags; - if (flags & 2) { - try { - for ( - var parentFragmentInstances = null, parent = finishedWork.return; - null !== parent; + finishedWork = finishedWork.sibling; + null !== finishedWork; - ) { - if (isFragmentInstanceParent(parent)) { - var fragmentInstance = parent.stateNode; - null === parentFragmentInstances - ? (parentFragmentInstances = [fragmentInstance]) - : parentFragmentInstances.push(fragmentInstance); - } - if (isFragmentInstanceHostBoundary(parent)) break; - parent = parent.return; - } + ) commitImmutablePlacementNodeToFragmentInstances( finishedWork, parentFragmentInstances - ); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + ), + (finishedWork = finishedWork.sibling); +} +function commitHostPortalContainerChildren( + portal, + finishedWork, + pendingChildren +) { + portal = portal.containerInfo; + try { + completeRoot$1(portal.containerTag, pendingChildren); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +var shouldStartViewTransition = !1, + appearingViewTransitions = null; +function trackEnterViewTransitions(placement) { + if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432)) + shouldStartViewTransition = !0; +} +var viewTransitionCancelableChildren = null; +function pushViewTransitionCancelableScope() { + var prevChildren = viewTransitionCancelableChildren; + viewTransitionCancelableChildren = null; + return prevChildren; +} +var viewTransitionHostInstanceIdx = 0; +function applyViewTransitionToHostInstances() { + viewTransitionHostInstanceIdx = 0; + return !1; +} +function commitAppearingPairViewTransitions(placement) { + if (0 !== (placement.subtreeFlags & 18874368)) + for (placement = placement.child; null !== placement; ) { + if (22 !== placement.tag || null === placement.memoizedState) + if ( + (commitAppearingPairViewTransitions(placement), + 30 === placement.tag && + 0 !== (placement.flags & 18874368) && + placement.stateNode.paired) + ) { + var props = placement.memoizedProps; + if (null == props.name || "auto" === props.name) + throw Error( + "Found a pair with an auto name. This is a bug in React." + ); + "none" !== getViewTransitionClassName(props.default, props.share) && + applyViewTransitionToHostInstances(); + } + placement = placement.sibling; } - finishedWork.flags &= -3; +} +function commitEnterViewTransitions(placement, gesture) { + if (30 === placement.tag) { + var state = placement.stateNode, + props = placement.memoizedProps; + getViewTransitionName(props, state); + "none" !== + getViewTransitionClassName( + props.default, + state.paired ? props.share : props.enter + ) + ? applyViewTransitionToHostInstances() && + (commitAppearingPairViewTransitions(placement), + state.paired || + gesture || + scheduleViewTransitionEvent(placement, props.onEnter)) + : commitAppearingPairViewTransitions(placement); + } else if (0 !== (placement.subtreeFlags & 33554432)) + for (placement = placement.child; null !== placement; ) + commitEnterViewTransitions(placement, gesture), + (placement = placement.sibling); + else commitAppearingPairViewTransitions(placement); +} +function commitDeletedPairViewTransitions(deletion) { + if ( + null !== appearingViewTransitions && + 0 !== appearingViewTransitions.size + ) { + var pairs = appearingViewTransitions; + if (0 !== (deletion.subtreeFlags & 18874368)) + for (deletion = deletion.child; null !== deletion; ) { + if (22 !== deletion.tag || null === deletion.memoizedState) { + if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) { + var props = deletion.memoizedProps, + name = props.name; + if (null != name && "auto" !== name) { + var pair = pairs.get(name); + if (void 0 !== pair) { + if ( + "none" !== + getViewTransitionClassName(props.default, props.share) && + applyViewTransitionToHostInstances() + ) { + var oldInstance = deletion.stateNode; + pair.paired = oldInstance; + oldInstance.paired = pair; + scheduleViewTransitionEvent(deletion, props.onShare); + } + pairs.delete(name); + if (0 === pairs.size) break; + } + } + } + commitDeletedPairViewTransitions(deletion); + } + deletion = deletion.sibling; + } + } +} +function commitExitViewTransitions(deletion) { + if (30 === deletion.tag) { + var props = deletion.memoizedProps, + name = getViewTransitionName(props, deletion.stateNode), + pair = + null !== appearingViewTransitions + ? appearingViewTransitions.get(name) + : void 0; + if ( + "none" !== + getViewTransitionClassName( + props.default, + void 0 !== pair ? props.share : props.exit + ) && + applyViewTransitionToHostInstances() + ) + if (void 0 !== pair) { + var oldInstance = deletion.stateNode; + pair.paired = oldInstance; + oldInstance.paired = pair; + appearingViewTransitions.delete(name); + scheduleViewTransitionEvent(deletion, props.onShare); + } else scheduleViewTransitionEvent(deletion, props.onExit); + null !== appearingViewTransitions && + commitDeletedPairViewTransitions(deletion); + } else if (0 !== (deletion.subtreeFlags & 33554432)) + for (deletion = deletion.child; null !== deletion; ) + commitExitViewTransitions(deletion), (deletion = deletion.sibling); + else + null !== appearingViewTransitions && + commitDeletedPairViewTransitions(deletion); +} +function commitNestedViewTransitions(changedParent) { + for (changedParent = changedParent.child; null !== changedParent; ) { + if (30 === changedParent.tag) { + var props = changedParent.memoizedProps, + name = getViewTransitionName(props, changedParent.stateNode); + props = getViewTransitionClassName(props.default, props.update); + changedParent.flags &= -5; + "none" !== props && + applyViewTransitionToHostInstances( + changedParent, + name, + props, + (changedParent.memoizedState = []) + ); + } else + 0 !== (changedParent.subtreeFlags & 33554432) && + commitNestedViewTransitions(changedParent); + changedParent = changedParent.sibling; + } +} +function restorePairedViewTransitions(parent) { + if (0 !== (parent.subtreeFlags & 18874368)) + for (parent = parent.child; null !== parent; ) { + if (22 !== parent.tag || null === parent.memoizedState) { + if (30 === parent.tag && 0 !== (parent.flags & 18874368)) { + var instance = parent.stateNode; + null !== instance.paired && (instance.paired = null); + } + restorePairedViewTransitions(parent); + } + parent = parent.sibling; + } +} +function restoreEnterOrExitViewTransitions(fiber) { + if (30 === fiber.tag) + (fiber.stateNode.paired = null), restorePairedViewTransitions(fiber); + else if (0 !== (fiber.subtreeFlags & 33554432)) + for (fiber = fiber.child; null !== fiber; ) + restoreEnterOrExitViewTransitions(fiber), (fiber = fiber.sibling); + else restorePairedViewTransitions(fiber); +} +function measureNestedViewTransitions(changedParent, gesture) { + for (changedParent = changedParent.child; null !== changedParent; ) { + if (30 === changedParent.tag) { + var props = changedParent.memoizedProps, + state = changedParent.stateNode; + getViewTransitionName(props, state); + getViewTransitionClassName(props.default, props.update); + gesture + ? ((props = state.clones), + null !== props && props.map(measureClonedInstance)) + : (changedParent.memoizedState = null); + viewTransitionHostInstanceIdx = 0; + } else + 0 !== (changedParent.subtreeFlags & 33554432) && + measureNestedViewTransitions(changedParent, gesture); + changedParent = changedParent.sibling; } - flags & 4096 && (finishedWork.flags &= -4097); } -function recursivelyTraverseAfterMutationEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 9270) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitAfterMutationEffectsOnFiber(parentFiber, root), - (parentFiber = parentFiber.sibling); - else measureNestedViewTransitions(parentFiber, !1); +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null, + viewTransitionContextChanged = !1; +function isHydratingParent(current, finishedWork) { + return 31 === finishedWork.tag + ? ((finishedWork = finishedWork.memoizedState), + null !== current.memoizedState && null === finishedWork) + : 13 === finishedWork.tag + ? ((current = current.memoizedState), + (finishedWork = finishedWork.memoizedState), + null !== current && + null !== current.dehydrated && + (null === finishedWork || null === finishedWork.dehydrated)) + : 3 === finishedWork.tag + ? current.memoizedState.isDehydrated && 0 === (finishedWork.flags & 256) + : !1; } -function commitAfterMutationEffectsOnFiber(finishedWork, root) { - var current = finishedWork.alternate; - if (null === current) commitEnterViewTransitions(finishedWork, !1); - else - switch (finishedWork.tag) { - case 3: - viewTransitionContextChanged = !1; - pushViewTransitionCancelableScope(); - recursivelyTraverseAfterMutationEffects(root, finishedWork); - viewTransitionCancelableChildren = null; - break; - case 5: - recursivelyTraverseAfterMutationEffects(root, finishedWork); - break; - case 4: - current = viewTransitionContextChanged; - viewTransitionContextChanged = !1; - recursivelyTraverseAfterMutationEffects(root, finishedWork); - viewTransitionContextChanged = current; - break; - case 22: - 0 !== (finishedWork.mode & 1) - ? null === finishedWork.memoizedState && - (null !== current.memoizedState - ? commitEnterViewTransitions(finishedWork, !1) - : recursivelyTraverseAfterMutationEffects(root, finishedWork)) - : recursivelyTraverseAfterMutationEffects(root, finishedWork); - break; - case 30: - var prevContextChanged$148 = viewTransitionContextChanged, - prevCancelableChildren = pushViewTransitionCancelableScope(); - viewTransitionContextChanged = !1; - recursivelyTraverseAfterMutationEffects(root, finishedWork); - viewTransitionContextChanged && (finishedWork.flags |= 4); - root = finishedWork.memoizedProps; - var state = finishedWork.stateNode; - getViewTransitionName(root, state); - getViewTransitionName(current.memoizedProps, state); - "none" !== getViewTransitionClassName(root.default, root.update) && - ((root = current.memoizedState), - (current.memoizedState = null), - (viewTransitionHostInstanceIdx = 0), - viewTransitionHostInstanceIdx !== (null === root ? 0 : root.length) && - (finishedWork.flags |= 32)); - null !== prevCancelableChildren && - (prevCancelableChildren.push.apply( - prevCancelableChildren, - viewTransitionCancelableChildren - ), - (viewTransitionCancelableChildren = prevCancelableChildren)); - viewTransitionContextChanged = - 0 !== (finishedWork.flags & 32) ? !0 : prevContextChanged$148; - break; - default: - recursivelyTraverseAfterMutationEffects(root, finishedWork); +function commitBeforeMutationEffects(root, firstChild, committedLanes) { + root = (committedLanes & 335544064) === committedLanes; + nextEffect = firstChild; + for (firstChild = root ? 9270 : 1024; null !== nextEffect; ) { + committedLanes = nextEffect; + if (root) { + var deletions = committedLanes.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) + root && commitExitViewTransitions(deletions[i]); } -} -function recursivelyTraverseLayoutEffects(root, parentFiber) { - if (parentFiber.subtreeFlags & 8772) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), - (parentFiber = parentFiber.sibling); -} -function recursivelyTraverseDisappearLayoutEffects(parentFiber) { - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedWork = parentFiber, - prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 4); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 1: - safelyDetachRef(finishedWork, finishedWork.return); - var instance = finishedWork.stateNode; - "function" === typeof instance.componentWillUnmount && - safelyCallComponentWillUnmount( - finishedWork, - finishedWork.return, - instance - ); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 27: - case 5: - safelyDetachRef(finishedWork, finishedWork.return); - (5 !== finishedWork.tag && 27 !== finishedWork.tag) || - commitFragmentInstanceDeletionEffects(finishedWork); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 6: - commitFragmentInstanceDeletionEffects(finishedWork); - break; - case 26: - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 30: - safelyDetachRef(finishedWork, finishedWork.return); - recursivelyTraverseDisappearLayoutEffects(finishedWork); - break; - case 7: - safelyDetachRef(finishedWork, finishedWork.return); - default: - recursivelyTraverseDisappearLayoutEffects(finishedWork); + if (null === committedLanes.alternate && 0 !== (committedLanes.flags & 2)) + root && trackEnterViewTransitions(committedLanes), + commitBeforeMutationEffects_complete(root); + else { + if (22 === committedLanes.tag) + if ( + ((deletions = committedLanes.alternate), + null !== committedLanes.memoizedState) + ) { + null !== deletions && + null === deletions.memoizedState && + root && + commitExitViewTransitions(deletions); + commitBeforeMutationEffects_complete(root); + continue; + } else if (null !== deletions && null !== deletions.memoizedState) { + root && trackEnterViewTransitions(committedLanes); + commitBeforeMutationEffects_complete(root); + continue; + } + deletions = committedLanes.child; + 0 !== (committedLanes.subtreeFlags & firstChild) && null !== deletions + ? ((deletions.return = committedLanes), (nextEffect = deletions)) + : (root && commitNestedViewTransitions(committedLanes), + commitBeforeMutationEffects_complete(root)); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - parentFiber = parentFiber.sibling; } + appearingViewTransitions = null; } -function recursivelyTraverseReappearLayoutEffects( - finishedRoot$jscomp$0, - parentFiber, - layoutEffectTraversalFlags +function commitBeforeMutationEffects_complete( + isViewTransitionEligible$jscomp$0 ) { - layoutEffectTraversalFlags = - 0 !== (parentFiber.subtreeFlags & 8772) - ? layoutEffectTraversalFlags - : layoutEffectTraversalFlags & -2; - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current = parentFiber.alternate, - finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - prevEffectStart = pushComponentEffectStart(), - prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - flags = finishedWork.flags, - includeWorkInProgressEffects = 0 !== (layoutEffectTraversalFlags & 1); - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - commitHookLayoutEffects(finishedWork, 4); - break; - case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - current = finishedWork; - finishedRoot = current.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) - try { - finishedRoot.componentDidMount(); - } catch (error) { - captureCommitPhaseError(current, current.return, error); - } - current = finishedWork; - finishedRoot = current.updateQueue; - if (null !== finishedRoot) { - var instance = current.stateNode; + for (; null !== nextEffect; ) { + var fiber = nextEffect, + isViewTransitionEligible = isViewTransitionEligible$jscomp$0, + current = fiber.alternate, + flags = fiber.flags; + switch (fiber.tag) { + case 1: + if (0 !== (flags & 1024) && null !== current) { + isViewTransitionEligible = void 0; + flags = current.memoizedProps; + current = current.memoizedState; + var instance = fiber.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], instance); + var resolvedPrevProps = resolveClassComponentProps( + fiber.type, + flags + ); + isViewTransitionEligible = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + current + ); + instance.__reactInternalSnapshotBeforeUpdate = + isViewTransitionEligible; } catch (error) { - captureCommitPhaseError(current, current.return, error); + captureCommitPhaseError(fiber, fiber.return, error); } } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 27: - case 5: - (5 !== finishedWork.tag && 27 !== finishedWork.tag) || - commitFragmentInstanceInsertionEffects(finishedWork); - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - includeWorkInProgressEffects && - null === current && - flags & 4 && - commitHostMount(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); break; - case 6: - commitFragmentInstanceInsertionEffects(finishedWork); + case 3: break; + case 0: + case 11: + case 15: + case 5: case 26: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - includeWorkInProgressEffects && - null === current && - flags & 4 && - commitHostMount(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - includeWorkInProgressEffects && flags & 4 - ? ((flags = pushNestedEffectDurations()), - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ), - (includeWorkInProgressEffects = finishedWork.stateNode), - (includeWorkInProgressEffects.effectDuration += - bubbleNestedEffectDurations(flags)), - commitProfilerUpdate( - finishedWork, - current, - commitStartTime, - includeWorkInProgressEffects.effectDuration - )) - : recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - break; - case 31: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - break; - case 13: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - break; - case 22: - null === finishedWork.memoizedState && - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - safelyAttachRef(finishedWork, finishedWork.return); + case 27: + case 6: + case 4: + case 17: break; case 30: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); - safelyAttachRef(finishedWork, finishedWork.return); + isViewTransitionEligible && + null !== current && + ((isViewTransitionEligible = getViewTransitionName( + current.memoizedProps, + current.stateNode + )), + (flags = fiber.memoizedProps), + (flags = getViewTransitionClassName(flags.default, flags.update)), + "none" !== flags && + applyViewTransitionToHostInstances( + current, + isViewTransitionEligible, + flags, + (current.memoizedState = []) + )); break; - case 7: - safelyAttachRef(finishedWork, finishedWork.return); default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - layoutEffectTraversalFlags - ); + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + current = fiber.sibling; + if (null !== current) { + current.return = fiber.return; + nextEffect = current; + break; + } + nextEffect = fiber.return; + } +} +function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 4 && commitHookLayoutEffects(finishedWork, 5); + break; + case 1: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + if (shouldProfile(finishedWork)) { + startEffectTimer(); + try { + finishedRoot.componentDidMount(); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + recordEffectDuration(); + } else + try { + finishedRoot.componentDidMount(); + } catch (error$122) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$122 + ); + } + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps + ); + current = current.memoizedState; + if (shouldProfile(finishedWork)) { + startEffectTimer(); + try { + finishedRoot.componentDidUpdate( + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } catch (error$123) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$123 + ); + } + recordEffectDuration(); + } else + try { + finishedRoot.componentDidUpdate( + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } catch (error$124) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$124 + ); + } + } + flags & 64 && commitClassCallbacks(finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + break; + case 3: + current = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 64 && ((flags = finishedWork.updateQueue), null !== flags)) { + prevProps = null; + if (null !== finishedWork.child) + switch (finishedWork.child.tag) { + case 27: + case 5: + prevProps = getPublicInstance(finishedWork.child.stateNode); + break; + case 1: + prevProps = finishedWork.child.stateNode; + } + try { + commitCallbacks(flags, prevProps); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + finishedRoot.effectDuration += popNestedEffectDurations(current); + break; + case 27: + case 26: + case 5: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (null === current) + if (flags & 4) commitHostMount(finishedWork); + else if (flags & 64) { + finishedRoot = finishedWork.type; + current = finishedWork.memoizedProps; + prevProps = finishedWork.stateNode; + try { + shim$1(prevProps, finishedRoot, current, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + break; + case 31: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + break; + case 13: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 64 && + ((finishedRoot = finishedWork.memoizedState), + null !== finishedRoot && + null !== finishedRoot.dehydrated && + (retryDehydratedSuspenseBoundary.bind(null, finishedWork), shim$1())); + break; + case 22: + flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; + if (!flags) { + var newOffscreenSubtreeWasHidden = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + current = offscreenSubtreeIsHidden; + prevProps = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = flags; + (offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden) && !prevProps + ? ((flags = 0), + 0 !== (finishedWork.subtreeFlags & 8772) && (flags |= 1), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + flags + ), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = current; + offscreenSubtreeWasHidden = prevProps; + } + break; + case 30: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + break; + case 7: + flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect( finishedWork, componentEffectStartTime, componentEffectEndTime, componentEffectDuration, componentEffectErrors + ), + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + 0.05 < componentEffectEndTime - componentEffectStartTime && + (isHydratingParent(finishedWork.return.alternate, finishedWork.return) || + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Mount" + ))); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; +} +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; +} +function recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + parent +) { + for (parent = parent.child; null !== parent; ) + commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), + (parent = parent.sibling); +} +function commitDeletionEffectsOnFiber( + finishedRoot, + nearestMountedAncestor, + deletedFiber +) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) + try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) {} + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (deletedFiber.tag) { + case 26: + case 27: + case 5: + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor), + commitFragmentInstanceDeletionEffects(deletedFiber); + case 6: + 6 === deletedFiber.tag && + commitFragmentInstanceDeletionEffects(deletedFiber); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 18: + break; + case 4: + commitHostPortalContainerChildren( + deletedFiber.stateNode, + deletedFiber, + createChildNodeSet() + ); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 0: + case 11: + case 14: + case 15: + commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects(deletedFiber, nearestMountedAncestor, 4); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 1: + if (!offscreenSubtreeWasHidden) { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + var instance = deletedFiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + instance + ); + } + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 21: + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 22: + offscreenSubtreeWasHidden = + (instance = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState; + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + offscreenSubtreeWasHidden = instance; + break; + case 30: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + case 7: + offscreenSubtreeWasHidden || + safelyDetachRef(deletedFiber, nearestMountedAncestor); + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); + break; + default: + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectErrors = prevEffectErrors; - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - parentFiber = parentFiber.sibling; } + 0 !== (deletedFiber.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + deletedFiber, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } -function commitOffscreenPassiveMountEffects(current, finishedWork) { - var previousCache = null; - null !== current && - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - (previousCache = current.memoizedState.cachePool.pool); - current = null; - null !== finishedWork.memoizedState && - null !== finishedWork.memoizedState.cachePool && - (current = finishedWork.memoizedState.cachePool.pool); - current !== previousCache && - (null != current && current.refCount++, - null != previousCache && releaseCache(previousCache)); +function getRetryCache(finishedWork) { + switch (finishedWork.tag) { + case 31: + case 13: + case 19: + var retryCache = finishedWork.stateNode; + null === retryCache && + (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + return retryCache; + case 22: + return ( + (finishedWork = finishedWork.stateNode), + (retryCache = finishedWork._retryCache), + null === retryCache && + (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), + retryCache + ); + default: + throw Error( + "Unexpected Suspense handler tag (" + + finishedWork.tag + + "). This is a bug in React." + ); + } } -function commitCachePassiveMountEffect(current, finishedWork) { - current = null; - null !== finishedWork.alternate && - (current = finishedWork.alternate.memoizedState.cache); - finishedWork = finishedWork.memoizedState.cache; - finishedWork !== current && - (finishedWork.refCount++, null != current && releaseCache(current)); +function attachSuspenseRetryListeners(finishedWork, wakeables) { + var retryCache = getRetryCache(finishedWork); + wakeables.forEach(function (wakeable) { + if (!retryCache.has(wakeable)) { + retryCache.add(wakeable); + if (isDevToolsPresent) + if (null !== inProgressLanes && null !== inProgressRoot) + restorePendingUpdaters(inProgressRoot, inProgressLanes); + else + throw Error( + "Expected finished root and lanes to be set. This is a bug in React." + ); + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + attachContextPreservingListener(wakeable, retry); + } + }); } -function recursivelyTraversePassiveMountEffects( - root, - parentFiber, - committedLanes, - committedTransitions, - endTime -) { - if ( - parentFiber.subtreeFlags & - ((committedLanes & 335544064) === committedLanes ? 10262 : 10256) || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child)) - ) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var nextSibling = parentFiber.sibling; - commitPassiveMountOnFiber( - root, - parentFiber, - committedLanes, - committedTransitions, - null !== nextSibling ? nextSibling.actualStartTime : endTime - ); - parentFiber = nextSibling; +function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber, lanes) { + var deletions = parentFiber.deletions; + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + prevEffectStart = pushComponentEffectStart(); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + 0 !== (childToDelete.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + childToDelete, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } + if (parentFiber.subtreeFlags & 13886) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0, lanes), + (parentFiber = parentFiber.sibling); } -var inHydratedSubtree = !1; -function commitPassiveMountOnFiber( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime -) { +function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), - isViewTransitionEligible = (committedLanes & 335544064) === committedLanes; - isViewTransitionEligible && - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate && - restoreEnterOrExitViewTransitions(finishedWork); - var flags = finishedWork.flags; + current = finishedWork.alternate, + flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: + case 14: case 15: - 0 !== (finishedWork.mode & 2) && - 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) && - logComponentRender( - finishedWork, - finishedWork.actualStartTime, - endTime, - inHydratedSubtree - ); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + if ( + flags & 4 && + ((current = finishedWork.updateQueue), + (current = null !== current ? current.events : null), + null !== current) + ) + for (var ii = 0; ii < current.length; ii++) { + var _eventPayloads$ii = current[ii]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 5)); break; case 1: - 0 !== (finishedWork.mode & 2) && - 0 < finishedWork.actualStartTime && - (0 !== (finishedWork.flags & 128) - ? logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime - ) - : 0 !== (finishedWork.flags & 1) && - logComponentRender( - finishedWork, - finishedWork.actualStartTime, - endTime, - inHydratedSubtree - )); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + flags & 64 && + offscreenSubtreeIsHidden && + ((root = finishedWork.updateQueue), + null !== root && + ((flags = root.callbacks), + null !== flags && + ((lanes = root.shared.hiddenCallbacks), + (root.shared.hiddenCallbacks = + null === lanes ? flags : lanes.concat(flags))))); break; - case 3: - isViewTransitionEligible = pushNestedEffectDurations(); - var wasInHydratedSubtree = inHydratedSubtree; - inHydratedSubtree = - null !== finishedWork.alternate && - finishedWork.alternate.memoizedState.isDehydrated && - 0 === (finishedWork.flags & 256); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - inHydratedSubtree = wasInHydratedSubtree; - flags & 2048 && - ((committedLanes = null), - null !== finishedWork.alternate && - (committedLanes = finishedWork.alternate.memoizedState.cache), - (committedTransitions = finishedWork.memoizedState.cache), - committedTransitions !== committedLanes && - (committedTransitions.refCount++, - null != committedLanes && releaseCache(committedLanes))); - finishedRoot.passiveEffectDuration += popNestedEffectDurations( - isViewTransitionEligible - ); + case 26: + case 27: + case 5: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + null !== finishedWork.alternate && + (finishedWork.alternate.stateNode = finishedWork.stateNode); break; - case 12: - if (flags & 2048) { - flags = pushNestedEffectDurations(); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - finishedRoot = finishedWork.stateNode; - finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(flags); + case 6: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + break; + case 3: + current = pushNestedEffectDurations(); + viewTransitionMutationContext = !1; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + flags = root.containerInfo; + lanes = root.pendingChildren; try { - wasInHydratedSubtree = finishedWork.memoizedProps; - var id = wasInHydratedSubtree.id, - onPostCommit = wasInHydratedSubtree.onPostCommit, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof onPostCommit && - onPostCommit( - id, - phase, - finishedRoot.passiveEffectDuration, - commitStartTime - ); + completeRoot$1(flags.containerTag, lanes), + (viewTransitionMutationContext = !0); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - } else - recursivelyTraversePassiveMountEffects( - finishedRoot, + } + root.effectDuration += popNestedEffectDurations(current); + viewTransitionMutationContext = !1; + break; + case 4: + current = pushMutationContext(); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + viewTransitionMutationContext = current; + flags & 4 && + commitHostPortalContainerChildren( + finishedWork.stateNode, finishedWork, - committedLanes, - committedTransitions, - endTime + finishedWork.stateNode.pendingChildren ); break; + case 12: + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + finishedWork.stateNode.effectDuration += + bubbleNestedEffectDurations(flags); + break; case 31: - flags = inHydratedSubtree; - isViewTransitionEligible = - null !== finishedWork.alternate - ? finishedWork.alternate.memoizedState - : null; - wasInHydratedSubtree = finishedWork.memoizedState; - null !== isViewTransitionEligible && null === wasInHydratedSubtree - ? ((wasInHydratedSubtree = finishedWork.deletions), - null !== wasInHydratedSubtree && - 0 < wasInHydratedSubtree.length && - 18 === wasInHydratedSubtree[0].tag - ? ((inHydratedSubtree = !1), - null !== isViewTransitionEligible.hydrationErrors && - logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime - )) - : (inHydratedSubtree = !0)) - : (inHydratedSubtree = !1); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - inHydratedSubtree = flags; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); break; case 13: - flags = inHydratedSubtree; - isViewTransitionEligible = - null !== finishedWork.alternate - ? finishedWork.alternate.memoizedState - : null; - wasInHydratedSubtree = finishedWork.memoizedState; - null === isViewTransitionEligible || - null === isViewTransitionEligible.dehydrated || - (null !== wasInHydratedSubtree && - null !== wasInHydratedSubtree.dehydrated) - ? (inHydratedSubtree = !1) - : ((wasInHydratedSubtree = finishedWork.deletions), - null !== wasInHydratedSubtree && - 0 < wasInHydratedSubtree.length && - 18 === wasInHydratedSubtree[0].tag - ? ((inHydratedSubtree = !1), - null !== isViewTransitionEligible.hydrationErrors && - logComponentErrored( - finishedWork, - finishedWork.actualStartTime, - endTime - )) - : (inHydratedSubtree = !0)); - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - inHydratedSubtree = flags; - break; - case 23: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + finishedWork.child.flags & 8192 && + ((root = null !== current && null !== current.memoizedState), + null === finishedWork.memoizedState || + root || + (globalMostRecentFallbackTime = now$1())); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); break; case 22: - id = finishedWork.stateNode; - wasInHydratedSubtree = finishedWork.alternate; - null !== finishedWork.memoizedState - ? (isViewTransitionEligible && - null !== wasInHydratedSubtree && - null === wasInHydratedSubtree.memoizedState && - restoreEnterOrExitViewTransitions(wasInHydratedSubtree), - id._visibility & 2 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : ((id._visibility |= 2), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ))) - : (isViewTransitionEligible && - null !== wasInHydratedSubtree && - null !== wasInHydratedSubtree.memoizedState && - restoreEnterOrExitViewTransitions(finishedWork), - id._visibility & 2 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ) - : ((id._visibility |= 2), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) || - (0 !== finishedWork.actualDuration && - (null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child)), - endTime - ), - 0 === (finishedWork.mode & 2) || - inHydratedSubtree || - ((finishedRoot = finishedWork.actualStartTime), - 0 <= finishedRoot && - 0.05 < endTime - finishedRoot && - logComponentReappeared(finishedWork, finishedRoot, endTime), - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentReappeared( - finishedWork, - componentEffectStartTime, - componentEffectEndTime - )))); - flags & 2048 && - commitOffscreenPassiveMountEffects(wasInHydratedSubtree, finishedWork); + ii = null !== finishedWork.memoizedState; + _eventPayloads$ii = null !== current && null !== current.memoizedState; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || ii; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || _eventPayloads$ii; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + _eventPayloads$ii && + !ii && + !prevOffscreenSubtreeIsHidden && + !prevOffscreenSubtreeWasHidden && + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + ); + commitReconciliationEffects(finishedWork); + flags & 8192 && + ((root = finishedWork.stateNode), + (root._visibility = ii ? root._visibility & -2 : root._visibility | 1), + !ii || + null === current || + _eventPayloads$ii || + offscreenSubtreeIsHidden || + offscreenSubtreeWasHidden || + ((root = _eventPayloads$ii || offscreenSubtreeWasHidden), + (lanes = offscreenSubtreeIsHidden), + (current = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = ii || offscreenSubtreeIsHidden), + (offscreenSubtreeWasHidden = root), + recursivelyTraverseDisappearLayoutEffects(finishedWork), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Disconnect" + ), + (offscreenSubtreeIsHidden = lanes), + (offscreenSubtreeWasHidden = current))); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((flags = root.retryQueue), + null !== flags && + ((root.retryQueue = null), + attachSuspenseRetryListeners(finishedWork, flags)))); break; - case 24: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + case 19: + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + flags & 4 && + ((root = finishedWork.updateQueue), + null !== root && + ((finishedWork.updateQueue = null), + attachSuspenseRetryListeners(finishedWork, root))); break; case 30: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)); + flags = pushMutationContext(); + ii = (lanes & 335544064) === lanes; + _eventPayloads$ii = finishedWork.memoizedProps; + ii && + "none" !== + getViewTransitionClassName( + _eventPayloads$ii.default, + _eventPayloads$ii.update + ); + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + commitReconciliationEffects(finishedWork); + ii && + null !== current && + viewTransitionMutationContext && + (finishedWork.flags |= 4); + viewTransitionMutationContext = flags; break; - default: - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - endTime - ); + case 21: + break; + case 7: + flags & 512 && + (offscreenSubtreeWasHidden || + null === current || + safelyDetachRef(current, current.return)), + current && + null !== current.stateNode && + (current.stateNode._fragmentFiber = finishedWork); + default: + recursivelyTraverseMutationEffects(root, finishedWork, lanes), + commitReconciliationEffects(finishedWork); } - if (0 !== (finishedWork.mode & 2)) { - if ( - (finishedRoot = - !inHydratedSubtree && - null === finishedWork.alternate && - null !== finishedWork.return && - null !== finishedWork.return.alternate) - ) - (committedLanes = finishedWork.actualStartTime), - 0 <= committedLanes && - 0.05 < endTime - committedLanes && - logComponentTrigger(finishedWork, committedLanes, endTime, "Mount"); + 0 !== (finishedWork.mode & 2) && 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ), - finishedRoot && - 0.05 < componentEffectEndTime - componentEffectStartTime && + 0 <= componentEffectEndTime && + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ), + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + 0.05 < componentEffectEndTime - componentEffectStartTime && + (isHydratingParent(finishedWork.return.alternate, finishedWork.return) || logComponentTrigger( finishedWork, componentEffectStartTime, componentEffectEndTime, "Mount" - )); - } + ))); popComponentEffectStart(prevEffectStart); popComponentEffectDuration(prevEffectDuration); componentEffectErrors = prevEffectErrors; componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } -function recursivelyTraverseReconnectPassiveEffects( - finishedRoot$jscomp$0, - parentFiber, - committedLanes$jscomp$0, - committedTransitions$jscomp$0, - includeWorkInProgressEffects, - endTime$jscomp$0 -) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && - (0 !== (parentFiber.subtreeFlags & 10256) || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child))); - for (var child = parentFiber.child; null !== child; ) { - parentFiber = child.sibling; - var finishedRoot = finishedRoot$jscomp$0, - committedLanes = committedLanes$jscomp$0, - committedTransitions = committedTransitions$jscomp$0, - endTime = - null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0, +function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + if (flags & 2) { + try { + for ( + var parentFragmentInstances = null, parent = finishedWork.return; + null !== parent; + + ) { + if (isFragmentInstanceParent(parent)) { + var fragmentInstance = parent.stateNode; + null === parentFragmentInstances + ? (parentFragmentInstances = [fragmentInstance]) + : parentFragmentInstances.push(fragmentInstance); + } + if (isFragmentInstanceHostBoundary(parent)) break; + parent = parent.return; + } + commitImmutablePlacementNodeToFragmentInstances( + finishedWork, + parentFragmentInstances + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + finishedWork.flags &= -3; + } + flags & 4096 && (finishedWork.flags &= -4097); +} +function recursivelyTraverseAfterMutationEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 9270) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitAfterMutationEffectsOnFiber(parentFiber, root), + (parentFiber = parentFiber.sibling); + else measureNestedViewTransitions(parentFiber, !1); +} +function commitAfterMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate; + if (null === current) commitEnterViewTransitions(finishedWork, !1); + else + switch (finishedWork.tag) { + case 3: + viewTransitionContextChanged = !1; + pushViewTransitionCancelableScope(); + recursivelyTraverseAfterMutationEffects(root, finishedWork); + viewTransitionCancelableChildren = null; + break; + case 5: + recursivelyTraverseAfterMutationEffects(root, finishedWork); + break; + case 4: + current = viewTransitionContextChanged; + viewTransitionContextChanged = !1; + recursivelyTraverseAfterMutationEffects(root, finishedWork); + viewTransitionContextChanged = current; + break; + case 22: + null === finishedWork.memoizedState && + (null !== current.memoizedState + ? commitEnterViewTransitions(finishedWork, !1) + : recursivelyTraverseAfterMutationEffects(root, finishedWork)); + break; + case 30: + var prevContextChanged$138 = viewTransitionContextChanged, + prevCancelableChildren = pushViewTransitionCancelableScope(); + viewTransitionContextChanged = !1; + recursivelyTraverseAfterMutationEffects(root, finishedWork); + viewTransitionContextChanged && (finishedWork.flags |= 4); + root = finishedWork.memoizedProps; + var state = finishedWork.stateNode; + getViewTransitionName(root, state); + getViewTransitionName(current.memoizedProps, state); + "none" !== getViewTransitionClassName(root.default, root.update) && + ((root = current.memoizedState), + (current.memoizedState = null), + (viewTransitionHostInstanceIdx = 0), + viewTransitionHostInstanceIdx !== (null === root ? 0 : root.length) && + (finishedWork.flags |= 32)); + null !== prevCancelableChildren && + (prevCancelableChildren.push.apply( + prevCancelableChildren, + viewTransitionCancelableChildren + ), + (viewTransitionCancelableChildren = prevCancelableChildren)); + viewTransitionContextChanged = + 0 !== (finishedWork.flags & 32) ? !0 : prevContextChanged$138; + break; + default: + recursivelyTraverseAfterMutationEffects(root, finishedWork); + } +} +function recursivelyTraverseLayoutEffects(root, parentFiber) { + if (parentFiber.subtreeFlags & 8772) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), + (parentFiber = parentFiber.sibling); +} +function recursivelyTraverseDisappearLayoutEffects(parentFiber) { + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedWork = parentFiber, prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - includeWorkInProgressEffects && - 0 !== (child.mode & 2) && - 0 < child.actualStartTime && - 0 !== (child.flags & 1) && - logComponentRender( - child, - child.actualStartTime, - endTime, - inHydratedSubtree - ); - var flags = child.flags; - switch (child.tag) { + switch (finishedWork.tag) { case 0: case 11: + case 14: case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); - commitHookPassiveMountEffects(child, 8); + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 4); + recursivelyTraverseDisappearLayoutEffects(finishedWork); break; - case 23: + case 1: + safelyDetachRef(finishedWork, finishedWork.return); + var instance = finishedWork.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 27: + case 5: + safelyDetachRef(finishedWork, finishedWork.return); + (5 !== finishedWork.tag && 27 !== finishedWork.tag) || + commitFragmentInstanceDeletionEffects(finishedWork); + recursivelyTraverseDisappearLayoutEffects(finishedWork); + break; + case 6: + commitFragmentInstanceDeletionEffects(finishedWork); + break; + case 26: + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 22: - var instance = child.stateNode; - null !== child.memoizedState - ? instance._visibility & 2 - ? recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ) - : child.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime - ) - : ((instance._visibility |= 2), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - )) - : ((instance._visibility |= 2), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects(child.alternate, child); + null === finishedWork.memoizedState && + recursivelyTraverseDisappearLayoutEffects(finishedWork); break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(child.alternate, child); + case 30: + safelyDetachRef(finishedWork, finishedWork.return); + recursivelyTraverseDisappearLayoutEffects(finishedWork); break; + case 7: + safelyDetachRef(finishedWork, finishedWork.return); default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - includeWorkInProgressEffects, - endTime - ); + recursivelyTraverseDisappearLayoutEffects(finishedWork); } - 0 !== (child.mode & 2) && + 0 !== (finishedWork.mode & 2) && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect( - child, + finishedWork, componentEffectStartTime, componentEffectEndTime, componentEffectDuration, @@ -10717,2896 +9228,3190 @@ function recursivelyTraverseReconnectPassiveEffects( popComponentEffectDuration(prevEffectDuration); componentEffectErrors = prevEffectErrors; componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - child = parentFiber; + parentFiber = parentFiber.sibling; } } -function recursivelyTraverseAtomicPassiveEffects( +function recursivelyTraverseReappearLayoutEffects( finishedRoot$jscomp$0, parentFiber, - committedLanes$jscomp$0, - committedTransitions$jscomp$0, - endTime$jscomp$0 + layoutEffectTraversalFlags ) { - if ( - parentFiber.subtreeFlags & 10256 || - (0 !== parentFiber.actualDuration && - (null === parentFiber.alternate || - parentFiber.alternate.child !== parentFiber.child)) - ) - for (var child = parentFiber.child; null !== child; ) { - parentFiber = child.sibling; - var finishedRoot = finishedRoot$jscomp$0, - committedLanes = committedLanes$jscomp$0, - committedTransitions = committedTransitions$jscomp$0, - endTime = - null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0; - 0 !== (child.mode & 2) && - 0 < child.actualStartTime && - 0 !== (child.flags & 1) && - logComponentRender( - child, - child.actualStartTime, - endTime, - inHydratedSubtree + layoutEffectTraversalFlags = + 0 !== (parentFiber.subtreeFlags & 8772) + ? layoutEffectTraversalFlags + : layoutEffectTraversalFlags & -2; + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var current = parentFiber.alternate, + finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + flags = finishedWork.flags, + includeWorkInProgressEffects = 0 !== (layoutEffectTraversalFlags & 1); + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags ); - var flags = child.flags; - switch (child.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && - commitOffscreenPassiveMountEffects(child.alternate, child); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime - ); - flags & 2048 && commitCachePassiveMountEffect(child.alternate, child); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - child, - committedLanes, - committedTransitions, - endTime - ); - } - child = parentFiber; - } -} -var suspenseyCommitFlag = 8192; -function recursivelyAccumulateSuspenseyCommit(parentFiber) { - if (parentFiber.subtreeFlags & suspenseyCommitFlag) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - accumulateSuspenseyCommitOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); -} -function accumulateSuspenseyCommitOnFiber(fiber) { - switch (fiber.tag) { - case 26: - recursivelyAccumulateSuspenseyCommit(fiber); - fiber.flags & suspenseyCommitFlag && - null !== fiber.memoizedState && - shim(); - break; - case 5: - recursivelyAccumulateSuspenseyCommit(fiber); - break; - case 3: - case 4: - recursivelyAccumulateSuspenseyCommit(fiber); - break; - case 22: - if (null === fiber.memoizedState) { - var current = fiber.alternate; - null !== current && null !== current.memoizedState - ? ((current = suspenseyCommitFlag), - (suspenseyCommitFlag = 16777216), - recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current)) - : recursivelyAccumulateSuspenseyCommit(fiber); - } - break; - case 30: - if ( - 0 !== (fiber.flags & suspenseyCommitFlag) && - ((current = fiber.memoizedProps.name), - null != current && "auto" !== current) - ) { - var state = fiber.stateNode; - state.paired = null; - null === appearingViewTransitions && - (appearingViewTransitions = new Map()); - appearingViewTransitions.set(current, state); - } - recursivelyAccumulateSuspenseyCommit(fiber); - break; - default: - recursivelyAccumulateSuspenseyCommit(fiber); - } -} -function detachAlternateSiblings(parentFiber) { - var previousFiber = parentFiber.alternate; - if ( - null !== previousFiber && - ((parentFiber = previousFiber.child), null !== parentFiber) - ) { - previousFiber.child = null; - do - (previousFiber = parentFiber.sibling), - (parentFiber.sibling = null), - (parentFiber = previousFiber); - while (null !== parentFiber); - } -} -function recursivelyTraversePassiveUnmountEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i], - prevEffectStart = pushComponentEffectStart(); - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber + commitHookLayoutEffects(finishedWork, 4); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + current = finishedWork; + finishedRoot = current.stateNode; + if ("function" === typeof finishedRoot.componentDidMount) + try { + finishedRoot.componentDidMount(); + } catch (error) { + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); + } + } + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 27: + case 5: + (5 !== finishedWork.tag && 27 !== finishedWork.tag) || + commitFragmentInstanceInsertionEffects(finishedWork); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 6: + commitFragmentInstanceInsertionEffects(finishedWork); + break; + case 26: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + includeWorkInProgressEffects && flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ), + (includeWorkInProgressEffects = finishedWork.stateNode), + (includeWorkInProgressEffects.effectDuration += + bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + includeWorkInProgressEffects.effectDuration + )) + : recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + break; + case 31: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags ); - 0 !== (childToDelete.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - childToDelete, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" + break; + case 13: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags ); - popComponentEffectStart(prevEffectStart); - } - detachAlternateSiblings(parentFiber); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 30: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 7: + safelyAttachRef(finishedWork, finishedWork.return); + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + layoutEffectTraversalFlags + ); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + parentFiber = parentFiber.sibling; } - if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - commitPassiveUnmountOnFiber(parentFiber), - (parentFiber = parentFiber.sibling); } -function commitPassiveUnmountOnFiber(finishedWork) { +function commitOffscreenPassiveMountEffects(current, finishedWork) { + var previousCache = null; + null !== current && + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + (previousCache = current.memoizedState.cachePool.pool); + current = null; + null !== finishedWork.memoizedState && + null !== finishedWork.memoizedState.cachePool && + (current = finishedWork.memoizedState.cachePool.pool); + current !== previousCache && + (null != current && current.refCount++, + null != previousCache && releaseCache(previousCache)); +} +function commitCachePassiveMountEffect(current, finishedWork) { + current = null; + null !== finishedWork.alternate && + (current = finishedWork.alternate.memoizedState.cache); + finishedWork = finishedWork.memoizedState.cache; + finishedWork !== current && + (finishedWork.refCount++, null != current && releaseCache(current)); +} +function recursivelyTraversePassiveMountEffects( + root, + parentFiber, + committedLanes, + committedTransitions, + endTime +) { + if ( + parentFiber.subtreeFlags & + ((committedLanes & 335544064) === committedLanes ? 10262 : 10256) || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child)) + ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; + commitPassiveMountOnFiber( + root, + parentFiber, + committedLanes, + committedTransitions, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } +} +var inHydratedSubtree = !1; +function commitPassiveMountOnFiber( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime +) { var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), + isViewTransitionEligible = (committedLanes & 335544064) === committedLanes; + isViewTransitionEligible && + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate && + restoreEnterOrExitViewTransitions(finishedWork); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.flags & 2048 && - commitHookPassiveUnmountEffects(finishedWork, finishedWork.return, 9); + 0 !== (finishedWork.mode & 2) && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + break; + case 1: + 0 !== (finishedWork.mode & 2) && + 0 < finishedWork.actualStartTime && + (0 !== (finishedWork.flags & 128) + ? logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime + ) + : 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + )); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + break; + case 3: + isViewTransitionEligible = pushNestedEffectDurations(); + var wasInHydratedSubtree = inHydratedSubtree; + inHydratedSubtree = + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + inHydratedSubtree = wasInHydratedSubtree; + flags & 2048 && + ((committedLanes = null), + null !== finishedWork.alternate && + (committedLanes = finishedWork.alternate.memoizedState.cache), + (committedTransitions = finishedWork.memoizedState.cache), + committedTransitions !== committedLanes && + (committedTransitions.refCount++, + null != committedLanes && releaseCache(committedLanes))); + finishedRoot.passiveEffectDuration += popNestedEffectDurations( + isViewTransitionEligible + ); + break; + case 12: + if (flags & 2048) { + flags = pushNestedEffectDurations(); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + finishedRoot = finishedWork.stateNode; + finishedRoot.passiveEffectDuration += + bubbleNestedEffectDurations(flags); + try { + wasInHydratedSubtree = finishedWork.memoizedProps; + var id = wasInHydratedSubtree.id, + onPostCommit = wasInHydratedSubtree.onPostCommit, + phase = null === finishedWork.alternate ? "mount" : "update"; + currentUpdateIsNested && (phase = "nested-update"); + "function" === typeof onPostCommit && + onPostCommit( + id, + phase, + finishedRoot.passiveEffectDuration, + commitStartTime + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } else + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); break; - case 3: - var prevProfilerEffectDuration = pushNestedEffectDurations(); - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.stateNode.passiveEffectDuration += popNestedEffectDurations( - prevProfilerEffectDuration + case 31: + flags = inHydratedSubtree; + isViewTransitionEligible = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + wasInHydratedSubtree = finishedWork.memoizedState; + null !== isViewTransitionEligible && null === wasInHydratedSubtree + ? ((wasInHydratedSubtree = finishedWork.deletions), + null !== wasInHydratedSubtree && + 0 < wasInHydratedSubtree.length && + 18 === wasInHydratedSubtree[0].tag + ? ((inHydratedSubtree = !1), + null !== isViewTransitionEligible.hydrationErrors && + logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime + )) + : (inHydratedSubtree = !0)) + : (inHydratedSubtree = !1); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime ); + inHydratedSubtree = flags; break; - case 12: - prevProfilerEffectDuration = pushNestedEffectDurations(); - recursivelyTraversePassiveUnmountEffects(finishedWork); - finishedWork.stateNode.passiveEffectDuration += - bubbleNestedEffectDurations(prevProfilerEffectDuration); + case 13: + flags = inHydratedSubtree; + isViewTransitionEligible = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + wasInHydratedSubtree = finishedWork.memoizedState; + null === isViewTransitionEligible || + null === isViewTransitionEligible.dehydrated || + (null !== wasInHydratedSubtree && + null !== wasInHydratedSubtree.dehydrated) + ? (inHydratedSubtree = !1) + : ((wasInHydratedSubtree = finishedWork.deletions), + null !== wasInHydratedSubtree && + 0 < wasInHydratedSubtree.length && + 18 === wasInHydratedSubtree[0].tag + ? ((inHydratedSubtree = !1), + null !== isViewTransitionEligible.hydrationErrors && + logComponentErrored( + finishedWork, + finishedWork.actualStartTime, + endTime + )) + : (inHydratedSubtree = !0)); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + inHydratedSubtree = flags; + break; + case 23: break; case 22: - prevProfilerEffectDuration = finishedWork.stateNode; - null !== finishedWork.memoizedState && - prevProfilerEffectDuration._visibility & 2 && - (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((prevProfilerEffectDuration._visibility &= -3), - recursivelyTraverseDisconnectPassiveEffects(finishedWork), - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - "Disconnect" - )) - : recursivelyTraversePassiveUnmountEffects(finishedWork); + id = finishedWork.stateNode; + wasInHydratedSubtree = finishedWork.alternate; + null !== finishedWork.memoizedState + ? (isViewTransitionEligible && + null !== wasInHydratedSubtree && + null === wasInHydratedSubtree.memoizedState && + restoreEnterOrExitViewTransitions(wasInHydratedSubtree), + id._visibility & 2 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + )) + : (isViewTransitionEligible && + null !== wasInHydratedSubtree && + null !== wasInHydratedSubtree.memoizedState && + restoreEnterOrExitViewTransitions(finishedWork), + id._visibility & 2 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) + : ((id._visibility |= 2), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) || + (0 !== finishedWork.actualDuration && + (null === finishedWork.alternate || + finishedWork.alternate.child !== finishedWork.child)), + endTime + ), + 0 === (finishedWork.mode & 2) || + inHydratedSubtree || + ((finishedRoot = finishedWork.actualStartTime), + 0 <= finishedRoot && + 0.05 < endTime - finishedRoot && + logComponentReappeared(finishedWork, finishedRoot, endTime), + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentReappeared( + finishedWork, + componentEffectStartTime, + componentEffectEndTime + )))); + flags & 2048 && + commitOffscreenPassiveMountEffects(wasInHydratedSubtree, finishedWork); + break; + case 24: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && + commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + break; + case 30: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); break; default: - recursivelyTraversePassiveUnmountEffects(finishedWork); - } - 0 !== (finishedWork.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - finishedWork, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - componentEffectErrors = prevEffectErrors; -} -function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { - var deletions = parentFiber.deletions; - if (0 !== (parentFiber.flags & 16)) { - if (null !== deletions) - for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i], - prevEffectStart = pushComponentEffectStart(); - nextEffect = childToDelete; - commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - childToDelete, - parentFiber - ); - 0 !== (childToDelete.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - 0.05 < componentEffectEndTime - componentEffectStartTime && - logComponentTrigger( - childToDelete, - componentEffectStartTime, - componentEffectEndTime, - "Unmount" - ); - popComponentEffectStart(prevEffectStart); - } - detachAlternateSiblings(parentFiber); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); } - for (parentFiber = parentFiber.child; null !== parentFiber; ) { - deletions = parentFiber; - i = pushComponentEffectStart(); - childToDelete = pushComponentEffectDuration(); - prevEffectStart = pushComponentEffectErrors(); - var prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (deletions.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects(deletions, deletions.return, 8); - recursivelyTraverseDisconnectPassiveEffects(deletions); - break; - case 22: - var instance = deletions.stateNode; - instance._visibility & 2 && - ((instance._visibility &= -3), - recursivelyTraverseDisconnectPassiveEffects(deletions)); - break; - default: - recursivelyTraverseDisconnectPassiveEffects(deletions); - } - 0 !== (deletions.mode & 2) && - 0 <= componentEffectStartTime && + if (0 !== (finishedWork.mode & 2)) { + if ( + (finishedRoot = + !inHydratedSubtree && + null === finishedWork.alternate && + null !== finishedWork.return && + null !== finishedWork.return.alternate) + ) + (committedLanes = finishedWork.actualStartTime), + 0 <= committedLanes && + 0.05 < endTime - committedLanes && + logComponentTrigger(finishedWork, committedLanes, endTime, "Mount"); + 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - deletions, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(i); - popComponentEffectDuration(childToDelete); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - componentEffectErrors = prevEffectStart; - parentFiber = parentFiber.sibling; + ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ), + finishedRoot && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Mount" + )); } + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; } -function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( - deletedSubtreeRoot, - nearestMountedAncestor$jscomp$0 +function recursivelyTraverseReconnectPassiveEffects( + finishedRoot$jscomp$0, + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + includeWorkInProgressEffects, + endTime$jscomp$0 ) { - for (; null !== nextEffect; ) { - var fiber = nextEffect, - nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + includeWorkInProgressEffects = + includeWorkInProgressEffects && + (0 !== (parentFiber.subtreeFlags & 10256) || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child))); + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; + var finishedRoot = finishedRoot$jscomp$0, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0, prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), - prevEffectErrors = pushComponentEffectErrors(), - prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); - switch (fiber.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects(fiber, nearestMountedAncestor, 8); - break; - case 23: - case 22: - null !== fiber.memoizedState && - null !== fiber.memoizedState.cachePool && - ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), - null != nearestMountedAncestor && nearestMountedAncestor.refCount++); - break; - case 24: - releaseCache(fiber.memoizedState.cache); - } - 0 !== (fiber.mode & 2) && - 0 <= componentEffectStartTime && - 0 <= componentEffectEndTime && - (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && - logComponentEffect( - fiber, - componentEffectStartTime, - componentEffectEndTime, - componentEffectDuration, - componentEffectErrors - ); - popComponentEffectStart(prevEffectStart); - popComponentEffectDuration(prevEffectDuration); - componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; - componentEffectErrors = prevEffectErrors; - prevEffectStart = fiber.child; - if (null !== prevEffectStart) - (prevEffectStart.return = fiber), (nextEffect = prevEffectStart); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - prevEffectStart = nextEffect; - prevEffectDuration = prevEffectStart.sibling; - prevEffectErrors = prevEffectStart.return; - detachFiberAfterEffects(prevEffectStart); - if (prevEffectStart === fiber) { - nextEffect = null; - break a; - } - if (null !== prevEffectDuration) { - prevEffectDuration.return = prevEffectErrors; - nextEffect = prevEffectDuration; - break a; - } - nextEffect = prevEffectErrors; - } - } -} -var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - }, - cacheSignal: function () { - return readContext(CacheContext).controller.signal; - } - }, - PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, - executionContext = 0, - workInProgressRoot = null, - workInProgress = null, - workInProgressRootRenderLanes = 0, - workInProgressSuspendedReason = 0, - workInProgressThrownValue = null, - workInProgressRootDidSkipSuspendedSiblings = !1, - workInProgressRootIsPrerendering = !1, - workInProgressRootDidAttachPingListener = !1, - entangledRenderLanes = 0, - workInProgressRootExitStatus = 0, - workInProgressRootSkippedLanes = 0, - workInProgressRootInterleavedUpdatedLanes = 0, - workInProgressRootPingedLanes = 0, - workInProgressDeferredLane = 0, - workInProgressSuspendedRetryLanes = 0, - workInProgressRootConcurrentErrors = null, - workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - globalMostRecentFallbackTime = 0, - globalMostRecentTransitionTime = 0, - workInProgressRootRenderTargetTime = Infinity, - workInProgressTransitions = null, - legacyErrorBoundariesThatAlreadyFailed = null, - pendingEffectsStatus = 0, - pendingEffectsRoot = null, - pendingFinishedWork = null, - pendingEffectsLanes = 0, - pendingEffectsRemainingLanes = 0, - pendingEffectsRenderEndTime = -0, - pendingPassiveTransitions = null, - pendingRecoverableErrors = null, - pendingViewTransition = null, - pendingViewTransitionEvents = null, - pendingTransitionTypes = null, - pendingSuspendedCommitReason = null, - pendingDelayedCommitReason = 0, - pendingSuspendedViewTransitionReason = null, - nestedUpdateCount = 0, - rootWithNestedUpdates = null; -function requestUpdateLane(fiber) { - return 0 === (fiber.mode & 1) - ? 2 - : 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes - ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes - : null !== ReactSharedInternals.T - ? requestTransitionLane() - : resolveUpdatePriority(); -} -function requestDeferredLane() { - if (0 === workInProgressDeferredLane) - if (0 !== (workInProgressRootRenderLanes & 536870912)) - workInProgressDeferredLane = 536870912; - else { - var lane = nextTransitionDeferredLane; - nextTransitionDeferredLane <<= 1; - 0 === (nextTransitionDeferredLane & 3932160) && - (nextTransitionDeferredLane = 262144); - workInProgressDeferredLane = lane; - } - lane = suspenseHandlerStackCursor.current; - null !== lane && (lane.flags |= 32); - return workInProgressDeferredLane; -} -function scheduleViewTransitionEvent(fiber, callback) { - if (null != callback) { - var state = fiber.stateNode, - instance = state.ref; - null === instance && - (instance = state.ref = - createViewTransitionInstance( - getViewTransitionName(fiber.memoizedProps, state) - )); - null === pendingViewTransitionEvents && (pendingViewTransitionEvents = []); - pendingViewTransitionEvents.push(callback.bind(null, instance)); - } -} -function scheduleUpdateOnFiber(root, fiber, lane) { - if ( - (root === workInProgressRoot && - (2 === workInProgressSuspendedReason || - 9 === workInProgressSuspendedReason)) || - null !== root.cancelPendingCommit - ) - prepareFreshStack(root, 0), - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 - ); - markRootUpdated$1(root, lane); - if (0 === (executionContext & 2) || root !== workInProgressRoot) - isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), - root === workInProgressRoot && - (0 === (executionContext & 2) && - (workInProgressRootInterleavedUpdatedLanes |= lane), - 4 === workInProgressRootExitStatus && - markRootSuspended( - root, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 - )), - ensureRootIsScheduled(root), - 2 === lane && - 0 === executionContext && - 0 === (fiber.mode & 1) && - ((workInProgressRootRenderTargetTime = now$1() + 500), - flushSyncWorkAcrossRoots_impl(0, !0)); -} -function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { - if (0 !== (executionContext & 6)) - throw Error("Should not already be working."); - if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { - var yieldEndTime = now$1(); - switch (yieldReason) { - case 3: - case 2: - supportsUserTiming && - console.timeStamp( - "Suspended", - yieldStartTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - ); - break; - case 9: - supportsUserTiming && - console.timeStamp( - "Action", - yieldStartTime, - yieldEndTime, - "Components \u269b", - void 0, - "primary-light" - ); + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + includeWorkInProgressEffects && + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = child.flags; + switch (child.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ); + commitHookPassiveMountEffects(child, 8); break; - default: - if (supportsUserTiming) { - var yieldDuration = yieldEndTime - yieldStartTime; - 3 > yieldDuration || - console.timeStamp( - "Blocked", - yieldStartTime, - yieldEndTime, - "Components \u269b", - void 0, - 5 > yieldDuration - ? "primary-light" - : 10 > yieldDuration - ? "primary" - : 100 > yieldDuration - ? "primary-dark" - : "error" - ); - } - } - } - var exitStatus = (yieldEndTime = - (!forceSync && - 0 === (lanes & 127) && - 0 === (lanes & root$jscomp$0.expiredLanes)) || - checkIfRootIsPrerendering(root$jscomp$0, lanes)) - ? renderRootConcurrent(root$jscomp$0, lanes) - : renderRootSync(root$jscomp$0, lanes, !0), - renderWasConcurrent = yieldEndTime; - do { - if (0 === exitStatus) { - workInProgressRootIsPrerendering && - !yieldEndTime && - markRootSuspended(root$jscomp$0, lanes, 0, !1); - lanes = workInProgressSuspendedReason; - yieldStartTime = now(); - yieldReason = lanes; - break; - } else { - yieldDuration = now$1(); - forceSync = root$jscomp$0.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) - ) { - setCurrentTrackFromLanes(lanes); - !supportsUserTiming || - yieldDuration <= renderStartTime || - console.timeStamp( - "Teared Render", - renderStartTime, - yieldDuration, - currentTrack, - "Scheduler \u269b", - "error" - ); - finalizeRender(lanes, yieldDuration); - exitStatus = renderRootSync(root$jscomp$0, lanes, !1); - renderWasConcurrent = !1; - continue; - } - if (0 !== root$jscomp$0.tag && 2 === exitStatus) { - renderWasConcurrent = lanes; - if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) - var JSCompiler_inline_result = 0; - else - (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), - (JSCompiler_inline_result = - 0 !== JSCompiler_inline_result - ? JSCompiler_inline_result - : JSCompiler_inline_result & 536870912 - ? 536870912 - : 0); - if (0 !== JSCompiler_inline_result) { - setCurrentTrackFromLanes(lanes); - logErroredRenderPhase(renderStartTime, yieldDuration); - finalizeRender(lanes, yieldDuration); - lanes = JSCompiler_inline_result; - var root = root$jscomp$0; - yieldDuration = workInProgressRootConcurrentErrors; - exitStatus = renderRootSync(root, JSCompiler_inline_result, !1); - 6 === exitStatus - ? (root.errorRecoveryDisabledLanes = - root.errorRecoveryDisabledLanes | - renderWasConcurrent | - workInProgressDeferredLane) - : 2 !== exitStatus && - (workInProgressRootDidAttachPingListener - ? ((root.errorRecoveryDisabledLanes |= renderWasConcurrent), - (workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent), - (exitStatus = 4)) - : ((renderWasConcurrent = workInProgressRootRecoverableErrors), - (workInProgressRootRecoverableErrors = yieldDuration), - null !== renderWasConcurrent && - ((yieldDuration = renderWasConcurrent), - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = yieldDuration) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - yieldDuration - )))); - renderWasConcurrent = !1; - if (2 !== exitStatus) continue; - else yieldDuration = now$1(); - } - } - if (1 === exitStatus) { - setCurrentTrackFromLanes(lanes); - logErroredRenderPhase(renderStartTime, yieldDuration); - finalizeRender(lanes, yieldDuration); - prepareFreshStack(root$jscomp$0, 0); - markRootSuspended(root$jscomp$0, lanes, 0, !0); + case 23: break; - } - a: { - yieldEndTime = root$jscomp$0; - renderWasConcurrent = exitStatus; - switch (renderWasConcurrent) { - case 0: - case 1: - throw Error("Root did not complete. This is a bug in React."); - case 4: - if ((lanes & 4194048) !== lanes && (lanes & 62914560) !== lanes) - break; - case 6: - setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, yieldDuration, lanes); - finalizeRender(lanes, yieldDuration); - forceSync = lanes; - 0 !== (forceSync & 127) - ? (blockingSuspendedTime = yieldDuration) - : 0 !== (forceSync & 4194048) && - (transitionSuspendedTime = yieldDuration); - markRootSuspended( - yieldEndTime, - lanes, - workInProgressDeferredLane, - !workInProgressRootDidSkipSuspendedSiblings - ); - break a; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error("Unknown root exit status."); - } - if ( - (lanes & 62914560) === lanes && - 3 === renderWasConcurrent && - ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - yieldEndTime, - lanes, - workInProgressDeferredLane, - !workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(yieldEndTime, 0, !0)) break a; - pendingEffectsLanes = lanes; - yieldEndTime.timeoutHandle = scheduleTimeout( - completeRootWhenReady.bind( - null, - yieldEndTime, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - "Throttled", - renderStartTime, - yieldDuration - ), - exitStatus - ); - break a; - } - completeRootWhenReady( - yieldEndTime, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - null, - renderStartTime, - yieldDuration + case 22: + var instance = child.stateNode; + null !== child.memoizedState + ? instance._visibility & 2 + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ) + : ((instance._visibility |= 2), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects(child.alternate, child); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime + ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect(child.alternate, child); + break; + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + includeWorkInProgressEffects, + endTime ); - } } - break; - } while (1); - ensureRootIsScheduled(root$jscomp$0); + 0 !== (child.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + child, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectErrors = prevEffectErrors; + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + child = parentFiber; + } } -function completeRootWhenReady( - root, - finishedWork, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime +function recursivelyTraverseAtomicPassiveEffects( + finishedRoot$jscomp$0, + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { - root.timeoutHandle = -1; - didIncludeRenderPhaseUpdate = finishedWork.subtreeFlags; - didSkipSuspendedSiblings = (lanes & 335544064) === lanes; - var suspendedState = null; if ( - didSkipSuspendedSiblings || - didIncludeRenderPhaseUpdate & 8192 || - 16785408 === (didIncludeRenderPhaseUpdate & 16785408) + parentFiber.subtreeFlags & 10256 || + (0 !== parentFiber.actualDuration && + (null === parentFiber.alternate || + parentFiber.alternate.child !== parentFiber.child)) ) - (appearingViewTransitions = suspendedState = null), - accumulateSuspenseyCommitOnFiber(finishedWork), - didSkipSuspendedSiblings && - null != fabricSuspendOnActiveViewTransition && - fabricSuspendOnActiveViewTransition(), - (lanes & 62914560) === lanes - ? globalMostRecentFallbackTime - now$1() - : (lanes & 4194048) === lanes - ? globalMostRecentTransitionTime - now$1() - : 0; - didIncludeRenderPhaseUpdate = suspendedState; - root.cancelPendingCommit = null; - do flushPendingEffects(); - while (0 !== pendingEffectsStatus); - if (0 !== (executionContext & 6)) - throw Error("Should not already be working."); - setCurrentTrackFromLanes(lanes); - 2 === exitStatus - ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) - : null !== recoverableErrors - ? !supportsUserTiming || - completedRenderEndTime <= completedRenderStartTime || - console.timeStamp( - "Recovered", - completedRenderStartTime, - completedRenderEndTime, - currentTrack, - "Scheduler \u269b", - "error" - ) - : !supportsUserTiming || - completedRenderEndTime <= completedRenderStartTime || - console.timeStamp( - (lanes & 536870912) === lanes - ? "Prepared" - : (lanes & 201326741) === lanes - ? "Hydrated" - : "Render", - completedRenderStartTime, - completedRenderEndTime, - currentTrack, - "Scheduler \u269b", - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; + var finishedRoot = finishedRoot$jscomp$0, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0; + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree ); - if (null !== finishedWork) { - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingDelayedCommitReason = 0; - pendingSuspendedViewTransitionReason = null; - commitRoot( - root, - finishedWork, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - didIncludeRenderPhaseUpdate, - suspendedCommitReason, - completedRenderEndTime - ); - } + var flags = child.flags; + switch (child.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && + commitOffscreenPassiveMountEffects(child.alternate, child); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && commitCachePassiveMountEffect(child.alternate, child); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + } + child = parentFiber; + } } -function isRenderConsistentWithExternalStores(finishedWork) { - for (var node = finishedWork; ; ) { - var tag = node.tag; - if ( - (0 === tag || 11 === tag || 15 === tag) && - node.flags & 16384 && - ((tag = node.updateQueue), - null !== tag && ((tag = tag.stores), null !== tag)) - ) - for (var i = 0; i < tag.length; i++) { - var check = tag[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } +var suspenseyCommitFlag = 8192; +function recursivelyAccumulateSuspenseyCommit(parentFiber) { + if (parentFiber.subtreeFlags & suspenseyCommitFlag) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + accumulateSuspenseyCommitOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); +} +function accumulateSuspenseyCommitOnFiber(fiber) { + switch (fiber.tag) { + case 26: + recursivelyAccumulateSuspenseyCommit(fiber); + fiber.flags & suspenseyCommitFlag && + null !== fiber.memoizedState && + shim(); + break; + case 5: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 3: + case 4: + recursivelyAccumulateSuspenseyCommit(fiber); + break; + case 22: + if (null === fiber.memoizedState) { + var current = fiber.alternate; + null !== current && null !== current.memoizedState + ? ((current = suspenseyCommitFlag), + (suspenseyCommitFlag = 16777216), + recursivelyAccumulateSuspenseyCommit(fiber), + (suspenseyCommitFlag = current)) + : recursivelyAccumulateSuspenseyCommit(fiber); } - tag = node.child; - if (node.subtreeFlags & 16384 && null !== tag) - (tag.return = node), (node = tag); - else { - if (node === finishedWork) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === finishedWork) return !0; - node = node.return; + break; + case 30: + if ( + 0 !== (fiber.flags & suspenseyCommitFlag) && + ((current = fiber.memoizedProps.name), + null != current && "auto" !== current) + ) { + var state = fiber.stateNode; + state.paired = null; + null === appearingViewTransitions && + (appearingViewTransitions = new Map()); + appearingViewTransitions.set(current, state); } - node.sibling.return = node.return; - node = node.sibling; - } + recursivelyAccumulateSuspenseyCommit(fiber); + break; + default: + recursivelyAccumulateSuspenseyCommit(fiber); } - return !0; } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didAttemptEntireTree -) { - suspendedLanes = getEntangledLanes(root, suspendedLanes); - suspendedLanes &= ~workInProgressRootPingedLanes; - suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; - root.suspendedLanes |= suspendedLanes; - root.pingedLanes &= ~suspendedLanes; - didAttemptEntireTree && (root.warmLanes |= suspendedLanes); - didAttemptEntireTree = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$8 = 31 - clz32(lanes), - lane = 1 << index$8; - didAttemptEntireTree[index$8] = -1; - lanes &= ~lane; +function detachAlternateSiblings(parentFiber) { + var previousFiber = parentFiber.alternate; + if ( + null !== previousFiber && + ((parentFiber = previousFiber.child), null !== parentFiber) + ) { + previousFiber.child = null; + do + (previousFiber = parentFiber.sibling), + (parentFiber.sibling = null), + (parentFiber = previousFiber); + while (null !== parentFiber); } - 0 !== spawnedLane && - markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function resetWorkInProgressStack() { - if (null !== workInProgress) { - if (0 === workInProgressSuspendedReason) - var interruptedWork = workInProgress.return; - else - (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber$1 = null), - resetHooksOnUnwind(interruptedWork), - (thenableState$1 = null), - (thenableIndexCounter$1 = 0), - (interruptedWork = workInProgress); - for (; null !== interruptedWork; ) - unwindInterruptedWork(interruptedWork.alternate, interruptedWork), - (interruptedWork = interruptedWork.return); - workInProgress = null; +function recursivelyTraversePassiveUnmountEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i], + prevEffectStart = pushComponentEffectStart(); + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber + ); + 0 !== (childToDelete.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + childToDelete, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + } + detachAlternateSiblings(parentFiber); } + if (parentFiber.subtreeFlags & 10256) + for (parentFiber = parentFiber.child; null !== parentFiber; ) + commitPassiveUnmountOnFiber(parentFiber), + (parentFiber = parentFiber.sibling); } -function finalizeRender(lanes, finalizationTime) { - 0 !== (lanes & 127) && (blockingClampTime = finalizationTime); - 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); - 0 !== (lanes & 62914560) && (retryClampTime = finalizationTime); - 0 !== (lanes & 2080374784) && (idleClampTime = finalizationTime); +function commitPassiveUnmountOnFiber(finishedWork) { + var prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.flags & 2048 && + commitHookPassiveUnmountEffects(finishedWork, finishedWork.return, 9); + break; + case 3: + var prevProfilerEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += popNestedEffectDurations( + prevProfilerEffectDuration + ); + break; + case 12: + prevProfilerEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + bubbleNestedEffectDurations(prevProfilerEffectDuration); + break; + case 22: + prevProfilerEffectDuration = finishedWork.stateNode; + null !== finishedWork.memoizedState && + prevProfilerEffectDuration._visibility & 2 && + (null === finishedWork.return || 13 !== finishedWork.return.tag) + ? ((prevProfilerEffectDuration._visibility &= -3), + recursivelyTraverseDisconnectPassiveEffects(finishedWork), + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + "Disconnect" + )) + : recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + default: + recursivelyTraversePassiveUnmountEffects(finishedWork); + } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectErrors; } -function prepareFreshStack(root, lanes) { - supportsUserTiming && - (console.timeStamp( - "Blocking Track", - 0.003, - 0.003, - "Blocking", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Transition Track", - 0.003, - 0.003, - "Transition", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Suspense Track", - 0.003, - 0.003, - "Suspense", - "Scheduler \u269b", - "primary-light" - ), - console.timeStamp( - "Idle Track", - 0.003, - 0.003, - "Idle", - "Scheduler \u269b", - "primary-light" - )); - var previousRenderStartTime = renderStartTime; - renderStartTime = now(); - if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) { - setCurrentTrackFromLanes(workInProgressRootRenderLanes); - if ( - 3 === workInProgressRootExitStatus || - 4 === workInProgressRootExitStatus - ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime, lanes); - else { - var endTime = renderStartTime; - !supportsUserTiming || - endTime <= previousRenderStartTime || - console.timeStamp( - (lanes & 536870912) === lanes - ? "Prewarm" - : (lanes & 201326741) === lanes - ? "Interrupted Hydration" - : "Interrupted Render", - previousRenderStartTime, - endTime, - currentTrack, - "Scheduler \u269b", - (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" +function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { + var deletions = parentFiber.deletions; + if (0 !== (parentFiber.flags & 16)) { + if (null !== deletions) + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i], + prevEffectStart = pushComponentEffectStart(); + nextEffect = childToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + childToDelete, + parentFiber ); + 0 !== (childToDelete.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectEndTime - componentEffectStartTime && + logComponentTrigger( + childToDelete, + componentEffectStartTime, + componentEffectEndTime, + "Unmount" + ); + popComponentEffectStart(prevEffectStart); + } + detachAlternateSiblings(parentFiber); + } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + deletions = parentFiber; + i = pushComponentEffectStart(); + childToDelete = pushComponentEffectDuration(); + prevEffectStart = pushComponentEffectErrors(); + var prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects(deletions, deletions.return, 8); + recursivelyTraverseDisconnectPassiveEffects(deletions); + break; + case 22: + var instance = deletions.stateNode; + instance._visibility & 2 && + ((instance._visibility &= -3), + recursivelyTraverseDisconnectPassiveEffects(deletions)); + break; + default: + recursivelyTraverseDisconnectPassiveEffects(deletions); } - finalizeRender(workInProgressRootRenderLanes, renderStartTime); - } - if (0 !== (lanes & 127)) { - previousRenderStartTime = - 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime - ? blockingClampTime - : blockingUpdateTime; - endTime = - 0 <= blockingEventTime && blockingEventTime < blockingClampTime - ? blockingClampTime - : blockingEventTime; - var clampedRenderStartTime$171 = - 0 <= endTime - ? endTime - : 0 <= previousRenderStartTime - ? previousRenderStartTime - : renderStartTime; - 0 <= blockingSuspendedTime - ? (setCurrentTrackFromLanes(2), - logSuspendedWithDelayPhase( - blockingSuspendedTime, - clampedRenderStartTime$171, - lanes - )) - : 0 !== (animatingLanes & 127) && - (setCurrentTrackFromLanes(2), - logAnimatingPhase(blockingClampTime, clampedRenderStartTime$171)); - clampedRenderStartTime$171 = blockingEventType; - var eventIsRepeat = 0 < blockingEventRepeatTime, - isSpawnedUpdate = 1 === blockingUpdateType, - isPingedUpdate = 2 === blockingUpdateType, - renderStartTime$jscomp$0 = renderStartTime; - supportsUserTiming && - ((currentTrack = "Blocking"), - 0 < previousRenderStartTime - ? previousRenderStartTime > renderStartTime$jscomp$0 && - (previousRenderStartTime = renderStartTime$jscomp$0) - : (previousRenderStartTime = renderStartTime$jscomp$0), - 0 < endTime - ? endTime > previousRenderStartTime && - (endTime = previousRenderStartTime) - : (endTime = previousRenderStartTime), - null !== clampedRenderStartTime$171 && - previousRenderStartTime > endTime && - console.timeStamp( - eventIsRepeat - ? "Consecutive" - : "Event: " + clampedRenderStartTime$171, - endTime, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - eventIsRepeat ? "secondary-light" : "warning" - ), - renderStartTime$jscomp$0 > previousRenderStartTime && - console.timeStamp( - isPingedUpdate - ? "Promise Resolved" - : isSpawnedUpdate - ? "Cascading Update" - : 5 < renderStartTime$jscomp$0 - previousRenderStartTime - ? "Update Blocked" - : "Update", - previousRenderStartTime, - renderStartTime$jscomp$0, - currentTrack, - "Scheduler \u269b", - isSpawnedUpdate - ? "error" - : (lanes & 738197653) === lanes - ? "tertiary-light" - : "primary-light" - )); - blockingUpdateTime = -1.1; - blockingUpdateType = 0; - blockingSuspendedTime = -1.1; - blockingEventRepeatTime = blockingEventTime; - blockingEventTime = -1.1; - blockingClampTime = now(); + 0 !== (deletions.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + deletions, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(i); + popComponentEffectDuration(childToDelete); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectStart; + parentFiber = parentFiber.sibling; + } +} +function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( + deletedSubtreeRoot, + nearestMountedAncestor$jscomp$0 +) { + for (; null !== nextEffect; ) { + var fiber = nextEffect, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(), + prevEffectDuration = pushComponentEffectDuration(), + prevEffectErrors = pushComponentEffectErrors(), + prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(); + switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects(fiber, nearestMountedAncestor, 8); + break; + case 23: + case 22: + null !== fiber.memoizedState && + null !== fiber.memoizedState.cachePool && + ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), + null != nearestMountedAncestor && nearestMountedAncestor.refCount++); + break; + case 24: + releaseCache(fiber.memoizedState.cache); + } + 0 !== (fiber.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && + logComponentEffect( + fiber, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration, + componentEffectErrors + ); + popComponentEffectStart(prevEffectStart); + popComponentEffectDuration(prevEffectDuration); + componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate; + componentEffectErrors = prevEffectErrors; + prevEffectStart = fiber.child; + if (null !== prevEffectStart) + (prevEffectStart.return = fiber), (nextEffect = prevEffectStart); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + prevEffectStart = nextEffect; + prevEffectDuration = prevEffectStart.sibling; + prevEffectErrors = prevEffectStart.return; + detachFiberAfterEffects(prevEffectStart); + if (prevEffectStart === fiber) { + nextEffect = null; + break a; + } + if (null !== prevEffectDuration) { + prevEffectDuration.return = prevEffectErrors; + nextEffect = prevEffectDuration; + break a; + } + nextEffect = prevEffectErrors; + } } - 0 !== (lanes & 4194048) && - ((previousRenderStartTime = - 0 <= transitionStartTime && transitionStartTime < transitionClampTime - ? transitionClampTime - : transitionStartTime), - (endTime = - 0 <= transitionUpdateTime && transitionUpdateTime < transitionClampTime - ? transitionClampTime - : transitionUpdateTime), - (clampedRenderStartTime$171 = - 0 <= transitionEventTime && transitionEventTime < transitionClampTime - ? transitionClampTime - : transitionEventTime), - (eventIsRepeat = - 0 <= clampedRenderStartTime$171 - ? clampedRenderStartTime$171 - : 0 <= endTime - ? endTime - : renderStartTime), - 0 <= transitionSuspendedTime - ? (setCurrentTrackFromLanes(256), - logSuspendedWithDelayPhase( - transitionSuspendedTime, - eventIsRepeat, - lanes - )) - : 0 !== (animatingLanes & 4194048) && - (setCurrentTrackFromLanes(256), - logAnimatingPhase(transitionClampTime, eventIsRepeat)), - (eventIsRepeat = transitionEventType), - (isSpawnedUpdate = 0 < transitionEventRepeatTime), - (isPingedUpdate = 2 === transitionUpdateType), - (renderStartTime$jscomp$0 = renderStartTime), - supportsUserTiming && - ((currentTrack = "Transition"), - 0 < endTime - ? endTime > renderStartTime$jscomp$0 && - (endTime = renderStartTime$jscomp$0) - : (endTime = renderStartTime$jscomp$0), - 0 < previousRenderStartTime - ? previousRenderStartTime > endTime && - (previousRenderStartTime = endTime) - : (previousRenderStartTime = endTime), - 0 < clampedRenderStartTime$171 - ? clampedRenderStartTime$171 > previousRenderStartTime && - (clampedRenderStartTime$171 = previousRenderStartTime) - : (clampedRenderStartTime$171 = previousRenderStartTime), - previousRenderStartTime > clampedRenderStartTime$171 && - null !== eventIsRepeat && - console.timeStamp( - isSpawnedUpdate ? "Consecutive" : "Event: " + eventIsRepeat, - clampedRenderStartTime$171, - previousRenderStartTime, - currentTrack, - "Scheduler \u269b", - isSpawnedUpdate ? "secondary-light" : "warning" - ), - endTime > previousRenderStartTime && - console.timeStamp( - "Action", - previousRenderStartTime, - endTime, - currentTrack, - "Scheduler \u269b", - "primary-dark" - ), - renderStartTime$jscomp$0 > endTime && - console.timeStamp( - isPingedUpdate - ? "Promise Resolved" - : 5 < renderStartTime$jscomp$0 - endTime - ? "Update Blocked" - : "Update", - endTime, - renderStartTime$jscomp$0, - currentTrack, - "Scheduler \u269b", - "primary-light" - )), - (transitionUpdateTime = transitionStartTime = -1.1), - (transitionUpdateType = 0), - (transitionSuspendedTime = -1.1), - (transitionEventRepeatTime = transitionEventTime), - (transitionEventTime = -1.1), - (transitionClampTime = now())); - 0 !== (lanes & 62914560) && - 0 !== (animatingLanes & 62914560) && - (setCurrentTrackFromLanes(4194304), - logAnimatingPhase(retryClampTime, renderStartTime)); - 0 !== (lanes & 2080374784) && - 0 !== (animatingLanes & 2080374784) && - (setCurrentTrackFromLanes(268435456), - logAnimatingPhase(idleClampTime, renderStartTime)); - previousRenderStartTime = root.timeoutHandle; - -1 !== previousRenderStartTime && - ((root.timeoutHandle = -1), cancelTimeout(previousRenderStartTime)); - previousRenderStartTime = root.cancelPendingCommit; - null !== previousRenderStartTime && - ((root.cancelPendingCommit = null), previousRenderStartTime()); - pendingEffectsLanes = 0; - resetWorkInProgressStack(); - workInProgressRoot = root; - workInProgress = previousRenderStartTime = createWorkInProgress( - root.current, - null - ); - workInProgressRootRenderLanes = lanes; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; - workInProgressSuspendedRetryLanes = - workInProgressDeferredLane = - workInProgressRootPingedLanes = - workInProgressRootInterleavedUpdatedLanes = - workInProgressRootSkippedLanes = - workInProgressRootExitStatus = - 0; - workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = - null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - entangledRenderLanes = getEntangledLanes(root, lanes); - finishQueueingConcurrentUpdates(); - return previousRenderStartTime; } -function handleThrow(root, thrownValue) { - currentlyRenderingFiber = null; - ReactSharedInternals.H = ContextOnlyDispatcher; - thrownValue === SuspenseException || thrownValue === SuspenseActionException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = 3)) - : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = 4)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? 8 - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); - workInProgressThrownValue = thrownValue; - var erroredWork = workInProgress; - null === erroredWork - ? ((workInProgressRootExitStatus = 1), - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - )) - : erroredWork.mode & 2 && - stopProfilerTimerIfRunningAndRecordDuration(erroredWork); +var DefaultAsyncDispatcher = { + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + }, + cacheSignal: function () { + return readContext(CacheContext).controller.signal; + }, + units: null + }, + PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + workInProgressSuspendedReason = 0, + workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, + workInProgressRootDidAttachPingListener = !1, + entangledRenderLanes = 0, + workInProgressRootExitStatus = 0, + workInProgressRootSkippedLanes = 0, + workInProgressRootInterleavedUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, + workInProgressRootConcurrentErrors = null, + workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + globalMostRecentFallbackTime = 0, + globalMostRecentTransitionTime = 0, + workInProgressRootRenderTargetTime = Infinity, + workInProgressTransitions = null, + legacyErrorBoundariesThatAlreadyFailed = null, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, + pendingEffectsRenderEndTime = -0, + pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingViewTransition = null, + pendingViewTransitionEvents = null, + pendingTransitionTypes = null, + pendingSuspendedCommitReason = null, + pendingDelayedCommitReason = 0, + pendingSuspendedViewTransitionReason = null, + nestedUpdateCount = 0, + rootWithNestedUpdates = null; +function requestUpdateLane() { + return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? requestTransitionLane() + : resolveUpdatePriority(); } -function pushDispatcher() { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = ContextOnlyDispatcher; - return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; +function requestDeferredLane() { + if (0 === workInProgressDeferredLane) + if (0 !== (workInProgressRootRenderLanes & 536870912)) + workInProgressDeferredLane = 536870912; + else { + var lane = nextTransitionDeferredLane; + nextTransitionDeferredLane <<= 1; + 0 === (nextTransitionDeferredLane & 3932160) && + (nextTransitionDeferredLane = 262144); + workInProgressDeferredLane = lane; + } + lane = suspenseHandlerStackCursor.current; + null !== lane && (lane.flags |= 32); + return workInProgressDeferredLane; } -function pushAsyncDispatcher() { - var prevAsyncDispatcher = ReactSharedInternals.A; - ReactSharedInternals.A = DefaultAsyncDispatcher; - return prevAsyncDispatcher; +function scheduleViewTransitionEvent(fiber, callback) { + if (null != callback) { + var state = fiber.stateNode, + instance = state.ref; + null === instance && + (instance = state.ref = + createViewTransitionInstance( + getViewTransitionName(fiber.memoizedProps, state) + )); + null === pendingViewTransitionEvents && (pendingViewTransitionEvents = []); + pendingViewTransitionEvents.push(callback.bind(null, instance)); + } } -function renderDidSuspendDelayIfPossible() { - workInProgressRootExitStatus = 4; - workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194048) !== - workInProgressRootRenderLanes && - null !== suspenseHandlerStackCursor.current) || - (workInProgressRootIsPrerendering = !0); - (0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || - null === workInProgressRoot || - markRootSuspended( - workInProgressRoot, - workInProgressRootRenderLanes, - workInProgressDeferredLane, - !1 - ); +function scheduleUpdateOnFiber(root, fiber, lane) { + if ( + (root === workInProgressRoot && + (2 === workInProgressSuspendedReason || + 9 === workInProgressSuspendedReason)) || + null !== root.cancelPendingCommit + ) + prepareFreshStack(root, 0), + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 + ); + markRootUpdated$1(root, lane); + if (0 === (executionContext & 2) || root !== workInProgressRoot) + isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), + root === workInProgressRoot && + (0 === (executionContext & 2) && + (workInProgressRootInterleavedUpdatedLanes |= lane), + 4 === workInProgressRootExitStatus && + markRootSuspended( + root, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 + )), + ensureRootIsScheduled(root); } -function renderRootSync(root, lanes, shouldYieldForPrerendering) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { - if (isDevToolsPresent) { - var memoizedUpdaters = root.memoizedUpdaters; - 0 < memoizedUpdaters.size && - (restorePendingUpdaters(root, workInProgressRootRenderLanes), - memoizedUpdaters.clear()); - movePendingFibersToMemoized(root, lanes); - } - workInProgressTransitions = null; - prepareFreshStack(root, lanes); - } - lanes = !1; - memoizedUpdaters = workInProgressRootExitStatus; - a: do - try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; - switch (workInProgressSuspendedReason) { - case 8: - resetWorkInProgressStack(); - memoizedUpdaters = 6; - break a; - case 3: - case 2: - case 9: - case 6: - null === suspenseHandlerStackCursor.current && (lanes = !0); - var reason = workInProgressSuspendedReason; - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - if ( - shouldYieldForPrerendering && - workInProgressRootIsPrerendering - ) { - memoizedUpdaters = 0; - break a; - } - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { + if (0 !== (executionContext & 6)) + throw Error("Should not already be working."); + if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { + var yieldEndTime = now$1(); + switch (yieldReason) { + case 3: + case 2: + supportsUserTiming && + console.timeStamp( + "Suspended", + yieldStartTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + ); + break; + case 9: + supportsUserTiming && + console.timeStamp( + "Action", + yieldStartTime, + yieldEndTime, + "Components \u269b", + void 0, + "primary-light" + ); + break; + default: + if (supportsUserTiming) { + var yieldDuration = yieldEndTime - yieldStartTime; + 3 > yieldDuration || + console.timeStamp( + "Blocked", + yieldStartTime, + yieldEndTime, + "Components \u269b", + void 0, + 5 > yieldDuration + ? "primary-light" + : 10 > yieldDuration + ? "primary" + : 100 > yieldDuration + ? "primary-dark" + : "error" + ); } - } - workLoopSync(); - memoizedUpdaters = workInProgressRootExitStatus; - break; - } catch (thrownValue$176) { - handleThrow(root, thrownValue$176); - } - while (1); - lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber$1 = null; - executionContext = prevExecutionContext; - ReactSharedInternals.H = prevDispatcher; - ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return memoizedUpdaters; -} -function workLoopSync() { - for (; null !== workInProgress; ) performUnitOfWork(workInProgress); -} -function renderRootConcurrent(root, lanes) { - var prevExecutionContext = executionContext; - executionContext |= 2; - var prevDispatcher = pushDispatcher(), - prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { - if (isDevToolsPresent) { - var memoizedUpdaters = root.memoizedUpdaters; - 0 < memoizedUpdaters.size && - (restorePendingUpdaters(root, workInProgressRootRenderLanes), - memoizedUpdaters.clear()); - movePendingFibersToMemoized(root, lanes); } - workInProgressTransitions = null; - workInProgressRootRenderTargetTime = now$1() + 500; - prepareFreshStack(root, lanes); - } else - workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); - a: do - try { - if (0 !== workInProgressSuspendedReason && null !== workInProgress) - b: switch ( - ((lanes = workInProgress), - (memoizedUpdaters = workInProgressThrownValue), - workInProgressSuspendedReason) - ) { + } + var exitStatus = (yieldEndTime = + (!forceSync && + 0 === (lanes & 127) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + checkIfRootIsPrerendering(root$jscomp$0, lanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0), + renderWasConcurrent = yieldEndTime; + do { + if (0 === exitStatus) { + workInProgressRootIsPrerendering && + !yieldEndTime && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + lanes = workInProgressSuspendedReason; + yieldStartTime = now(); + yieldReason = lanes; + break; + } else { + yieldDuration = now$1(); + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + setCurrentTrackFromLanes(lanes); + !supportsUserTiming || + yieldDuration <= renderStartTime || + console.timeStamp( + "Teared Render", + renderStartTime, + yieldDuration, + currentTrack, + "Scheduler \u269b", + "error" + ); + finalizeRender(lanes, yieldDuration); + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + renderWasConcurrent = !1; + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase(renderStartTime, yieldDuration); + finalizeRender(lanes, yieldDuration); + lanes = JSCompiler_inline_result; + var root = root$jscomp$0; + yieldDuration = workInProgressRootConcurrentErrors; + exitStatus = renderRootSync(root, JSCompiler_inline_result, !1); + 6 === exitStatus + ? (root.errorRecoveryDisabledLanes = + root.errorRecoveryDisabledLanes | + renderWasConcurrent | + workInProgressDeferredLane) + : 2 !== exitStatus && + (workInProgressRootDidAttachPingListener + ? ((root.errorRecoveryDisabledLanes |= renderWasConcurrent), + (workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent), + (exitStatus = 4)) + : ((renderWasConcurrent = workInProgressRootRecoverableErrors), + (workInProgressRootRecoverableErrors = yieldDuration), + null !== renderWasConcurrent && + ((yieldDuration = renderWasConcurrent), + null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = yieldDuration) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + yieldDuration + )))); + renderWasConcurrent = !1; + if (2 !== exitStatus) continue; + else yieldDuration = now$1(); + } + } + if (1 === exitStatus) { + setCurrentTrackFromLanes(lanes); + logErroredRenderPhase(renderStartTime, yieldDuration); + finalizeRender(lanes, yieldDuration); + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + yieldEndTime = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: case 1: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); - break; - case 2: - case 9: - if (isThenableResolved(memoizedUpdaters)) { - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - replaySuspendedUnitOfWork(lanes); - break; - } - lanes = function () { - (2 !== workInProgressSuspendedReason && - 9 !== workInProgressSuspendedReason) || - workInProgressRoot !== root || - (workInProgressSuspendedReason = 7); - ensureRootIsScheduled(root); - }; - memoizedUpdaters.then(lanes, lanes); - break a; - case 3: - workInProgressSuspendedReason = 7; - break a; + throw Error("Root did not complete. This is a bug in React."); case 4: - workInProgressSuspendedReason = 5; + if ((lanes & 4194048) !== lanes && (lanes & 62914560) !== lanes) + break; + case 6: + setCurrentTrackFromLanes(lanes); + logSuspendedRenderPhase(renderStartTime, yieldDuration, lanes); + finalizeRender(lanes, yieldDuration); + forceSync = lanes; + 0 !== (forceSync & 127) + ? (blockingSuspendedTime = yieldDuration) + : 0 !== (forceSync & 4194048) && + (transitionSuspendedTime = yieldDuration); + markRootSuspended( + yieldEndTime, + lanes, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); break a; - case 7: - isThenableResolved(memoizedUpdaters) - ? ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - replaySuspendedUnitOfWork(lanes)) - : ((workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); + case 2: + workInProgressRootRecoverableErrors = null; break; + case 3: case 5: - var resource = null; - switch (workInProgress.tag) { - case 26: - resource = workInProgress.memoizedState; - case 5: - case 27: - var hostFiber = workInProgress; - if (resource ? shim(resource) : 1) { - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - var sibling = hostFiber.sibling; - if (null !== sibling) workInProgress = sibling; - else { - var returnFiber = hostFiber.return; - null !== returnFiber - ? ((workInProgress = returnFiber), - completeUnitOfWork(returnFiber)) - : (workInProgress = null); - } - break b; - } - } - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); - break; - case 6: - workInProgressSuspendedReason = 0; - workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); break; - case 8: - resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; - break a; default: - throw Error("Unexpected SuspendedReason. This is a bug in React."); + throw Error("Unknown root exit status."); + } + if ( + (lanes & 62914560) === lanes && + 3 === renderWasConcurrent && + ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), + 10 < exitStatus) + ) { + markRootSuspended( + yieldEndTime, + lanes, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(yieldEndTime, 0, !0)) break a; + pendingEffectsLanes = lanes; + yieldEndTime.timeoutHandle = scheduleTimeout( + completeRootWhenReady.bind( + null, + yieldEndTime, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + renderWasConcurrent, + "Throttled", + renderStartTime, + yieldDuration + ), + exitStatus + ); + break a; } - workLoopConcurrentByScheduler(); - break; - } catch (thrownValue$178) { - handleThrow(root, thrownValue$178); + completeRootWhenReady( + yieldEndTime, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + renderWasConcurrent, + null, + renderStartTime, + yieldDuration + ); + } } - while (1); - lastContextDependency = currentlyRenderingFiber$1 = null; - ReactSharedInternals.H = prevDispatcher; - ReactSharedInternals.A = prevAsyncDispatcher; - executionContext = prevExecutionContext; - if (null !== workInProgress) return 0; - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; -} -function workLoopConcurrentByScheduler() { - for (; null !== workInProgress && !shouldYield(); ) - performUnitOfWork(workInProgress); -} -function performUnitOfWork(unitOfWork) { - var current = unitOfWork.alternate; - 0 !== (unitOfWork.mode & 2) - ? (startProfilerTimer(unitOfWork), - (current = beginWork(current, unitOfWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) - : (current = beginWork(current, unitOfWork, entangledRenderLanes)); - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === current - ? completeUnitOfWork(unitOfWork) - : (workInProgress = current); -} -function replaySuspendedUnitOfWork(unitOfWork) { - var next = unitOfWork; - var current = next.alternate, - isProfilingMode = 0 !== (next.mode & 2); - isProfilingMode && startProfilerTimer(next); - switch (next.tag) { - case 15: - case 0: - current = replayFunctionComponent( - current, - next, - next.pendingProps, - next.type, - void 0, - workInProgressRootRenderLanes - ); - break; - case 11: - current = replayFunctionComponent( - current, - next, - next.pendingProps, - next.type.render, - next.ref, - workInProgressRootRenderLanes - ); - break; - case 5: - resetHooksOnUnwind(next); - default: - unwindInterruptedWork(current, next), - (next = workInProgress = - resetWorkInProgress(next, entangledRenderLanes)), - (current = beginWork(current, next, entangledRenderLanes)); - } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); - next = current; - unitOfWork.memoizedProps = unitOfWork.pendingProps; - null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } -function throwAndUnwindWorkLoop( +function completeRootWhenReady( root, - unitOfWork, - thrownValue, - suspendedReason + finishedWork, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + exitStatus, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - lastContextDependency = currentlyRenderingFiber$1 = null; - resetHooksOnUnwind(unitOfWork); - thenableState$1 = null; - thenableIndexCounter$1 = 0; - var returnFiber = unitOfWork.return; - try { - if ( - throwException( - root, - returnFiber, - unitOfWork, - thrownValue, - workInProgressRootRenderLanes - ) - ) { - workInProgressRootExitStatus = 1; - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - ); - workInProgress = null; - return; - } - } catch (error) { - if (null !== returnFiber) throw ((workInProgress = returnFiber), error); - workInProgressRootExitStatus = 1; - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - ); - workInProgress = null; - return; - } - if (unitOfWork.flags & 32768) { - if (1 === suspendedReason) root = !0; - else if ( - workInProgressRootIsPrerendering || - 0 !== (workInProgressRootRenderLanes & 536870912) - ) - root = !1; - else if ( - ((workInProgressRootDidSkipSuspendedSiblings = root = !0), - 2 === suspendedReason || - 9 === suspendedReason || - 3 === suspendedReason || - 6 === suspendedReason) - ) - (suspendedReason = suspenseHandlerStackCursor.current), - null !== suspendedReason && - 13 === suspendedReason.tag && - (suspendedReason.flags |= 16384); - unwindUnitOfWork(unitOfWork, root); - } else completeUnitOfWork(unitOfWork); -} -function completeUnitOfWork(unitOfWork) { - var completedWork = unitOfWork; - do { - if (0 !== (completedWork.flags & 32768)) { - unwindUnitOfWork( - completedWork, - workInProgressRootDidSkipSuspendedSiblings - ); - return; - } - var current = completedWork.alternate; - unitOfWork = completedWork.return; - startProfilerTimer(completedWork); - current = completeWork(current, completedWork, entangledRenderLanes); - 0 !== (completedWork.mode & 2) && - stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); - if (null !== current) { - workInProgress = current; - return; - } - completedWork = completedWork.sibling; - if (null !== completedWork) { - workInProgress = completedWork; - return; - } - workInProgress = completedWork = unitOfWork; - } while (null !== completedWork); - 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + root.timeoutHandle = -1; + didIncludeRenderPhaseUpdate = finishedWork.subtreeFlags; + didSkipSuspendedSiblings = (lanes & 335544064) === lanes; + var suspendedState = null; + if ( + didSkipSuspendedSiblings || + didIncludeRenderPhaseUpdate & 8192 || + 16785408 === (didIncludeRenderPhaseUpdate & 16785408) + ) + (appearingViewTransitions = suspendedState = null), + accumulateSuspenseyCommitOnFiber(finishedWork), + didSkipSuspendedSiblings && + null != fabricSuspendOnActiveViewTransition && + fabricSuspendOnActiveViewTransition(), + (lanes & 62914560) === lanes + ? globalMostRecentFallbackTime - now$1() + : (lanes & 4194048) === lanes + ? globalMostRecentTransitionTime - now$1() + : 0; + didIncludeRenderPhaseUpdate = suspendedState; + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); + if (0 !== (executionContext & 6)) + throw Error("Should not already be working."); + setCurrentTrackFromLanes(lanes); + 2 === exitStatus + ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) + : null !== recoverableErrors + ? !supportsUserTiming || + completedRenderEndTime <= completedRenderStartTime || + console.timeStamp( + "Recovered", + completedRenderStartTime, + completedRenderEndTime, + currentTrack, + "Scheduler \u269b", + "error" + ) + : !supportsUserTiming || + completedRenderEndTime <= completedRenderStartTime || + console.timeStamp( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326741) === lanes + ? "Hydrated" + : "Render", + completedRenderStartTime, + completedRenderEndTime, + currentTrack, + "Scheduler \u269b", + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" + ); + if (null !== finishedWork) { + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingDelayedCommitReason = 0; + pendingSuspendedViewTransitionReason = null; + commitRoot( + root, + finishedWork, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didIncludeRenderPhaseUpdate, + suspendedCommitReason, + completedRenderEndTime + ); + } } -function unwindUnitOfWork(unitOfWork, skipSiblings) { - do { - var next = unwindWork(unitOfWork.alternate, unitOfWork); - if (null !== next) { - next.flags &= 32767; - workInProgress = next; - return; - } - if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); - next = unitOfWork.actualDuration; - for (var child = unitOfWork.child; null !== child; ) - (next += child.actualDuration), (child = child.sibling); - unitOfWork.actualDuration = next; - } - next = unitOfWork.return; - null !== next && - ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); +function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork; ; ) { + var tag = node.tag; if ( - !skipSiblings && - ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) - ) { - workInProgress = unitOfWork; - return; + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); + else { + if (node === finishedWork) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - workInProgress = unitOfWork = next; - } while (null !== unitOfWork); - workInProgressRootExitStatus = 6; - workInProgress = null; + } + return !0; } -function commitRoot( +function markRootSuspended( root, - finishedWork, - lanes, + suspendedLanes, spawnedLane, - updatedLanes, - suspendedRetryLanes, - suspendedState, - suspendedCommitReason, - completedRenderEndTime + didAttemptEntireTree ) { - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - pendingEffectsRemainingLanes = remainingLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - pendingViewTransitionEvents = null; - (lanes & 335544064) === lanes - ? ((pendingTransitionTypes = claimQueuedTransitionTypes(root)), - (spawnedLane = 10262)) - : ((pendingTransitionTypes = null), (spawnedLane = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & spawnedLane) || - 0 !== (finishedWork.flags & spawnedLane) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback(NormalPriority$1, function () { - schedulerEvent = global.event; - 0 === pendingDelayedCommitReason && (pendingDelayedCommitReason = 2); - flushPassiveEffects(); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - null !== suspendedCommitReason && - (!supportsUserTiming || - commitStartTime <= completedRenderEndTime || - console.timeStamp( - suspendedCommitReason, - completedRenderEndTime, - commitStartTime, - currentTrack, - "Scheduler \u269b", - "secondary-light" - )); - shouldStartViewTransition = !1; - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = currentUpdatePriority; - currentUpdatePriority = 2; - spawnedLane = executionContext; - executionContext |= 4; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = spawnedLane), - (currentUpdatePriority = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); - } - } - pendingEffectsStatus = 1; - shouldStartViewTransition - ? ((animatingLanes |= lanes), - (pendingViewTransition = startViewTransition( - suspendedState, - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects, - reportViewTransitionError, - suspendedViewTransition, - finishedViewTransition.bind(null, lanes) - ))) - : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); -} -function reportViewTransitionError(error) { - if (0 !== pendingEffectsStatus) { - var onRecoverableError = pendingEffectsRoot.onRecoverableError; - onRecoverableError(error, { componentStack: null }); - } -} -function suspendedViewTransition(reason) { - commitEndTime = now(); - logCommitPhase( - null === pendingSuspendedCommitReason - ? pendingEffectsRenderEndTime - : commitStartTime, - commitEndTime, - commitErrors, - 1 === pendingDelayedCommitReason - ); - pendingSuspendedCommitReason = pendingSuspendedViewTransitionReason = reason; -} -function finishedViewTransition(lanes) { - 0 !== (animatingLanes & lanes) && - ((animatingLanes &= ~lanes), - 0 !== (lanes & 4194048) && - 0 === (workInProgressRootRenderLanes & 4194048) && - 0 === (pendingEffectsLanes & 4194048) && - (setCurrentTrackFromLanes(256), - logAnimatingPhase(transitionClampTime, now$1())), - 0 !== (lanes & 62914560) && - 0 === (workInProgressRootRenderLanes & 62914560) && - 0 === (pendingEffectsLanes & 62914560) && - (setCurrentTrackFromLanes(4194304), - logAnimatingPhase(retryClampTime, now$1())), - 0 !== (lanes & 2080374784) && - 0 === (workInProgressRootRenderLanes & 2080374784) && - 0 === (pendingEffectsLanes & 2080374784) && - (setCurrentTrackFromLanes(268435456), - logAnimatingPhase(idleClampTime, now$1()))); -} -function flushAfterMutationEffects() { - 3 === pendingEffectsStatus && - ((pendingEffectsStatus = 0), - commitAfterMutationEffectsOnFiber(pendingFinishedWork, pendingEffectsRoot), - (pendingEffectsStatus = 4)); -} -function flushMutationEffects() { - if (1 === pendingEffectsStatus) { - pendingEffectsStatus = 0; - var root = pendingEffectsRoot, - finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { - rootMutationHasEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var previousPriority = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - try { - (inProgressLanes = lanes), - (inProgressRoot = root), - resetComponentEffectTimers(), - commitMutationEffectsOnFiber(finishedWork, root, lanes), - (inProgressRoot = inProgressLanes = null); - } finally { - (executionContext = prevExecutionContext), - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = rootMutationHasEffect); - } - } - root.current = finishedWork; - pendingEffectsStatus = 2; + var entangledLanes = getEntangledLanes(root, suspendedLanes), + prewarmedLanes = 0; + 0 !== (entangledLanes & 1073741824) + ? (prewarmedLanes = entangledLanes & ~(suspendedLanes | 1073741824)) + : (suspendedLanes = entangledLanes); + entangledLanes = + workInProgressRootPingedLanes | workInProgressRootInterleavedUpdatedLanes; + suspendedLanes &= ~entangledLanes; + prewarmedLanes &= ~entangledLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + didAttemptEntireTree && + (root.warmLanes = root.warmLanes | suspendedLanes | prewarmedLanes); + didAttemptEntireTree = root.expirationTimes; + for (prewarmedLanes = suspendedLanes; 0 < prewarmedLanes; ) { + entangledLanes = 31 - clz32(prewarmedLanes); + var lane = 1 << entangledLanes; + didAttemptEntireTree[entangledLanes] = -1; + prewarmedLanes &= ~lane; } + 0 !== spawnedLane && + 0 !== (suspendedLanes & 261930) && + markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function flushLayoutEffects() { - if (2 === pendingEffectsStatus) { - pendingEffectsStatus = 0; - var suspendedViewTransitionReason = pendingSuspendedViewTransitionReason; - null !== suspendedViewTransitionReason && - ((commitStartTime = now()), +function resetWorkInProgressStack() { + if (null !== workInProgress) { + if (0 === workInProgressSuspendedReason) + var interruptedWork = workInProgress.return; + else + (interruptedWork = workInProgress), + (lastContextDependency = currentlyRenderingFiber$1 = null), + resetHooksOnUnwind(interruptedWork), + (thenableState$1 = null), + (thenableIndexCounter$1 = 0), + (interruptedWork = workInProgress); + for (; null !== interruptedWork; ) + unwindInterruptedWork(interruptedWork.alternate, interruptedWork), + (interruptedWork = interruptedWork.return); + workInProgress = null; + } +} +function finalizeRender(lanes, finalizationTime) { + 0 !== (lanes & 127) && (blockingClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 62914560) && (retryClampTime = finalizationTime); + 0 !== (lanes & 2080374784) && (idleClampTime = finalizationTime); +} +function prepareFreshStack(root, lanes) { + supportsUserTiming && + (console.timeStamp( + "Blocking Track", + 0.003, + 0.003, + "Blocking", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Transition Track", + 0.003, + 0.003, + "Transition", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Suspense Track", + 0.003, + 0.003, + "Suspense", + "Scheduler \u269b", + "primary-light" + ), + console.timeStamp( + "Idle Track", + 0.003, + 0.003, + "Idle", + "Scheduler \u269b", + "primary-light" + )); + var previousRenderStartTime = renderStartTime; + renderStartTime = now(); + if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) { + setCurrentTrackFromLanes(workInProgressRootRenderLanes); + if ( + 3 === workInProgressRootExitStatus || + 4 === workInProgressRootExitStatus + ) + logSuspendedRenderPhase(previousRenderStartTime, renderStartTime, lanes); + else { + var endTime = renderStartTime; !supportsUserTiming || - commitStartTime <= commitEndTime || + endTime <= previousRenderStartTime || console.timeStamp( - suspendedViewTransitionReason, - commitEndTime, - commitStartTime, + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326741) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + previousRenderStartTime, + endTime, currentTrack, "Scheduler \u269b", - "secondary-light" - )); - suspendedViewTransitionReason = pendingEffectsRoot; - var finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); - if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { - rootHasLayoutEffect = ReactSharedInternals.T; - ReactSharedInternals.T = null; - var previousPriority = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - try { - (inProgressLanes = lanes), - (inProgressRoot = suspendedViewTransitionReason), - resetComponentEffectTimers(), - commitLayoutEffectOnFiber( - suspendedViewTransitionReason, - finishedWork.alternate, - finishedWork - ), - (inProgressRoot = inProgressLanes = null); - } finally { - (executionContext = prevExecutionContext), - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = rootHasLayoutEffect); - } + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark" + ); } - suspendedViewTransitionReason = pendingEffectsRenderEndTime; - finishedWork = pendingSuspendedCommitReason; - commitEndTime = now(); - logCommitPhase( - null === finishedWork ? suspendedViewTransitionReason : commitStartTime, - commitEndTime, - commitErrors, - 1 === pendingDelayedCommitReason - ); - pendingEffectsStatus = 3; + finalizeRender(workInProgressRootRenderLanes, renderStartTime); } -} -function flushSpawnedWork() { - if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) { - if (4 === pendingEffectsStatus) { - var startViewTransitionStartTime = commitEndTime; - commitEndTime = now(); - var abortedViewTransition = 1 === pendingDelayedCommitReason; - !supportsUserTiming || - commitEndTime <= startViewTransitionStartTime || + if (0 !== (lanes & 127)) { + previousRenderStartTime = + 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime + ? blockingClampTime + : blockingUpdateTime; + endTime = + 0 <= blockingEventTime && blockingEventTime < blockingClampTime + ? blockingClampTime + : blockingEventTime; + var clampedRenderStartTime$161 = + 0 <= endTime + ? endTime + : 0 <= previousRenderStartTime + ? previousRenderStartTime + : renderStartTime; + 0 <= blockingSuspendedTime + ? (setCurrentTrackFromLanes(2), + logSuspendedWithDelayPhase( + blockingSuspendedTime, + clampedRenderStartTime$161, + lanes + )) + : 0 !== (animatingLanes & 127) && + (setCurrentTrackFromLanes(2), + logAnimatingPhase(blockingClampTime, clampedRenderStartTime$161)); + clampedRenderStartTime$161 = blockingEventType; + var eventIsRepeat = 0 < blockingEventRepeatTime, + isSpawnedUpdate = 1 === blockingUpdateType, + isPingedUpdate = 2 === blockingUpdateType, + renderStartTime$jscomp$0 = renderStartTime; + supportsUserTiming && + ((currentTrack = "Blocking"), + 0 < previousRenderStartTime + ? previousRenderStartTime > renderStartTime$jscomp$0 && + (previousRenderStartTime = renderStartTime$jscomp$0) + : (previousRenderStartTime = renderStartTime$jscomp$0), + 0 < endTime + ? endTime > previousRenderStartTime && + (endTime = previousRenderStartTime) + : (endTime = previousRenderStartTime), + null !== clampedRenderStartTime$161 && + previousRenderStartTime > endTime && + console.timeStamp( + eventIsRepeat + ? "Consecutive" + : "Event: " + clampedRenderStartTime$161, + endTime, + previousRenderStartTime, + currentTrack, + "Scheduler \u269b", + eventIsRepeat ? "secondary-light" : "warning" + ), + renderStartTime$jscomp$0 > previousRenderStartTime && + console.timeStamp( + isPingedUpdate + ? "Promise Resolved" + : isSpawnedUpdate + ? "Cascading Update" + : 5 < renderStartTime$jscomp$0 - previousRenderStartTime + ? "Update Blocked" + : "Update", + previousRenderStartTime, + renderStartTime$jscomp$0, + currentTrack, + "Scheduler \u269b", + isSpawnedUpdate + ? "error" + : (lanes & 738197653) === lanes + ? "tertiary-light" + : "primary-light" + )); + blockingUpdateTime = -1.1; + blockingUpdateType = 0; + blockingSuspendedTime = -1.1; + blockingEventRepeatTime = blockingEventTime; + blockingEventTime = -1.1; + blockingClampTime = now(); + } + 0 !== (lanes & 4194048) && + ((previousRenderStartTime = + 0 <= transitionStartTime && transitionStartTime < transitionClampTime + ? transitionClampTime + : transitionStartTime), + (endTime = + 0 <= transitionUpdateTime && transitionUpdateTime < transitionClampTime + ? transitionClampTime + : transitionUpdateTime), + (clampedRenderStartTime$161 = + 0 <= transitionEventTime && transitionEventTime < transitionClampTime + ? transitionClampTime + : transitionEventTime), + (eventIsRepeat = + 0 <= clampedRenderStartTime$161 + ? clampedRenderStartTime$161 + : 0 <= endTime + ? endTime + : renderStartTime), + 0 <= transitionSuspendedTime + ? (setCurrentTrackFromLanes(256), + logSuspendedWithDelayPhase( + transitionSuspendedTime, + eventIsRepeat, + lanes + )) + : 0 !== (animatingLanes & 4194048) && + (setCurrentTrackFromLanes(256), + logAnimatingPhase(transitionClampTime, eventIsRepeat)), + (eventIsRepeat = transitionEventType), + (isSpawnedUpdate = 0 < transitionEventRepeatTime), + (isPingedUpdate = 2 === transitionUpdateType), + (renderStartTime$jscomp$0 = renderStartTime), + supportsUserTiming && + ((currentTrack = "Transition"), + 0 < endTime + ? endTime > renderStartTime$jscomp$0 && + (endTime = renderStartTime$jscomp$0) + : (endTime = renderStartTime$jscomp$0), + 0 < previousRenderStartTime + ? previousRenderStartTime > endTime && + (previousRenderStartTime = endTime) + : (previousRenderStartTime = endTime), + 0 < clampedRenderStartTime$161 + ? clampedRenderStartTime$161 > previousRenderStartTime && + (clampedRenderStartTime$161 = previousRenderStartTime) + : (clampedRenderStartTime$161 = previousRenderStartTime), + previousRenderStartTime > clampedRenderStartTime$161 && + null !== eventIsRepeat && + console.timeStamp( + isSpawnedUpdate ? "Consecutive" : "Event: " + eventIsRepeat, + clampedRenderStartTime$161, + previousRenderStartTime, + currentTrack, + "Scheduler \u269b", + isSpawnedUpdate ? "secondary-light" : "warning" + ), + endTime > previousRenderStartTime && console.timeStamp( - abortedViewTransition - ? "Interrupted View Transition" - : "Starting Animation", - startViewTransitionStartTime, - commitEndTime, + "Action", + previousRenderStartTime, + endTime, currentTrack, "Scheduler \u269b", - abortedViewTransition ? " error" : "secondary-light" - ); - 1 !== pendingDelayedCommitReason && (pendingDelayedCommitReason = 3); - } - pendingEffectsStatus = 0; - startViewTransitionStartTime = pendingViewTransition; - pendingViewTransition = null; - requestPaint(); - abortedViewTransition = pendingEffectsRoot; - var finishedWork = pendingFinishedWork, - lanes = pendingEffectsLanes, - recoverableErrors = pendingRecoverableErrors, - passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; - (passiveSubtreeMask = - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || - 0 !== (finishedWork.flags & passiveSubtreeMask)) - ? (pendingEffectsStatus = 5) - : ((pendingEffectsStatus = 0), - (pendingFinishedWork = pendingEffectsRoot = null), - releaseRootPooledCache( - abortedViewTransition, - abortedViewTransition.pendingLanes - )); - var remainingLanes = abortedViewTransition.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - remainingLanes = lanesToEventPriority(lanes); - finishedWork = finishedWork.stateNode; - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (finishedWork.current.flags & 128); - switch (remainingLanes) { - case 2: - var schedulerPriority = ImmediatePriority; - break; - case 8: - schedulerPriority = UserBlockingPriority; - break; - case 32: - schedulerPriority = NormalPriority$1; - break; - case 268435456: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - finishedWork, - schedulerPriority, - didError - ); - } catch (err) {} - isDevToolsPresent && abortedViewTransition.memoizedUpdaters.clear(); - if (null !== recoverableErrors) { - didError = ReactSharedInternals.T; - schedulerPriority = currentUpdatePriority; - currentUpdatePriority = 2; - ReactSharedInternals.T = null; - try { - var onRecoverableError = abortedViewTransition.onRecoverableError; - for ( - finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) { - var recoverableError = recoverableErrors[finishedWork]; - onRecoverableError(recoverableError.value, { - componentStack: recoverableError.stack - }); - } - } finally { - (ReactSharedInternals.T = didError), - (currentUpdatePriority = schedulerPriority); - } - } - onRecoverableError = pendingViewTransitionEvents; - recoverableError = pendingTransitionTypes; - pendingTransitionTypes = null; - if ( - null !== onRecoverableError && - ((pendingViewTransitionEvents = null), - null === recoverableError && (recoverableError = []), - null !== startViewTransitionStartTime) - ) - for ( - recoverableErrors = 0; - recoverableErrors < onRecoverableError.length; - recoverableErrors++ - ) - (didError = (0, onRecoverableError[recoverableErrors])( - recoverableError - )), - void 0 !== didError && - startViewTransitionStartTime.finished.finally(didError); - 0 !== (pendingEffectsLanes & 3) && - 0 !== abortedViewTransition.tag && - flushPendingEffects(); - ensureRootIsScheduled(abortedViewTransition); - remainingLanes = abortedViewTransition.pendingLanes; - 0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - abortedViewTransition === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), - (rootWithNestedUpdates = abortedViewTransition))) - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); - passiveSubtreeMask || finalizeRender(lanes, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - } -} -function releaseRootPooledCache(root, remainingLanes) { - 0 === (root.pooledCacheLanes &= remainingLanes) && - ((remainingLanes = root.pooledCache), - null != remainingLanes && - ((root.pooledCache = null), releaseCache(remainingLanes))); -} -function flushPendingEffects() { - null !== pendingViewTransition && - ((pendingViewTransition = null), (pendingDelayedCommitReason = 1)); - flushMutationEffects(); - flushLayoutEffects(); - flushSpawnedWork(); - return flushPassiveEffects(); -} -function flushPassiveEffects() { - if (5 !== pendingEffectsStatus) return !1; - var root = pendingEffectsRoot, - remainingLanes = pendingEffectsRemainingLanes; - pendingEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority; - ReactSharedInternals.T = null; - var transitions = pendingPassiveTransitions; - pendingPassiveTransitions = null; - renderPriority = pendingEffectsRoot; - var lanes = pendingEffectsLanes; - pendingEffectsStatus = 0; - pendingFinishedWork = pendingEffectsRoot = null; - pendingEffectsLanes = 0; - if (0 !== (executionContext & 6)) - throw Error("Cannot flush passive effects while already rendering."); - setCurrentTrackFromLanes(lanes); - var passiveEffectStartTime = 0; - commitErrors = null; - passiveEffectStartTime = now$1(); - 3 === pendingDelayedCommitReason - ? logAnimatingPhase(commitEndTime, passiveEffectStartTime) - : !supportsUserTiming || - passiveEffectStartTime <= commitEndTime || + "primary-dark" + ), + renderStartTime$jscomp$0 > endTime && console.timeStamp( - 2 === pendingDelayedCommitReason ? "Waiting for Paint" : "Waiting", - commitEndTime, - passiveEffectStartTime, + isPingedUpdate + ? "Promise Resolved" + : 5 < renderStartTime$jscomp$0 - endTime + ? "Update Blocked" + : "Update", + endTime, + renderStartTime$jscomp$0, currentTrack, "Scheduler \u269b", - "secondary-light" - ); - var prevExecutionContext = executionContext; - executionContext |= 4; - var finishedWork = renderPriority.current; - resetComponentEffectTimers(); - commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = renderPriority.current; - finishedWork = pendingEffectsRenderEndTime; - resetComponentEffectTimers(); - commitPassiveMountOnFiber( - renderPriority, - finishedWork$jscomp$0, - lanes, - transitions, - finishedWork + "primary-light" + )), + (transitionUpdateTime = transitionStartTime = -1.1), + (transitionUpdateType = 0), + (transitionSuspendedTime = -1.1), + (transitionEventRepeatTime = transitionEventTime), + (transitionEventTime = -1.1), + (transitionClampTime = now())); + 0 !== (lanes & 62914560) && + 0 !== (animatingLanes & 62914560) && + (setCurrentTrackFromLanes(4194304), + logAnimatingPhase(retryClampTime, renderStartTime)); + 0 !== (lanes & 2080374784) && + 0 !== (animatingLanes & 2080374784) && + (setCurrentTrackFromLanes(268435456), + logAnimatingPhase(idleClampTime, renderStartTime)); + previousRenderStartTime = root.timeoutHandle; + -1 !== previousRenderStartTime && + ((root.timeoutHandle = -1), + cancelTimeout(previousRenderStartTime), + (previousRenderStartTime = pendingEffectsLanes), + (root.pingedLanes |= root.suspendedLanes & previousRenderStartTime), + (root.warmLanes &= ~previousRenderStartTime)); + previousRenderStartTime = root.cancelPendingCommit; + null !== previousRenderStartTime && + ((root.cancelPendingCommit = null), previousRenderStartTime()); + pendingEffectsLanes = 0; + resetWorkInProgressStack(); + workInProgressRoot = root; + workInProgress = previousRenderStartTime = createWorkInProgress( + root.current, + null + ); + workInProgressRootRenderLanes = lanes; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = + workInProgressRootPingedLanes = + workInProgressRootInterleavedUpdatedLanes = + workInProgressRootSkippedLanes = + workInProgressRootExitStatus = + 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = + null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; + entangledRenderLanes = getEntangledLanes(root, lanes); + finishQueueingConcurrentUpdates(); + return previousRenderStartTime; +} +function handleThrow(root, thrownValue) { + currentlyRenderingFiber = null; + ReactSharedInternals.H = ContextOnlyDispatcher; + thrownValue === SuspenseException || thrownValue === SuspenseActionException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = 3)) + : thrownValue === SuspenseyCommitException + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = 4)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? 8 + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); + workInProgressThrownValue = thrownValue; + var erroredWork = workInProgress; + null === erroredWork + ? ((workInProgressRootExitStatus = 1), + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + )) + : erroredWork.mode & 2 && + stopProfilerTimerIfRunningAndRecordDuration(erroredWork); +} +function pushDispatcher() { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; +} +function pushAsyncDispatcher() { + var prevAsyncDispatcher = ReactSharedInternals.A; + ReactSharedInternals.A = DefaultAsyncDispatcher; + return prevAsyncDispatcher; +} +function renderDidSuspendDelayIfPossible() { + workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194048) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); + (0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || + null === workInProgressRoot || + markRootSuspended( + workInProgressRoot, + workInProgressRootRenderLanes, + workInProgressDeferredLane, + !1 ); - executionContext = prevExecutionContext; - var passiveEffectsEndTime = now$1(); - finishedWork$jscomp$0 = passiveEffectStartTime; - null !== commitErrors - ? logCommitErrored(finishedWork$jscomp$0, passiveEffectsEndTime) - : !supportsUserTiming || - passiveEffectsEndTime <= finishedWork$jscomp$0 || - console.timeStamp( - "Remaining Effects", - finishedWork$jscomp$0, - passiveEffectsEndTime, - currentTrack, - "Scheduler \u269b", - "secondary-dark" - ); - finalizeRender(lanes, passiveEffectsEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - if ( - injectedHook && - "function" === typeof injectedHook.onPostCommitFiberRoot - ) - try { - injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); - } catch (err) {} - var stateNode = renderPriority.current.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - return !0; - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); +} +function renderRootSync(root, lanes, shouldYieldForPrerendering) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevAsyncDispatcher = pushAsyncDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + 0 < memoizedUpdaters.size && + (restorePendingUpdaters(root, workInProgressRootRenderLanes), + memoizedUpdaters.clear()); + movePendingFibersToMemoized(root, lanes); + } + workInProgressTransitions = null; + prepareFreshStack(root, lanes); } + lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) { + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; + switch (workInProgressSuspendedReason) { + case 8: + resetWorkInProgressStack(); + memoizedUpdaters = 6; + break a; + case 3: + case 2: + case 9: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = 0; + break a; + } + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + } + } + workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; + break; + } catch (thrownValue$166) { + handleThrow(root, thrownValue$166); + } + while (1); + lanes && root.shellSuspendCounter++; + lastContextDependency = currentlyRenderingFiber$1 = null; + executionContext = prevExecutionContext; + ReactSharedInternals.H = prevDispatcher; + ReactSharedInternals.A = prevAsyncDispatcher; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } -function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - recordEffectError(sourceFiber); - sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); - null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); +function workLoopSync() { + for (; null !== workInProgress; ) performUnitOfWork(workInProgress); } -function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { - if (3 === sourceFiber.tag) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); - else - for (; null !== nearestMountedAncestor; ) { - if (3 === nearestMountedAncestor.tag) { - captureCommitPhaseErrorOnRoot( - nearestMountedAncestor, - sourceFiber, - error - ); - break; - } else if (1 === nearestMountedAncestor.tag) { - var instance = nearestMountedAncestor.stateNode; - if ( - "function" === - typeof nearestMountedAncestor.type.getDerivedStateFromError || - ("function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance))) +function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(), + prevAsyncDispatcher = pushAsyncDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + 0 < memoizedUpdaters.size && + (restorePendingUpdaters(root, workInProgressRootRenderLanes), + memoizedUpdaters.clear()); + movePendingFibersToMemoized(root, lanes); + } + workInProgressTransitions = null; + workInProgressRootRenderTargetTime = now$1() + 500; + prepareFreshStack(root, lanes); + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); + a: do + try { + if (0 !== workInProgressSuspendedReason && null !== workInProgress) + b: switch ( + ((lanes = workInProgress), + (memoizedUpdaters = workInProgressThrownValue), + workInProgressSuspendedReason) ) { - sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - recordEffectError(sourceFiber); - error = createClassErrorUpdate(2); - instance = enqueueUpdate(nearestMountedAncestor, error, 2); - null !== instance && - (initializeClassErrorUpdate( - error, - instance, - nearestMountedAncestor, - sourceFiber - ), - markRootUpdated$1(instance, 2), - ensureRootIsScheduled(instance)); - break; + case 1: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); + break; + case 2: + case 9: + if (isThenableResolved(memoizedUpdaters)) { + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + replaySuspendedUnitOfWork(lanes); + break; + } + lanes = function () { + (2 !== workInProgressSuspendedReason && + 9 !== workInProgressSuspendedReason) || + workInProgressRoot !== root || + (workInProgressSuspendedReason = 7); + ensureRootIsScheduled(root); + }; + memoizedUpdaters.then(lanes, lanes); + break a; + case 3: + workInProgressSuspendedReason = 7; + break a; + case 4: + workInProgressSuspendedReason = 5; + break a; + case 7: + isThenableResolved(memoizedUpdaters) + ? ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + replaySuspendedUnitOfWork(lanes)) + : ((workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); + break; + case 5: + var resource = null; + switch (workInProgress.tag) { + case 26: + resource = workInProgress.memoizedState; + case 5: + case 27: + var hostFiber = workInProgress; + if (resource ? shim(resource) : 1) { + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + var sibling = hostFiber.sibling; + if (null !== sibling) workInProgress = sibling; + else { + var returnFiber = hostFiber.return; + null !== returnFiber + ? ((workInProgress = returnFiber), + completeUnitOfWork(returnFiber)) + : (workInProgress = null); + } + break b; + } + } + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); + break; + case 6: + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); + break; + case 8: + resetWorkInProgressStack(); + workInProgressRootExitStatus = 6; + break a; + default: + throw Error("Unexpected SuspendedReason. This is a bug in React."); } - } - nearestMountedAncestor = nearestMountedAncestor.return; + workLoopConcurrentByScheduler(); + break; + } catch (thrownValue$168) { + handleThrow(root, thrownValue$168); } + while (1); + lastContextDependency = currentlyRenderingFiber$1 = null; + ReactSharedInternals.H = prevDispatcher; + ReactSharedInternals.A = prevAsyncDispatcher; + executionContext = prevExecutionContext; + if (null !== workInProgress) return 0; + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } -function attachPingListener(root, wakeable, lanes) { - var pingCache = root.pingCache; - if (null === pingCache) { - pingCache = root.pingCache = new PossiblyWeakMap(); - var threadIDs = new Set(); - pingCache.set(wakeable, threadIDs); - } else - (threadIDs = pingCache.get(wakeable)), - void 0 === threadIDs && - ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); - threadIDs.has(lanes) || - ((workInProgressRootDidAttachPingListener = !0), - threadIDs.add(lanes), - (pingCache = pingSuspendedRoot.bind(null, root, wakeable, lanes)), - isDevToolsPresent && restorePendingUpdaters(root, lanes), - wakeable.then(pingCache, pingCache)); +function workLoopConcurrentByScheduler() { + for (; null !== workInProgress && !shouldYield(); ) + performUnitOfWork(workInProgress); } -function pingSuspendedRoot(root, wakeable, pingedLanes) { - var pingCache = root.pingCache; - null !== pingCache && pingCache.delete(wakeable); - root.pingedLanes |= root.suspendedLanes & pingedLanes; - root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 127) - ? 0 > blockingUpdateTime && - ((blockingClampTime = blockingUpdateTime = now()), - (blockingUpdateType = 2)) - : 0 !== (pingedLanes & 4194048) && - 0 > transitionUpdateTime && - ((transitionClampTime = transitionUpdateTime = now()), - (transitionUpdateType = 2)); - workInProgressRoot === root && - (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && - (4 === workInProgressRootExitStatus || - (3 === workInProgressRootExitStatus && - (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes && - 300 > now$1() - globalMostRecentFallbackTime) - ? 0 === (executionContext & 2) - ? prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes) - : (workInProgressRootPingedLanes |= pingedLanes), - workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && - (workInProgressSuspendedRetryLanes = 0)); - ensureRootIsScheduled(root); +function performUnitOfWork(unitOfWork) { + var current = unitOfWork.alternate; + 0 !== (unitOfWork.mode & 2) + ? (startProfilerTimer(unitOfWork), + (current = beginWork(current, unitOfWork, entangledRenderLanes)), + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) + : (current = beginWork(current, unitOfWork, entangledRenderLanes)); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === current + ? completeUnitOfWork(unitOfWork) + : (workInProgress = current); } -function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && - (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); - boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); - null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), - ensureRootIsScheduled(boundaryFiber)); +function replaySuspendedUnitOfWork(unitOfWork) { + var next = unitOfWork; + var current = next.alternate, + isProfilingMode = 0 !== (next.mode & 2); + isProfilingMode && startProfilerTimer(next); + switch (next.tag) { + case 15: + case 0: + current = replayFunctionComponent( + current, + next, + next.pendingProps, + next.type, + void 0, + workInProgressRootRenderLanes + ); + break; + case 11: + current = replayFunctionComponent( + current, + next, + next.pendingProps, + next.type.render, + next.ref, + workInProgressRootRenderLanes + ); + break; + case 5: + resetHooksOnUnwind(next); + default: + unwindInterruptedWork(current, next), + (next = workInProgress = + resetWorkInProgress(next, entangledRenderLanes)), + (current = beginWork(current, next, entangledRenderLanes)); + } + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); + next = current; + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } -function retryDehydratedSuspenseBoundary(boundaryFiber) { - var suspenseState = boundaryFiber.memoizedState, - retryLane = 0; - null !== suspenseState && (retryLane = suspenseState.retryLane); - retryTimedOutBoundary(boundaryFiber, retryLane); +function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason +) { + lastContextDependency = currentlyRenderingFiber$1 = null; + resetHooksOnUnwind(unitOfWork); + thenableState$1 = null; + thenableIndexCounter$1 = 0; + var returnFiber = unitOfWork.return; + try { + if ( + throwException( + root, + returnFiber, + unitOfWork, + thrownValue, + workInProgressRootRenderLanes + ) + ) { + workInProgressRootExitStatus = 1; + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + ); + workInProgress = null; + return; + } + } catch (error) { + if (null !== returnFiber) throw ((workInProgress = returnFiber), error); + workInProgressRootExitStatus = 1; + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + ); + workInProgress = null; + return; + } + if (unitOfWork.flags & 32768) { + if (1 === suspendedReason) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + 2 === suspendedReason || + 9 === suspendedReason || + 3 === suspendedReason || + 6 === suspendedReason) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + unwindUnitOfWork(unitOfWork, root); + } else completeUnitOfWork(unitOfWork); +} +function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } + var current = completedWork.alternate; + unitOfWork = completedWork.return; + startProfilerTimer(completedWork); + current = completeWork(current, completedWork, entangledRenderLanes); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); + if (null !== current) { + workInProgress = current; + return; + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); +} +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; } -function resolveRetryWakeable(boundaryFiber, wakeable) { - var retryLane = 0; - switch (boundaryFiber.tag) { - case 31: - case 13: - var retryCache = boundaryFiber.stateNode; - var suspenseState = boundaryFiber.memoizedState; - null !== suspenseState && (retryLane = suspenseState.retryLane); - break; - case 19: - retryCache = boundaryFiber.stateNode; - break; - case 22: - retryCache = boundaryFiber.stateNode._retryCache; - break; - default: - throw Error( - "Pinged unknown suspense boundary type. This is probably a bug in React." - ); +function commitRoot( + root, + finishedWork, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedState, + suspendedCommitReason, + completedRenderEndTime +) { + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + pendingEffectsRemainingLanes = remainingLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = claimQueuedTransitionTypes(root)), + (spawnedLane = 10262)) + : ((pendingTransitionTypes = null), (spawnedLane = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & spawnedLane) || + 0 !== (finishedWork.flags & spawnedLane) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + schedulerEvent = global.event; + 0 === pendingDelayedCommitReason && (pendingDelayedCommitReason = 2); + flushPassiveEffects(); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + null !== suspendedCommitReason && + (!supportsUserTiming || + commitStartTime <= completedRenderEndTime || + console.timeStamp( + suspendedCommitReason, + completedRenderEndTime, + commitStartTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + )); + shouldStartViewTransition = !1; + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = currentUpdatePriority; + currentUpdatePriority = 2; + spawnedLane = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = spawnedLane), + (currentUpdatePriority = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); + } } - null !== retryCache && retryCache.delete(wakeable); - retryTimedOutBoundary(boundaryFiber, retryLane); -} -function restorePendingUpdaters(root, lanes) { - isDevToolsPresent && - root.memoizedUpdaters.forEach(function (schedulingFiber) { - addFiberToLanesMap(root, schedulingFiber, lanes); - }); + pendingEffectsStatus = 1; + shouldStartViewTransition + ? ((animatingLanes |= lanes), + (pendingViewTransition = startViewTransition( + suspendedState, + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects, + reportViewTransitionError, + suspendedViewTransition, + finishedViewTransition.bind(null, lanes) + ))) + : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } -function scheduleCallback(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); +function reportViewTransitionError(error) { + if (0 !== pendingEffectsStatus) { + var onRecoverableError = pendingEffectsRoot.onRecoverableError; + onRecoverableError(error, { componentStack: null }); + } } -function FiberNode(tag, pendingProps, key, mode) { - this.tag = tag; - this.key = key; - this.sibling = - this.child = - this.return = - this.stateNode = - this.type = - this.elementType = - null; - this.index = 0; - this.refCleanup = this.ref = null; - this.pendingProps = pendingProps; - this.dependencies = - this.memoizedState = - this.updateQueue = - this.memoizedProps = - null; - this.mode = mode; - this.subtreeFlags = this.flags = 0; - this.deletions = null; - this.childLanes = this.lanes = 0; - this.alternate = null; - this.actualDuration = -0; - this.actualStartTime = -1.1; - this.treeBaseDuration = this.selfBaseDuration = -0; +function suspendedViewTransition(reason) { + commitEndTime = now(); + logCommitPhase( + null === pendingSuspendedCommitReason + ? pendingEffectsRenderEndTime + : commitStartTime, + commitEndTime, + commitErrors, + 1 === pendingDelayedCommitReason + ); + pendingSuspendedCommitReason = pendingSuspendedViewTransitionReason = reason; } -function createFiberImplClass(tag, pendingProps, key, mode) { - return new FiberNode(tag, pendingProps, key, mode); +function finishedViewTransition(lanes) { + 0 !== (animatingLanes & lanes) && + ((animatingLanes &= ~lanes), + 0 !== (lanes & 4194048) && + 0 === (workInProgressRootRenderLanes & 4194048) && + 0 === (pendingEffectsLanes & 4194048) && + (setCurrentTrackFromLanes(256), + logAnimatingPhase(transitionClampTime, now$1())), + 0 !== (lanes & 62914560) && + 0 === (workInProgressRootRenderLanes & 62914560) && + 0 === (pendingEffectsLanes & 62914560) && + (setCurrentTrackFromLanes(4194304), + logAnimatingPhase(retryClampTime, now$1())), + 0 !== (lanes & 2080374784) && + 0 === (workInProgressRootRenderLanes & 2080374784) && + 0 === (pendingEffectsLanes & 2080374784) && + (setCurrentTrackFromLanes(268435456), + logAnimatingPhase(idleClampTime, now$1()))); } -function shouldConstruct(Component) { - Component = Component.prototype; - return !(!Component || !Component.isReactComponent); +function flushAfterMutationEffects() { + 3 === pendingEffectsStatus && + ((pendingEffectsStatus = 0), + commitAfterMutationEffectsOnFiber(pendingFinishedWork, pendingEffectsRoot), + (pendingEffectsStatus = 4)); } -function createWorkInProgress(current, pendingProps) { - var workInProgress = current.alternate; - null === workInProgress - ? ((workInProgress = createFiberImplClass( - current.tag, - pendingProps, - current.key, - current.mode - )), - (workInProgress.elementType = current.elementType), - (workInProgress.type = current.type), - (workInProgress.stateNode = current.stateNode), - (workInProgress.alternate = current), - (current.alternate = workInProgress)) - : ((workInProgress.pendingProps = pendingProps), - (workInProgress.type = current.type), - (workInProgress.flags = 0), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null), - (workInProgress.actualDuration = -0), - (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 1206910976; - workInProgress.childLanes = current.childLanes; - workInProgress.lanes = current.lanes; - workInProgress.child = current.child; - workInProgress.memoizedProps = current.memoizedProps; - workInProgress.memoizedState = current.memoizedState; - workInProgress.updateQueue = current.updateQueue; - pendingProps = current.dependencies; - workInProgress.dependencies = - null === pendingProps - ? null - : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext }; - workInProgress.sibling = current.sibling; - workInProgress.index = current.index; - workInProgress.ref = current.ref; - workInProgress.refCleanup = current.refCleanup; - workInProgress.selfBaseDuration = current.selfBaseDuration; - workInProgress.treeBaseDuration = current.treeBaseDuration; - return workInProgress; +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + resetComponentEffectTimers(), + commitMutationEffectsOnFiber(finishedWork, root, lanes), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = 2; + } } -function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 1206910978; - var current = workInProgress.alternate; - null === current - ? ((workInProgress.childLanes = 0), - (workInProgress.lanes = renderLanes), - (workInProgress.child = null), - (workInProgress.subtreeFlags = 0), - (workInProgress.memoizedProps = null), - (workInProgress.memoizedState = null), - (workInProgress.updateQueue = null), - (workInProgress.dependencies = null), - (workInProgress.stateNode = null), - (workInProgress.selfBaseDuration = 0), - (workInProgress.treeBaseDuration = 0)) - : ((workInProgress.childLanes = current.childLanes), - (workInProgress.lanes = current.lanes), - (workInProgress.child = current.child), - (workInProgress.subtreeFlags = 0), - (workInProgress.deletions = null), - (workInProgress.memoizedProps = current.memoizedProps), - (workInProgress.memoizedState = current.memoizedState), - (workInProgress.updateQueue = current.updateQueue), - (workInProgress.type = current.type), - (renderLanes = current.dependencies), - (workInProgress.dependencies = - null === renderLanes - ? null - : { - lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext - }), - (workInProgress.selfBaseDuration = current.selfBaseDuration), - (workInProgress.treeBaseDuration = current.treeBaseDuration)); - return workInProgress; +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var suspendedViewTransitionReason = pendingSuspendedViewTransitionReason; + null !== suspendedViewTransitionReason && + ((commitStartTime = now()), + !supportsUserTiming || + commitStartTime <= commitEndTime || + console.timeStamp( + suspendedViewTransitionReason, + commitEndTime, + commitStartTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + )); + suspendedViewTransitionReason = pendingEffectsRoot; + var finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + (inProgressLanes = lanes), + (inProgressRoot = suspendedViewTransitionReason), + resetComponentEffectTimers(), + commitLayoutEffectOnFiber( + suspendedViewTransitionReason, + finishedWork.alternate, + finishedWork + ), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + suspendedViewTransitionReason = pendingEffectsRenderEndTime; + finishedWork = pendingSuspendedCommitReason; + commitEndTime = now(); + logCommitPhase( + null === finishedWork ? suspendedViewTransitionReason : commitStartTime, + commitEndTime, + commitErrors, + 1 === pendingDelayedCommitReason + ); + pendingEffectsStatus = 3; + } } -function createFiberFromTypeAndProps( - type, - key, - pendingProps, - owner, - mode, - lanes -) { - var fiberTag = 0; - owner = type; - if ("function" === typeof owner) shouldConstruct(owner) && (fiberTag = 1); - else if ("string" === typeof owner) fiberTag = 5; - else - a: switch (owner) { - case REACT_ACTIVITY_TYPE: - return ( - (type = createFiberImplClass(31, pendingProps, key, mode)), - (type.elementType = REACT_ACTIVITY_TYPE), - (type.lanes = lanes), - type - ); - case REACT_FRAGMENT_TYPE: - return createFiberFromFragment(pendingProps.children, mode, lanes, key); - case REACT_STRICT_MODE_TYPE: - fiberTag = 8; - mode |= 8; - 0 !== (mode & 1) && (mode |= 16); - break; - case REACT_PROFILER_TYPE: - return ( - (type = createFiberImplClass(12, pendingProps, key, mode | 2)), - (type.elementType = REACT_PROFILER_TYPE), - (type.lanes = lanes), - (type.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), - type - ); - case REACT_SUSPENSE_TYPE: - return ( - (type = createFiberImplClass(13, pendingProps, key, mode)), - (type.elementType = REACT_SUSPENSE_TYPE), - (type.lanes = lanes), - type - ); - case REACT_SUSPENSE_LIST_TYPE: - return ( - (type = createFiberImplClass(19, pendingProps, key, mode)), - (type.elementType = REACT_SUSPENSE_LIST_TYPE), - (type.lanes = lanes), - type - ); - case REACT_LEGACY_HIDDEN_TYPE: - case REACT_VIEW_TRANSITION_TYPE: - return ( - (type = mode | 32), - (type = createFiberImplClass(30, pendingProps, key, type)), - (type.elementType = REACT_VIEW_TRANSITION_TYPE), - (type.lanes = lanes), - (type.stateNode = { - autoName: null, - paired: null, - clones: null, - ref: null - }), - type +function flushSpawnedWork() { + if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) { + if (4 === pendingEffectsStatus) { + var startViewTransitionStartTime = commitEndTime; + commitEndTime = now(); + var abortedViewTransition = 1 === pendingDelayedCommitReason; + !supportsUserTiming || + commitEndTime <= startViewTransitionStartTime || + console.timeStamp( + abortedViewTransition + ? "Interrupted View Transition" + : "Starting Animation", + startViewTransitionStartTime, + commitEndTime, + currentTrack, + "Scheduler \u269b", + abortedViewTransition ? " error" : "secondary-light" ); - default: - if ("object" === typeof owner && null !== owner) - switch (owner.$$typeof) { - case REACT_CONTEXT_TYPE: - fiberTag = 10; - break a; - case REACT_CONSUMER_TYPE: - fiberTag = 9; - break a; - case REACT_FORWARD_REF_TYPE: - fiberTag = 11; - break a; - case REACT_MEMO_TYPE: - fiberTag = 14; - break a; - case REACT_LAZY_TYPE: - fiberTag = 16; - owner = null; - break a; - } - fiberTag = 29; - pendingProps = Error( - "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - ((null === type ? "null" : typeof type) + ".") + 1 !== pendingDelayedCommitReason && (pendingDelayedCommitReason = 3); + } + pendingEffectsStatus = 0; + startViewTransitionStartTime = pendingViewTransition; + pendingViewTransition = null; + requestPaint(); + abortedViewTransition = pendingEffectsRoot; + var finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; + (passiveSubtreeMask = + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || + 0 !== (finishedWork.flags & passiveSubtreeMask)) + ? (pendingEffectsStatus = 5) + : ((pendingEffectsStatus = 0), + (pendingFinishedWork = pendingEffectsRoot = null), + releaseRootPooledCache( + abortedViewTransition, + abortedViewTransition.pendingLanes + )); + var remainingLanes = abortedViewTransition.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + remainingLanes = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (remainingLanes) { + case 2: + var schedulerPriority = ImmediatePriority; + break; + case 8: + schedulerPriority = UserBlockingPriority; + break; + case 32: + schedulerPriority = NormalPriority$1; + break; + case 268435456: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError ); - owner = null; + } catch (err) {} + isDevToolsPresent && abortedViewTransition.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = abortedViewTransition.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } } - key = createFiberImplClass(fiberTag, pendingProps, key, mode); - key.elementType = type; - key.type = owner; - key.lanes = lanes; - return key; -} -function createFiberFromFragment(elements, mode, lanes, key) { - elements = createFiberImplClass(7, elements, key, mode); - elements.lanes = lanes; - return elements; -} -function createFiberFromText(content, mode, lanes) { - content = createFiberImplClass(6, content, null, mode); - content.lanes = lanes; - return content; -} -function createFiberFromPortal(portal, mode, lanes) { - mode = createFiberImplClass( - 4, - null !== portal.children ? portal.children : [], - portal.key, - mode - ); - mode.lanes = lanes; - mode.stateNode = { - containerInfo: portal.containerInfo, - pendingChildren: null, - implementation: portal.implementation - }; - return mode; + onRecoverableError = pendingViewTransitionEvents; + recoverableError = pendingTransitionTypes; + pendingTransitionTypes = null; + if ( + null !== onRecoverableError && + ((pendingViewTransitionEvents = null), + null === recoverableError && (recoverableError = []), + null !== startViewTransitionStartTime) + ) + for ( + recoverableErrors = 0; + recoverableErrors < onRecoverableError.length; + recoverableErrors++ + ) + (didError = (0, onRecoverableError[recoverableErrors])( + recoverableError + )), + void 0 !== didError && + startViewTransitionStartTime.finished.finally(didError); + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(abortedViewTransition); + remainingLanes = abortedViewTransition.pendingLanes; + 0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + abortedViewTransition === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = abortedViewTransition))) + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = null)); + passiveSubtreeMask || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0); + } } -function FiberRootNode( - containerInfo, - tag, - hydrate, - identifierPrefix, - onUncaughtError, - onCaughtError, - onRecoverableError, - onDefaultTransitionIndicator, - formState -) { - this.tag = tag; - this.containerInfo = containerInfo; - this.pingCache = this.current = this.pendingChildren = null; - this.timeoutHandle = -1; - this.callbackNode = - this.next = - this.pendingContext = - this.context = - this.cancelPendingCommit = - null; - this.callbackPriority = 0; - this.expirationTimes = createLaneMap(-1); - this.entangledLanes = - this.shellSuspendCounter = - this.errorRecoveryDisabledLanes = - this.expiredLanes = - this.warmLanes = - this.pingedLanes = - this.suspendedLanes = - this.pendingLanes = - 0; - this.entanglements = createLaneMap(0); - this.hiddenUpdates = createLaneMap(null); - this.identifierPrefix = identifierPrefix; - this.onUncaughtError = onUncaughtError; - this.onCaughtError = onCaughtError; - this.onRecoverableError = onRecoverableError; - this.pooledCache = null; - this.pooledCacheLanes = 0; - this.formState = formState; - this.transitionTypes = null; - this.incompleteTransitions = new Map(); - this.passiveEffectDuration = this.effectDuration = -0; - this.memoizedUpdaters = new Set(); - containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); +function releaseRootPooledCache(root, remainingLanes) { + 0 === (root.pooledCacheLanes &= remainingLanes) && + ((remainingLanes = root.pooledCache), + null != remainingLanes && + ((root.pooledCache = null), releaseCache(remainingLanes))); } -function createPortal$1(children, containerInfo, implementation) { - var key = - 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - return { - $$typeof: REACT_PORTAL_TYPE, - key: - null == key - ? null - : key === REACT_OPTIMISTIC_KEY - ? REACT_OPTIMISTIC_KEY - : "" + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; +function flushPendingEffects() { + null !== pendingViewTransition && + ((pendingViewTransition = null), (pendingDelayedCommitReason = 1)); + flushMutationEffects(); + flushLayoutEffects(); + flushSpawnedWork(); + return flushPassiveEffects(); } -function findHostInstance(component) { - var fiber = component._reactInternals; - if (void 0 === fiber) { - if ("function" === typeof component.render) - throw Error("Unable to find node on an unmounted component."); - component = Object.keys(component).join(","); - throw Error( - "Argument appears to not be a ReactComponent. Keys: " + component +function flushPassiveEffects() { + if (5 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority; + ReactSharedInternals.T = null; + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + renderPriority = pendingEffectsRoot; + var lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingFinishedWork = pendingEffectsRoot = null; + pendingEffectsLanes = 0; + if (0 !== (executionContext & 6)) + throw Error("Cannot flush passive effects while already rendering."); + setCurrentTrackFromLanes(lanes); + var passiveEffectStartTime = 0; + commitErrors = null; + passiveEffectStartTime = now$1(); + 3 === pendingDelayedCommitReason + ? logAnimatingPhase(commitEndTime, passiveEffectStartTime) + : !supportsUserTiming || + passiveEffectStartTime <= commitEndTime || + console.timeStamp( + 2 === pendingDelayedCommitReason ? "Waiting for Paint" : "Waiting", + commitEndTime, + passiveEffectStartTime, + currentTrack, + "Scheduler \u269b", + "secondary-light" + ); + var prevExecutionContext = executionContext; + executionContext |= 4; + var finishedWork = renderPriority.current; + resetComponentEffectTimers(); + commitPassiveUnmountOnFiber(finishedWork); + var finishedWork$jscomp$0 = renderPriority.current; + finishedWork = pendingEffectsRenderEndTime; + resetComponentEffectTimers(); + commitPassiveMountOnFiber( + renderPriority, + finishedWork$jscomp$0, + lanes, + transitions, + finishedWork ); + executionContext = prevExecutionContext; + var passiveEffectsEndTime = now$1(); + finishedWork$jscomp$0 = passiveEffectStartTime; + null !== commitErrors + ? logCommitErrored(finishedWork$jscomp$0, passiveEffectsEndTime) + : !supportsUserTiming || + passiveEffectsEndTime <= finishedWork$jscomp$0 || + console.timeStamp( + "Remaining Effects", + finishedWork$jscomp$0, + passiveEffectsEndTime, + currentTrack, + "Scheduler \u269b", + "secondary-dark" + ); + finalizeRender(lanes, passiveEffectsEndTime); + flushSyncWorkAcrossRoots_impl(0); + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} + var stateNode = renderPriority.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + return !0; + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - component = findCurrentFiberUsingSlowPath(fiber); - component = null !== component ? findCurrentHostFiberImpl(component) : null; - return null === component ? null : getPublicInstance(component.stateNode); } -function updateContainer(element, container, parentComponent, callback) { - parentComponent = container.current; - var lane = requestUpdateLane(parentComponent); - null === container.context - ? (container.context = emptyContextObject) - : (container.pendingContext = emptyContextObject); - container = createUpdate(lane); - container.payload = { element: element }; - callback = void 0 === callback ? null : callback; - null !== callback && (container.callback = callback); - element = enqueueUpdate(parentComponent, container, lane); - null !== element && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(element, parentComponent, lane), - entangleTransitions(element, parentComponent, lane)); - return lane; +function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + recordEffectError(sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); + null !== rootFiber && + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } -function shim$1() { - throw Error( - "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue." - ); +function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + else + for (; null !== nearestMountedAncestor; ) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot( + nearestMountedAncestor, + sourceFiber, + error + ); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + if ( + "function" === + typeof nearestMountedAncestor.type.getDerivedStateFromError || + ("function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance))) + ) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + recordEffectError(sourceFiber); + error = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error, 2); + null !== instance && + (initializeClassErrorUpdate( + error, + instance, + nearestMountedAncestor, + sourceFiber + ), + markRootUpdated$1(instance, 2), + ensureRootIsScheduled(instance)); + break; + } + } + nearestMountedAncestor = nearestMountedAncestor.return; + } } -function shim() { - throw Error( - "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue." - ); +function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else + (threadIDs = pingCache.get(wakeable)), + void 0 === threadIDs && + ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || + ((workInProgressRootDidAttachPingListener = !0), + threadIDs.add(lanes), + (pingCache = pingSuspendedRoot.bind(null, root, wakeable, lanes)), + isDevToolsPresent && restorePendingUpdaters(root, lanes), + attachContextPreservingListener(wakeable, pingCache)); } -var fabricCreateViewTransitionInstance = - reactPrivateInterface.fabricUIManager.createViewTransitionInstance, - fabricStartViewTransition = - reactPrivateInterface.fabricUIManager.startViewTransition, - fabricStartViewTransitionReadyFinished = - reactPrivateInterface.fabricUIManager.startViewTransitionReadyFinished; -function ViewTransitionPseudoElement(pseudo, name) { - this._pseudo = pseudo; - this._name = name; +function attachContextPreservingListener(wakeable, listener) { + if ("function" !== typeof Promise) wakeable.then(listener, listener); + else { + var resolve = noop; + new Promise(function (r) { + resolve = r; + }).then(listener); + listener = function () { + return resolve(); + }; + wakeable.then(listener, listener); + } } -function measureClonedInstance() { - return { - rect: { x: 0, y: 0, width: 0, height: 0 }, - abs: !1, - clip: !1, - view: !0 - }; +function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; + 0 !== (pingedLanes & 127) + ? 0 > blockingUpdateTime && + ((blockingClampTime = blockingUpdateTime = now()), + (blockingUpdateType = 2)) + : 0 !== (pingedLanes & 4194048) && + 0 > transitionUpdateTime && + ((transitionClampTime = transitionUpdateTime = now()), + (transitionUpdateType = 2)); + workInProgressRoot === root && + (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && + (4 === workInProgressRootExitStatus || + (3 === workInProgressRootExitStatus && + (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes && + 300 > now$1() - globalMostRecentFallbackTime) + ? 0 === (executionContext & 2) + ? prepareFreshStack(root, 0) + : (workInProgressRootPingedLanes |= pingedLanes) + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); + ensureRootIsScheduled(root); } -function createViewTransitionInstance(name) { - var tag = allocateTag(); - fabricCreateViewTransitionInstance(name, tag); - return { - name: name, - old: new ViewTransitionPseudoElement("old", name), - new: new ViewTransitionPseudoElement("new", name) - }; +function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && (retryLane = claimNextRetryLane()); + boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + null !== boundaryFiber && + (markRootUpdated$1(boundaryFiber, retryLane), + ensureRootIsScheduled(boundaryFiber)); } -function startViewTransition( - suspendedState, - rootContainer, - transitionTypes, - mutationCallback, - layoutCallback, - afterMutationCallback, - spawnedWorkCallback, - passiveCallback -) { - suspendedState = fabricStartViewTransition(function () { - mutationCallback(); - layoutCallback(); - afterMutationCallback(); - }); - if (null == suspendedState) - return mutationCallback(), layoutCallback(), spawnedWorkCallback(), null; - suspendedState.ready.then(function () { - spawnedWorkCallback(); - fabricStartViewTransitionReadyFinished(); - }); - suspendedState.finished.finally(function () { - passiveCallback(); - }); - return suspendedState; +function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); } -var createNode = reactPrivateInterface.fabricUIManager.createNode, - cloneNodeWithNewChildren = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildren, - cloneNodeWithNewChildrenAndProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewChildrenAndProps, - cloneNodeWithNewProps = - reactPrivateInterface.fabricUIManager.cloneNodeWithNewProps, - createChildNodeSet = reactPrivateInterface.fabricUIManager.createChildSet, - appendChildNode = reactPrivateInterface.fabricUIManager.appendChild, - appendChildNodeToSet = reactPrivateInterface.fabricUIManager.appendChildToSet, - completeRoot = reactPrivateInterface.fabricUIManager.completeRoot, - registerEventHandler = - reactPrivateInterface.fabricUIManager.registerEventHandler, - FabricDiscretePriority = - reactPrivateInterface.fabricUIManager.unstable_DiscreteEventPriority, - FabricContinuousPriority = - reactPrivateInterface.fabricUIManager.unstable_ContinuousEventPriority, - FabricIdlePriority = - reactPrivateInterface.fabricUIManager.unstable_IdleEventPriority, - fabricGetCurrentEventPriority = - reactPrivateInterface.fabricUIManager.unstable_getCurrentEventPriority, - fabricSuspendOnActiveViewTransition = - reactPrivateInterface.fabricUIManager.suspendOnActiveViewTransition, - extraDevToolsConfig = { - getInspectorDataForInstance: void 0, - getInspectorDataForViewAtPoint: function () { +function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 31: + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + case 22: + retryCache = boundaryFiber.stateNode; + if (null === retryCache) return; + retryCache = retryCache._retryCache; + break; + default: throw Error( - "getInspectorDataForViewAtPoint() is not available in production." + "Pinged unknown suspense boundary type. This is probably a bug in React." ); - } - }, - getViewConfigForType = - reactPrivateInterface.ReactNativeViewConfigRegistry.get, - nextReactTag = 2; -function allocateTag() { - var tag = nextReactTag; - nextReactTag += 2; - return tag; -} -registerEventHandler && registerEventHandler(dispatchEvent); -var PROD_HOST_CONTEXT = { isInAParentText: !0 }; -function createTextInstance( - text, - rootContainerInstance, - hostContext, - internalInstanceHandle -) { - hostContext = allocateTag(); - return { - node: createNode( - hostContext, - "RCTRawText", - rootContainerInstance.containerTag, - { text: text }, - internalInstanceHandle - ) - }; -} -function getPublicInstance(instance) { - if (null != instance.canonical) { - if (null == instance.canonical.publicInstance) { - var $jscomp$nullish$tmp0; - instance.canonical.publicInstance = - reactPrivateInterface.createPublicInstance( - instance.canonical.nativeTag, - instance.canonical.viewConfig, - instance.canonical.internalInstanceHandle, - null != ($jscomp$nullish$tmp0 = instance.canonical.publicRootInstance) - ? $jscomp$nullish$tmp0 - : null - ); - instance.canonical.publicRootInstance = null; - } - return instance.canonical.publicInstance; } - return null != instance.containerInfo - ? instance.containerInfo.publicInstance - : null; + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); } -function getPublicInstanceFromHostFiber(fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null === fiber) - throw Error("Expected to find a host node. This is a bug in React."); - return fiber; +function restorePendingUpdaters(root, lanes) { + isDevToolsPresent && + root.memoizedUpdaters.forEach(function (schedulingFiber) { + addFiberToLanesMap(root, schedulingFiber, lanes); + }); +} +function scheduleCallback(priorityLevel, callback) { + return scheduleCallback$3(priorityLevel, callback); } -var currentUpdatePriority = 0; -function resolveUpdatePriority() { - if (0 !== currentUpdatePriority) return currentUpdatePriority; - var currentEventPriority = fabricGetCurrentEventPriority - ? fabricGetCurrentEventPriority() - : null; - if (null != currentEventPriority) - switch (currentEventPriority) { - case FabricDiscretePriority: - return 2; - case FabricContinuousPriority: - return 8; - case FabricIdlePriority: - return 268435456; - } - return 32; +function FiberNode(tag, pendingProps, key, mode) { + this.tag = tag; + this.key = key; + this.sibling = + this.child = + this.return = + this.stateNode = + this.type = + this.elementType = + null; + this.index = 0; + this.refCleanup = this.ref = null; + this.pendingProps = pendingProps; + this.dependencies = + this.memoizedState = + this.updateQueue = + this.memoizedProps = + null; + this.mode = mode; + this.subtreeFlags = this.flags = 0; + this.deletions = null; + this.childLanes = this.lanes = 0; + this.alternate = null; + this.actualDuration = -0; + this.actualStartTime = -1.1; + this.treeBaseDuration = this.selfBaseDuration = -0; } -var schedulerEvent = void 0; -function resolveEventType() { - var event = global.event; - event && event !== schedulerEvent - ? event.type - ? (event = event.type) - : ((event = event.dispatchConfig), - (event = - null == event || null == event.phasedRegistrationNames - ? null - : (event = - event.phasedRegistrationNames.bubbled || - event.phasedRegistrationNames.captured) - ? event.startsWith("on") - ? event.slice(2).toLowerCase() - : event.toLowerCase() - : null)) - : (event = null); - return event; +function createFiberImplClass(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); } -function resolveEventTimeStamp() { - var event = global.event; - return event && event !== schedulerEvent ? event.timeStamp : -1.1; +function shouldConstruct(Component) { + Component = Component.prototype; + return !(!Component || !Component.isReactComponent); } -var scheduleTimeout = setTimeout, - cancelTimeout = clearTimeout; -function cloneHiddenInstance(instance) { - var node = instance.node, - updatePayload = reactPrivateInterface.createAttributePayload( - { style: { display: "none" } }, - instance.canonical.viewConfig.validAttributes - ); - return { - node: cloneNodeWithNewProps(node, updatePayload), - canonical: instance.canonical - }; +function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + null === workInProgress + ? ((workInProgress = createFiberImplClass( + current.tag, + pendingProps, + current.key, + current.mode + )), + (workInProgress.elementType = current.elementType), + (workInProgress.type = current.type), + (workInProgress.stateNode = current.stateNode), + (workInProgress.alternate = current), + (current.alternate = workInProgress)) + : ((workInProgress.pendingProps = pendingProps), + (workInProgress.type = current.type), + (workInProgress.flags = 0), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null), + (workInProgress.actualDuration = -0), + (workInProgress.actualStartTime = -1.1)); + workInProgress.flags = current.flags & 1206910976; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + pendingProps = current.dependencies; + workInProgress.dependencies = + null === pendingProps + ? null + : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext }; + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + workInProgress.refCleanup = current.refCleanup; + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + return workInProgress; } -function FragmentInstance(fragmentFiber) { - this._fragmentFiber = fragmentFiber; - this._observers = null; +function resetWorkInProgress(workInProgress, renderLanes) { + workInProgress.flags &= 1206910978; + var current = workInProgress.alternate; + null === current + ? ((workInProgress.childLanes = 0), + (workInProgress.lanes = renderLanes), + (workInProgress.child = null), + (workInProgress.subtreeFlags = 0), + (workInProgress.memoizedProps = null), + (workInProgress.memoizedState = null), + (workInProgress.updateQueue = null), + (workInProgress.dependencies = null), + (workInProgress.stateNode = null), + (workInProgress.selfBaseDuration = 0), + (workInProgress.treeBaseDuration = 0)) + : ((workInProgress.childLanes = current.childLanes), + (workInProgress.lanes = current.lanes), + (workInProgress.child = current.child), + (workInProgress.subtreeFlags = 0), + (workInProgress.deletions = null), + (workInProgress.memoizedProps = current.memoizedProps), + (workInProgress.memoizedState = current.memoizedState), + (workInProgress.updateQueue = current.updateQueue), + (workInProgress.type = current.type), + (renderLanes = current.dependencies), + (workInProgress.dependencies = + null === renderLanes + ? null + : { + lanes: renderLanes.lanes, + firstContext: renderLanes.firstContext + }), + (workInProgress.selfBaseDuration = current.selfBaseDuration), + (workInProgress.treeBaseDuration = current.treeBaseDuration)); + return workInProgress; } -FragmentInstance.prototype.observeUsing = function (observer) { - null === this._observers && (this._observers = new Set()); - this._observers.add(observer); - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - observeChild, - observer, - void 0, - void 0 - ); -}; -function observeChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.observe(child); - return !1; +function createFiberFromTypeAndProps( + type, + key, + pendingProps, + owner, + mode, + lanes +) { + var fiberTag = 0; + owner = type; + if ("function" === typeof owner) shouldConstruct(owner) && (fiberTag = 1); + else if ("string" === typeof owner) fiberTag = 5; + else + a: switch (owner) { + case REACT_ACTIVITY_TYPE: + return ( + (type = createFiberImplClass(31, pendingProps, key, mode)), + (type.elementType = REACT_ACTIVITY_TYPE), + (type.lanes = lanes), + type + ); + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + case REACT_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 24; + break; + case REACT_PROFILER_TYPE: + return ( + (type = createFiberImplClass(12, pendingProps, key, mode | 2)), + (type.elementType = REACT_PROFILER_TYPE), + (type.lanes = lanes), + (type.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), + type + ); + case REACT_SUSPENSE_TYPE: + return ( + (type = createFiberImplClass(13, pendingProps, key, mode)), + (type.elementType = REACT_SUSPENSE_TYPE), + (type.lanes = lanes), + type + ); + case REACT_SUSPENSE_LIST_TYPE: + return ( + (type = createFiberImplClass(19, pendingProps, key, mode)), + (type.elementType = REACT_SUSPENSE_LIST_TYPE), + (type.lanes = lanes), + type + ); + case REACT_LEGACY_HIDDEN_TYPE: + case REACT_VIEW_TRANSITION_TYPE: + return ( + (type = mode | 32), + (type = createFiberImplClass(30, pendingProps, key, type)), + (type.elementType = REACT_VIEW_TRANSITION_TYPE), + (type.lanes = lanes), + (type.stateNode = { + autoName: null, + paired: null, + clones: null, + ref: null + }), + type + ); + default: + if ("object" === typeof owner && null !== owner) + switch (owner.$$typeof) { + case REACT_CONTEXT_TYPE: + fiberTag = 10; + break a; + case REACT_CONSUMER_TYPE: + fiberTag = 9; + break a; + case REACT_FORWARD_REF_TYPE: + fiberTag = 11; + break a; + case REACT_MEMO_TYPE: + fiberTag = 14; + break a; + case REACT_LAZY_TYPE: + fiberTag = 16; + owner = null; + break a; + } + fiberTag = 29; + pendingProps = Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + + ((null === type ? "null" : typeof type) + ".") + ); + owner = null; + } + key = createFiberImplClass(fiberTag, pendingProps, key, mode); + key.elementType = type; + key.type = owner; + key.lanes = lanes; + return key; } -FragmentInstance.prototype.unobserveUsing = function (observer) { - var observers = this._observers; - null !== observers && - observers.has(observer) && - (observers.delete(observer), - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - unobserveChild, - observer, - void 0, - void 0 - )); -}; -function unobserveChild(child, observer) { - child = getPublicInstanceFromHostFiber(child); - observer.unobserve(child); - return !1; +function createFiberFromFragment(elements, mode, lanes, key) { + elements = createFiberImplClass(7, elements, key, mode); + elements.lanes = lanes; + return elements; } -FragmentInstance.prototype.compareDocumentPosition = function (otherNode) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - if (null === parentHostFiber) return Node.DOCUMENT_POSITION_DISCONNECTED; - var children = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectChildren, - children, - void 0, - void 0 - ); - if (0 === children.length) { - var parentHostInstance = getPublicInstanceFromHostFiber(parentHostFiber); - children = this._fragmentFiber; - parentHostFiber = getPublicInstanceFromHostFiber; - var parentResult = parentHostInstance.compareDocumentPosition(otherNode); - var result = parentResult; - parentHostInstance === otherNode - ? (result = Node.DOCUMENT_POSITION_CONTAINS) - : parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY && - ((parentHostInstance = [null, null]), - (result = getFragmentParentInstanceOrContainerFiber(children)), - null !== result && - findFragmentInstanceOrTextInstanceSiblings( - parentHostInstance, - children, - result.child, - { foundSelf: !1 } - ), - (children = parentHostInstance[1]), - null === children - ? (result = Node.DOCUMENT_POSITION_PRECEDING) - : ((otherNode = - parentHostFiber(children).compareDocumentPosition(otherNode)), - (result = - 0 === otherNode || otherNode & Node.DOCUMENT_POSITION_FOLLOWING - ? Node.DOCUMENT_POSITION_FOLLOWING - : Node.DOCUMENT_POSITION_PRECEDING))); - return (result |= Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - } - parentHostFiber = getPublicInstanceFromHostFiber(children[0]); - children = getPublicInstanceFromHostFiber(children[children.length - 1]); - parentHostInstance = parentHostFiber.compareDocumentPosition(otherNode); - parentResult = children.compareDocumentPosition(otherNode); - result = - parentHostInstance & Node.DOCUMENT_POSITION_CONTAINED_BY || - parentResult & Node.DOCUMENT_POSITION_CONTAINED_BY; - parentResult = - parentHostInstance & Node.DOCUMENT_POSITION_FOLLOWING && - parentResult & Node.DOCUMENT_POSITION_PRECEDING; - return parentHostFiber === otherNode || - children === otherNode || - result || - parentResult - ? Node.DOCUMENT_POSITION_CONTAINED_BY - : parentHostInstance; -}; -function collectChildren(child, collection) { - collection.push(child); - return !1; +function createFiberFromText(content, mode, lanes) { + content = createFiberImplClass(6, content, null, mode); + content.lanes = lanes; + return content; } -FragmentInstance.prototype.getRootNode = function (getRootNodeOptions) { - var parentHostFiber = getFragmentParentInstanceOrContainerFiber( - this._fragmentFiber - ); - return null === parentHostFiber - ? this - : getPublicInstanceFromHostFiber(parentHostFiber).getRootNode( - getRootNodeOptions - ); -}; -FragmentInstance.prototype.getClientRects = function () { - var rects = []; - traverseVisibleInstancesAndTextInstances( - this._fragmentFiber.child, - !1, - collectClientRects, - rects, - void 0, - void 0 +function createFiberFromPortal(portal, mode, lanes) { + mode = createFiberImplClass( + 4, + null !== portal.children ? portal.children : [], + portal.key, + mode ); - return rects; -}; -function collectClientRects(child, rects) { - child = getPublicInstanceFromHostFiber(child); - rects.push(child.getBoundingClientRect()); - return !1; + mode.lanes = lanes; + mode.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + implementation: portal.implementation + }; + return mode; } -function addFragmentHandleToFiber(child, fragmentInstance) { - child = getPublicInstanceFromHostFiber(child); - null != child && addFragmentHandleToInstance(child, fragmentInstance); - return !1; +function FiberRootNode( + containerInfo, + hydrate, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + onDefaultTransitionIndicator, + formState +) { + this.tag = 1; + this.containerInfo = containerInfo; + this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.callbackNode = + this.next = + this.pendingContext = + this.context = + this.cancelPendingCommit = + null; + this.callbackPriority = 0; + this.expirationTimes = createLaneMap(-1); + this.entangledLanes = + this.shellSuspendCounter = + this.errorRecoveryDisabledLanes = + this.expiredLanes = + this.warmLanes = + this.pingedLanes = + this.suspendedLanes = + this.pendingLanes = + 0; + this.entanglements = createLaneMap(0); + this.hiddenUpdates = createLaneMap(null); + this.identifierPrefix = identifierPrefix; + this.onUncaughtError = onUncaughtError; + this.onCaughtError = onCaughtError; + this.onRecoverableError = onRecoverableError; + this.pooledCache = null; + this.pooledCacheLanes = 0; + this.formState = formState; + this.transitionTypes = null; + this.incompleteTransitions = new Map(); + this.passiveEffectDuration = this.effectDuration = -0; + this.memoizedUpdaters = new Set(); + containerInfo = this.pendingUpdatersLaneMap = []; + for (hydrate = 0; 31 > hydrate; hydrate++) containerInfo.push(new Set()); } -function addFragmentHandleToInstance(instance, fragmentInstance) { - null == instance.reactFragments && (instance.reactFragments = new Set()); - instance.reactFragments.add(fragmentInstance); +function createPortal$1(children, containerInfo, implementation) { + var key = + 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: + null == key + ? null + : key === REACT_OPTIMISTIC_KEY + ? REACT_OPTIMISTIC_KEY + : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; } -function commitNewChildToFragmentInstance(childInstance, fragmentInstance) { - if (null != childInstance.canonical) { - var publicInstance = getPublicInstance(childInstance); - if (null !== fragmentInstance._observers) { - if (null == publicInstance) - throw Error("Expected to find a host node. This is a bug in React."); - fragmentInstance._observers.forEach(function (observer) { - observer.observe(publicInstance); - }); - } - addFragmentHandleToInstance(publicInstance, fragmentInstance); +function findHostInstance(component) { + var fiber = component._reactInternals; + if (void 0 === fiber) { + if ("function" === typeof component.render) + throw Error("Unable to find node on an unmounted component."); + component = Object.keys(component).join(","); + throw Error( + "Argument appears to not be a ReactComponent. Keys: " + component + ); } + component = findCurrentFiberUsingSlowPath(fiber); + component = null !== component ? findCurrentHostFiberImpl(component) : null; + return null === component ? null : getPublicInstance(component.stateNode); +} +function updateContainer(element, container, parentComponent, callback) { + parentComponent = container.current; + var lane = requestUpdateLane(); + null === container.context + ? (container.context = emptyContextObject) + : (container.pendingContext = emptyContextObject); + container = createUpdate(lane); + container.payload = { element: element }; + callback = void 0 === callback ? null : callback; + null !== callback && (container.callback = callback); + element = enqueueUpdate(parentComponent, container, lane); + null !== element && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(element, parentComponent, lane), + entangleTransitions(element, parentComponent, lane)); + return lane; } -var HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, - scheduleMicrotask = - "function" === typeof queueMicrotask ? queueMicrotask : scheduleTimeout; -getFiberCurrentPropsFromNode$1 = function (instance) { - return instance.canonical.currentProps; -}; -getInstanceFromNode$1 = function (node) { - return null != node.canonical && null != node.canonical.internalInstanceHandle - ? node.canonical.internalInstanceHandle - : node; -}; -getNodeFromInstance$1 = function (fiber) { - fiber = getPublicInstance(fiber.stateNode); - if (null == fiber) throw Error("Could not find host instance from fiber"); - return fiber; -}; -ResponderEventPlugin.injection.injectGlobalResponderHandler({ - onChange: function (from, to, blockNativeResponder) { - from && - from.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - from.stateNode.node, - !1, - blockNativeResponder || !1 - ); - to && - to.stateNode && - reactPrivateInterface.fabricUIManager.setIsJSResponder( - to.stateNode.node, - !0, - blockNativeResponder || !1 - ); - } -}); if ( "function" !== typeof reactPrivateInterface.ReactFiberErrorDialog.showErrorDialog @@ -13634,19 +12439,10 @@ function nativeOnCaughtError(error, errorInfo) { } function nativeOnDefaultTransitionIndicator() {} batchedUpdatesImpl = function (fn, a) { - var prevExecutionContext = executionContext; - executionContext |= 1; - try { - return fn(a); - } finally { - (executionContext = prevExecutionContext), - 0 === executionContext && - ((workInProgressRootRenderTargetTime = now$1() + 500), - flushSyncWorkAcrossRoots_impl(0, !0)); - } + return fn(a); }; var roots = new Map(), - internals$jscomp$inline_1634 = { + internals$jscomp$inline_1478 = { bundleType: 0, version: "19.3.0", rendererPackageName: "react-native-renderer", @@ -13654,18 +12450,18 @@ var roots = new Map(), reconcilerVersion: "19.3.0" }; null !== extraDevToolsConfig && - (internals$jscomp$inline_1634.rendererConfig = extraDevToolsConfig); + (internals$jscomp$inline_1478.rendererConfig = extraDevToolsConfig); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1981 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1782 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1981.isDisabled && - hook$jscomp$inline_1981.supportsFiber + !hook$jscomp$inline_1782.isDisabled && + hook$jscomp$inline_1782.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1981.inject( - internals$jscomp$inline_1634 + (rendererID = hook$jscomp$inline_1782.inject( + internals$jscomp$inline_1478 )), - (injectedHook = hook$jscomp$inline_1981); + (injectedHook = hook$jscomp$inline_1782); } catch (err) {} } exports.createPortal = function (children, containerTag) { @@ -13708,6 +12504,18 @@ exports.findNodeHandle = function (componentOrHandle) { ? componentOrHandle : reactPrivateInterface.getNativeTagFromPublicInstance(componentOrHandle); }; +exports.flushSync = function (fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = currentUpdatePriority; + try { + if (((ReactSharedInternals.T = null), (currentUpdatePriority = 2), fn)) + return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (currentUpdatePriority = previousUpdatePriority), + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(0); + } +}; exports.getNodeFromInternalInstanceHandle = function (internalInstanceHandle) { return ( internalInstanceHandle && @@ -13745,14 +12553,15 @@ exports.render = function ( concurrentRoot, options ) { - var root = roots.get(containerTag); - if (!root) { - root = nativeOnUncaughtError; + if (!concurrentRoot) throw Error("render: Unsupported Legacy Mode API."); + concurrentRoot = roots.get(containerTag); + if (!concurrentRoot) { + concurrentRoot = nativeOnUncaughtError; var onCaughtError = nativeOnCaughtError, onRecoverableError = defaultOnRecoverableError; options && void 0 !== options.onUncaughtError && - (root = options.onUncaughtError); + (concurrentRoot = options.onUncaughtError); options && void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError); @@ -13764,26 +12573,24 @@ exports.render = function ( reactPrivateInterface.createPublicRootInstance(containerTag), containerTag: containerTag }; - concurrentRoot = concurrentRoot ? 1 : 0; - root = new FiberRootNode( + options = new FiberRootNode( options, - concurrentRoot, !1, "", - root, + concurrentRoot, onCaughtError, onRecoverableError, nativeOnDefaultTransitionIndicator, null ); - concurrentRoot = 1 === concurrentRoot ? 1 : 0; + concurrentRoot = 1; isDevToolsPresent && (concurrentRoot |= 2); concurrentRoot = createFiberImplClass(3, null, null, concurrentRoot); - root.current = concurrentRoot; - concurrentRoot.stateNode = root; + options.current = concurrentRoot; + concurrentRoot.stateNode = options; onCaughtError = createCache(); onCaughtError.refCount++; - root.pooledCache = onCaughtError; + options.pooledCache = onCaughtError; onCaughtError.refCount++; concurrentRoot.memoizedState = { element: null, @@ -13791,10 +12598,11 @@ exports.render = function ( cache: onCaughtError }; initializeUpdateQueue(concurrentRoot); - roots.set(containerTag, root); + concurrentRoot = options; + roots.set(containerTag, concurrentRoot); } - updateContainer(element, root, null, callback); - a: if (((element = root.current), element.child)) + updateContainer(element, concurrentRoot, null, callback); + a: if (((element = concurrentRoot.current), element.child)) switch (element.child.tag) { case 27: case 5: