diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js index 0e1df93ff8..3dbf7d00e9 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -418,6 +418,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -806,9 +809,10 @@ __DEV__ && enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = - dynamicFeatureFlags.disableDefaultPropsExceptForClasses; - dynamicFeatureFlags = dynamicFeatureFlags.enableFastJSX; - var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, + REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), @@ -853,7 +857,7 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = dynamicFeatureFlags && !0, + var enableFastJSXWithStringRefs = enableFastJSX && !0, enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 3313eb32ff..5998c225e8 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -f0e8164410049aabc680035e8fd45b657eb020ab +88959fd54af7d418b799a9898b921f32a356b212 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 3313eb32ff..5998c225e8 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -f0e8164410049aabc680035e8fd45b657eb020ab +88959fd54af7d418b799a9898b921f32a356b212 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 3fd6b793af..89abf14bf6 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -504,6 +504,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -1196,6 +1199,7 @@ __DEV__ && disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -1394,20 +1398,36 @@ __DEV__ && exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; exports.act = function (callback) { - var prevActQueue = ReactSharedInternals.actQueue, + var prevIsBatchingLegacy = disableLegacyMode + ? !1 + : ReactSharedInternals.isBatchingLegacy, + prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth; actScopeDepth++; var queue = (ReactSharedInternals.actQueue = - null !== prevActQueue ? prevActQueue : []), - didAwaitActCall = !1; + null !== prevActQueue ? prevActQueue : []); + disableLegacyMode || (ReactSharedInternals.isBatchingLegacy = !0); + var didAwaitActCall = !1; try { + disableLegacyMode || + (ReactSharedInternals.didScheduleLegacyUpdate = !1); var result = callback(); + var didScheduleLegacyUpdate = disableLegacyMode + ? !1 + : ReactSharedInternals.didScheduleLegacyUpdate; + !prevIsBatchingLegacy && + didScheduleLegacyUpdate && + flushActQueue(queue); + disableLegacyMode || + (ReactSharedInternals.isBatchingLegacy = prevIsBatchingLegacy); } catch (error$3) { ReactSharedInternals.thrownErrors.push(error$3); } if (0 < ReactSharedInternals.thrownErrors.length) throw ( - (popActScope(prevActQueue, prevActScopeDepth), + (disableLegacyMode || + (ReactSharedInternals.isBatchingLegacy = prevIsBatchingLegacy), + popActScope(prevActQueue, prevActScopeDepth), (callback = aggregateErrors(ReactSharedInternals.thrownErrors)), (ReactSharedInternals.thrownErrors.length = 0), callback) @@ -1967,7 +1987,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-f0e8164410-20240614"; + exports.version = "19.0.0-www-classic-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index c2ea9850b9..a15ec5acc0 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -1967,7 +1967,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-f0e8164410-20240614"; + exports.version = "19.0.0-www-modern-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index be690ab018..072246c59e 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index acb34cd0bf..89e5878629 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 777c283155..b259de40de 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index 0ad2ebad74..2c1f034dcd 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 75ef97567d..80490dabee 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -311,6 +311,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -2196,6 +2199,10 @@ __DEV__ && scheduleImmediateTask(processRootScheduleInMicrotask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); + !disableLegacyMode && + ReactSharedInternals.isBatchingLegacy && + 0 === root.tag && + (ReactSharedInternals.didScheduleLegacyUpdate = !0); } function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -2203,7 +2210,7 @@ __DEV__ && do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( @@ -3835,7 +3842,15 @@ __DEV__ && thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -4117,8 +4132,9 @@ __DEV__ && currentlyRenderingFiber$1 = null; hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + null === current || + (current.flags & 31457280) === (workInProgress.flags & 31457280) || + (!disableLegacyMode && 0 === (current.mode & 1)) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5587,6 +5603,124 @@ __DEV__ && ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum + ); + } + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + addendum = new ctor(props, context); + } finally { + setIsStrictModeForDevtools(!1); + } + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), + error$jscomp$0( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; + } function callComponentWillReceiveProps( workInProgress, instance, @@ -5613,6 +5747,192 @@ __DEV__ && null )); } + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name + ); + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name + ); + instance.propTypes && + error$jscomp$0( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + name + ); + instance.contextType && + error$jscomp$0( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name + ); + instance.contextTypes && + error$jscomp$0( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name + ); + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name + ); + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" + ); + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name + ); + "function" === typeof instance.componentDidReceiveProps && + error$jscomp$0( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name + ); + "function" === typeof instance.componentWillRecieveProps && + error$jscomp$0( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name + ); + "function" === typeof instance.UNSAFE_componentWillRecieveProps && + error$jscomp$0( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name + ); + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && + error$jscomp$0( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name + ); + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & 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 && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + } function resolveClassComponentProps( Component, baseProps, @@ -5752,73 +6072,110 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 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))); enableDebugTracing && sourceFiber.mode & 4 && - ((returnFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(returnFiber, value)); - returnFiber = suspenseHandlerStackCursor.current; - if (null !== returnFiber) { - switch (returnFiber.tag) { + ((currentSourceFiber = + getComponentNameFromFiber(sourceFiber) || "Unknown"), + logComponentSuspended(currentSourceFiber, value)); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === returnFiber.alternate && + : null === currentSourceFiber.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 - ); + (workInProgressRootExitStatus = RootSuspended); + currentSourceFiber.flags &= -257; + disableLegacyMode || 0 !== (currentSourceFiber.mode & 1) + ? ((currentSourceFiber.flags |= 65536), + (currentSourceFiber.lanes = rootRenderLanes)) + : 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(SyncLane)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, SyncLane)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= SyncLane)); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((returnFiber = currentSourceFiber.updateQueue), + null === returnFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !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 - ); + if (disableLegacyMode || 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 (" + - returnFiber.tag + + currentSourceFiber.tag + "). This is a bug in React." ); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); } - var error = createCapturedValueAtFiber( + 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 } @@ -5826,8 +6183,8 @@ __DEV__ && sourceFiber ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [error]) - : workInProgressRootConcurrentErrors.push(error); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored); if (null === returnFiber) return !0; @@ -5850,13 +6207,16 @@ __DEV__ && case 1: if ( ((sourceFiber = returnFiber.type), - (error = returnFiber.stateNode), + (currentSourceFiber = returnFiber.stateNode), 0 === (returnFiber.flags & 128) && ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== error && - "function" === typeof error.componentDidCatch && + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(error))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( (returnFiber.flags |= 65536), @@ -6205,30 +6565,37 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & OffscreenLane)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = OffscreenLane), - deferHiddenOffscreenComponent( - current, - workInProgress, + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & OffscreenLane)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = + OffscreenLane), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + else + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -6386,7 +6753,7 @@ __DEV__ && return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -6425,570 +6792,214 @@ __DEV__ && ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - lane = !1; - state = emptyContextObject; - var context = Component.contextType; - if ( - "contextType" in Component && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) - ) { - didWarnAboutInvalidateContextType.add(Component); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((state = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (lane = Component.contextTypes), - (context = (lane = null !== lane && void 0 !== lane) - ? getMaskedContext(workInProgress, state) - : emptyContextObject)); - addendum = new Component(nextProps, context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - addendum = new Component(nextProps, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - var state$jscomp$0 = (workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null); - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state$jscomp$0 && - ((state$jscomp$0 = - getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state$jscomp$0) || - (didWarnAboutUninitializedState.add(state$jscomp$0), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state$jscomp$0, - null === addendum.state ? "null" : "undefined", - state$jscomp$0 - ))); - if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (state$jscomp$0 = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (state$jscomp$0 = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (state$jscomp$0 = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== state$jscomp$0 || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - addendum = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(addendum) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(addendum), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - addendum, - newApiName, - null !== state$jscomp$0 ? "\n " + state$jscomp$0 : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); - } - } - lane && - ((lane = workInProgress.stateNode), - (lane.__reactInternalMemoizedUnmaskedChildContext = state), - (lane.__reactInternalMemoizedMaskedChildContext = context)); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { state = workInProgress.stateNode; - lane = getComponentNameFromType(Component) || "Component"; - state.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - lane - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - lane - )); - !state.getInitialState || - state.getInitialState.isReactClassApproved || - state.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - lane - ); - state.getDefaultProps && - !state.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - lane - ); - state.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - lane - ); - state.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - lane - ); - state.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - lane - ); - Component.contextType && - Component.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(Component) && - (didWarnAboutContextTypeAndContextTypes.add(Component), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - lane - )); - "function" === typeof state.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - lane - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof state.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof state.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - lane - ); - "function" === typeof state.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - lane - ); - "function" === typeof state.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - lane - ); - "function" === typeof state.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - lane - ); - context = state.props !== nextProps; - void 0 !== state.props && - context && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - lane - ); - state.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - lane, - lane - ); - "function" !== typeof state.getSnapshotBeforeUpdate || - "function" === typeof state.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof state.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof state.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - lane - ); - (context = state.state) && - ("object" !== typeof context || isArrayImpl(context)) && - error$jscomp$0("%s.state: must be set to an object or null", lane); - "function" === typeof state.getChildContext && - "object" !== typeof Component.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - lane - ); - state = workInProgress.stateNode; - state.props = nextProps; - state.state = workInProgress.memoizedState; - state.refs = {}; - initializeUpdateQueue(workInProgress); - lane = Component.contextType; - "object" === typeof lane && null !== lane - ? (state.context = readContext(lane)) - : ((lane = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (state.context = getMaskedContext(workInProgress, lane))); - state.state === nextProps && - ((lane = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(lane) || - (didWarnAboutDirectlyAssigningPropsToState.add(lane), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - lane - ))); - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - state - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - state - ); - state.state = workInProgress.memoizedState; - lane = Component.getDerivedStateFromProps; - "function" === typeof lane && - (applyDerivedStateFromProps( - workInProgress, - Component, - lane, - nextProps - ), - (state.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ((lane = state.state), - "function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount(), - lane !== state.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - state, - state.state, - null - )), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state.state = workInProgress.memoizedState)); - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); - state = !0; - } else if (null === current$jscomp$0) - (state = workInProgress.stateNode), - (foundWillUpdateName = workInProgress.memoizedProps), - (lane = resolveClassComponentProps( - Component, - foundWillUpdateName, - workInProgress.type === workInProgress.elementType - )), - (state.props = lane), - (state$jscomp$0 = state.context), - (context = Component.contextType), - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (context = getMaskedContext(workInProgress, context))), - (foundWillReceivePropsName = Component.getDerivedStateFromProps), - (addendum = - "function" === typeof foundWillReceivePropsName || - "function" === typeof state.getSnapshotBeforeUpdate), - (foundWillUpdateName = - workInProgress.pendingProps !== foundWillUpdateName), - addendum || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((foundWillUpdateName || state$jscomp$0 !== context) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - context - )), - (hasForceUpdate = !1), - (newApiName = workInProgress.memoizedState), - (state.state = newApiName), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state$jscomp$0 = workInProgress.memoizedState), - foundWillUpdateName || - newApiName !== state$jscomp$0 || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof foundWillReceivePropsName && - (applyDerivedStateFromProps( - workInProgress, - Component, - foundWillReceivePropsName, - nextProps - ), - (state$jscomp$0 = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - newApiName, - state$jscomp$0, - context - )) - ? (addendum || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = state$jscomp$0)), - (state.props = nextProps), - (state.state = state$jscomp$0), - (state.context = context), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (state = !1)); - else { - state = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - lane = workInProgress.memoizedProps; - context = resolveClassComponentProps( + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps( Component, - lane, + unresolvedOldProps, workInProgress.type === workInProgress.elementType ); - state.props = context; - addendum = workInProgress.pendingProps; - foundWillUpdateName = state.context; - state$jscomp$0 = Component.contextType; - "object" === typeof state$jscomp$0 && null !== state$jscomp$0 - ? (state$jscomp$0 = readContext(state$jscomp$0)) - : ((state$jscomp$0 = isContextProvider(Component) + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor$1.current), - (state$jscomp$0 = getMaskedContext( - workInProgress, - state$jscomp$0 - ))); - newApiName = Component.getDerivedStateFromProps; - (foundWillReceivePropsName = - "function" === typeof newApiName || - "function" === typeof state.getSnapshotBeforeUpdate) || + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || ("function" !== typeof state.UNSAFE_componentWillReceiveProps && "function" !== typeof state.componentWillReceiveProps) || - ((lane !== addendum || foundWillUpdateName !== state$jscomp$0) && + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, state, nextProps, - state$jscomp$0 + contextType )); hasForceUpdate = !1; - foundWillUpdateName = workInProgress.memoizedState; - state.state = foundWillUpdateName; + var oldState = workInProgress.memoizedState; + state.state = oldState; processUpdateQueue(workInProgress, nextProps, state, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== addendum || - foundWillUpdateName !== newState || + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || didPerformWorkStackCursor.current || - hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof newApiName && + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps( workInProgress, Component, - newApiName, + getDerivedStateFromProps, nextProps ), - (newState = workInProgress.memoizedState)), - (context = + (oldContext = workInProgress.memoizedState)), + (lane = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + lane, nextProps, - foundWillUpdateName, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( + Component, + lane, + workInProgress.type === workInProgress.elementType + ); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor$1.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (enableLazyContextPropagation && + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, newState, - state$jscomp$0 + oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (foundWillReceivePropsName || + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || ("function" !== typeof state.UNSAFE_componentWillUpdate && "function" !== typeof state.componentWillUpdate) || ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate( - nextProps, - newState, - state$jscomp$0 - ), + state.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof state.UNSAFE_componentWillUpdate && state.UNSAFE_componentWillUpdate( nextProps, newState, - state$jscomp$0 + oldContext )), "function" === typeof state.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof state.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), (state.props = nextProps), (state.state = newState), - (state.context = state$jscomp$0), - (state = context)) + (state.context = oldContext), + (state = contextType)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (state = !1)); } - context = state; - markRef(current$jscomp$0, workInProgress); - lane = 0 !== (workInProgress.flags & 128); - if (context || lane) { - context = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (lane && "function" !== typeof Component.getDerivedStateFromError) - (addendum = null), (profilerStartTime = -1); - else { - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - addendum = callRenderInDEV(context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - enableSchedulingProfiler && markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && lane - ? ((lane = addendum), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lane, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - addendum, - renderLanes - ); - workInProgress.memoizedState = context.state; - _instance && invalidateContextProvider(workInProgress, Component, !0); - current$jscomp$0 = workInProgress.child; - } else - _instance && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - )); + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); Component = workInProgress.stateNode; state && Component.props !== nextProps && @@ -6998,7 +7009,76 @@ __DEV__ && getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + enableSchedulingProfiler && markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -7099,18 +7179,18 @@ __DEV__ && ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = nextPrimaryChildren.updateQueue), - null === renderLanes + (current = nextPrimaryChildren.updateQueue), + null === current ? (nextPrimaryChildren.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -7162,9 +7242,11 @@ __DEV__ && : (reuseSuspenseHandlerOnStack(workInProgress), (nextPrimaryChildren = nextProps.fallback), (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - showFallback + showFallback, + 0, + null )), (nextPrimaryChildren = createFiberFromFragment( nextPrimaryChildren, @@ -7177,12 +7259,13 @@ __DEV__ && (nextPrimaryChildren.return = workInProgress), (nextProps.sibling = nextPrimaryChildren), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), @@ -7317,12 +7400,22 @@ __DEV__ && nextPrimaryChildren = nextProps.fallback; showFallback = workInProgress.mode; didSuspend = current.child; - var currentFallbackChildFragment = didSuspend.sibling; - nextProps = createWorkInProgress(didSuspend, { - mode: "hidden", - children: nextProps.children - }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + var currentFallbackChildFragment = didSuspend.sibling, + primaryChildProps = { mode: "hidden", children: nextProps.children }; + disableLegacyMode || + 0 !== (showFallback & 1) || + workInProgress.child === didSuspend + ? ((nextProps = createWorkInProgress(didSuspend, primaryChildProps)), + (nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = primaryChildProps), + workInProgress.mode & 2 && + ((nextProps.actualDuration = 0), + (nextProps.actualStartTime = -1), + (nextProps.selfBaseDuration = didSuspend.selfBaseDuration), + (nextProps.treeBaseDuration = didSuspend.treeBaseDuration)), + (workInProgress.deletions = null)); null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -7360,36 +7453,33 @@ __DEV__ && cachePool: didSuspend })); nextPrimaryChildren.memoizedState = showFallback; - if ( - enableTransitionTracing && + enableTransitionTracing && ((showFallback = enableTransitionTracing ? transitionStack.current : null), - null !== showFallback) - ) { - didSuspend = enableTransitionTracing - ? markerInstanceStack.current - : null; - currentFallbackChildFragment = nextPrimaryChildren.updateQueue; - var currentOffscreenQueue = current.updateQueue; - null === currentFallbackChildFragment - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: null - }) - : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); - } + null !== showFallback && + ((didSuspend = enableTransitionTracing + ? markerInstanceStack.current + : null), + (currentFallbackChildFragment = nextPrimaryChildren.updateQueue), + (primaryChildProps = current.updateQueue), + null === currentFallbackChildFragment + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: null + }) + : currentFallbackChildFragment === primaryChildProps + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -7399,28 +7489,33 @@ __DEV__ && return nextProps; } pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -7431,26 +7526,37 @@ __DEV__ && fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || + 0 !== (mode & 1) || + null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = 0), + (progressedPrimaryFragment.actualStartTime = -1), + (progressedPrimaryFragment.selfBaseDuration = 0), + (progressedPrimaryFragment.treeBaseDuration = 0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); - } function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -7629,59 +7735,69 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + null === current || + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } function bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -7916,8 +8032,10 @@ __DEV__ && switch (workInProgress.tag) { case 16: a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), (workInProgress.type = current), "function" === typeof current) ) @@ -8310,6 +8428,52 @@ __DEV__ && workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, returnFiber, prevSibling); + mountClassInstance( + workInProgress, + returnFiber, + prevSibling, + renderLanes + ); + return finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ); case 19: return updateSuspenseListComponent( current, @@ -9009,6 +9173,8 @@ __DEV__ && function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -9264,6 +9430,11 @@ __DEV__ && bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(workInProgress); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor, workInProgress); fallthroughToNormalSuspensePath = workInProgress.memoizedState; @@ -9391,14 +9562,14 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & OffscreenLane) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & OffscreenLane) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -9434,6 +9605,8 @@ __DEV__ && bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error( "Unknown unit of work tag (" + @@ -9593,20 +9766,30 @@ __DEV__ && (executionContext & CommitContext) !== NoContext ); } - function callComponentWillUnmountWithTimer(current, instance) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + try { + if ( + ((instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + )), + (instance.state = current.memoizedState), + shouldProfile(current)) + ) + try { + startLayoutEffectTimer(), instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + else instance.componentWillUnmount(); + } catch (error$7) { + captureCommitPhaseError(current, nearestMountedAncestor, error$7); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -10216,30 +10399,40 @@ __DEV__ && ); break; case 22: - prevState = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevState = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevState) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevState; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else + recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -10645,21 +10838,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (_prevHostParent = deletedFiber.stateNode), - "function" === typeof _prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, _prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof _prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + _prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10676,15 +10863,21 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (_prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = _prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (_prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = _prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -10993,15 +11186,17 @@ __DEV__ && safelyDetachRef(current, current.return); suspenseCallback = null !== finishedWork.memoizedState; retryQueue = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + if (disableLegacyMode || finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -11017,7 +11212,8 @@ __DEV__ && null === current || retryQueue || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -11193,18 +11389,12 @@ __DEV__ && case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -11576,12 +11766,20 @@ __DEV__ && committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -11704,12 +11902,21 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -12100,6 +12307,76 @@ __DEV__ && ))); } } + function invokeLayoutEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Layout | HasEffect, fiber); + } catch (error$37) { + captureCommitPhaseError(fiber, fiber.return, error$37); + } + break; + case 1: + var instance = fiber.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error$38) { + captureCommitPhaseError(fiber, fiber.return, error$38); + } + } + } + function invokePassiveEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Passive | HasEffect, fiber); + } catch (error$39) { + captureCommitPhaseError(fiber, fiber.return, error$39); + } + } + } + function invokeLayoutEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Layout | HasEffect, + fiber, + fiber.return + ); + } catch (error$40) { + captureCommitPhaseError(fiber, fiber.return, error$40); + } + break; + case 1: + var instance = fiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount(fiber, fiber.return, instance); + } + } + function invokePassiveEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Passive | HasEffect, + fiber, + fiber.return + ); + } catch (error$41) { + captureCommitPhaseError(fiber, fiber.return, error$41); + } + } + } function isConcurrentActEnvironment() { var isReactActEnvironmentGlobal = "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT @@ -12177,15 +12454,17 @@ __DEV__ && )); } function requestUpdateLane(fiber) { + var mode = fiber.mode; + if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; 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), + mode = ReactSharedInternals.T; + return null !== mode + ? (mode._updatedFibers || (mode._updatedFibers = new Set()), + mode._updatedFibers.add(fiber), (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane()) : currentUpdatePriority || DefaultEventPriority; @@ -12230,10 +12509,10 @@ __DEV__ && "Unknown"; didWarnAboutUpdateInRenderForAnotherComponent.has(root) || (didWarnAboutUpdateInRenderForAnotherComponent.add(root), - (lane = getComponentNameFromFiber(fiber) || "Unknown"), + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), error$jscomp$0( "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", - lane, + fiber, root, root )); @@ -12248,20 +12527,21 @@ __DEV__ && } else { isDevToolsPresent && addFiberToLanesMap(root, fiber, lane); warnIfUpdatesNotWrappedWithActDEV(fiber); - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now$1()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index = 31 - clz32(lane), - transitions = transitionLanesMap[index]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now$1()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index = 31 - clz32(lane), + transitions = transitionLanesMap[index]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index] = transitions; + } } root === workInProgressRoot && ((executionContext & RenderContext) === NoContext && @@ -12273,6 +12553,13 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); + lane !== SyncLane || + executionContext !== NoContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ReactSharedInternals.isBatchingLegacy || + ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -12485,7 +12772,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$37) { + } catch (error$42) { return !1; } } @@ -12541,7 +12828,7 @@ __DEV__ && currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { + if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -12788,8 +13075,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$38) { - handleThrow(root, thrownValue$38); + } catch (thrownValue$43) { + handleThrow(root, thrownValue$43); } while (1); lanes && root.shellSuspendCounter++; @@ -12931,8 +13218,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$39) { - handleThrow(root, thrownValue$39); + } catch (thrownValue$44) { + handleThrow(root, thrownValue$44); } while (1); resetContextDependencies(); @@ -13076,9 +13363,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$40) { + } catch (error$45) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$40); + throw ((workInProgress = returnFiber), error$45); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -13296,7 +13583,7 @@ __DEV__ && (rootWithPassiveNestedUpdates = null)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); + transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); @@ -13314,7 +13601,8 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) && + 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && @@ -13423,7 +13711,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); - commitDoubleInvokeEffectsInDEV(root); + commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(!1); if (enableTransitionTracing) { @@ -13561,7 +13849,8 @@ __DEV__ && : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); - isConcurrentActEnvironment() && + (disableLegacyMode || 0 !== root.tag) && + isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && error$jscomp$0( "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" @@ -13579,7 +13868,12 @@ __DEV__ && ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) + ? claimNextRetryLane() + : SyncLane)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -13690,17 +13984,52 @@ __DEV__ && reconnectPassiveEffects(root, fiber, 0, null, !1); setIsStrictModeForDevtools(!1); } - function commitDoubleInvokeEffectsInDEV(root) { - var doubleInvokeEffects = !0; - root.current.mode & 24 || (doubleInvokeEffects = !1); - recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root, - root.current, - doubleInvokeEffects - ); + function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { + disableLegacyMode || 0 !== root.tag + ? ((hasPassiveEffects = !0), + (!disableLegacyMode && 1 !== root.tag) || + root.current.mode & 24 || + (hasPassiveEffects = !1), + recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + root.current, + hasPassiveEffects + )) + : runWithFiberInDEV( + root.current, + legacyCommitDoubleInvokeEffectsInDEV, + root.current, + hasPassiveEffects + ); + } + function legacyCommitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectUnmountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, invokePassiveEffectUnmountInDEV); + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectMountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, 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))); + } } function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { - if ((executionContext & RenderContext) === NoContext) { + if ( + (executionContext & RenderContext) === NoContext && + (disableLegacyMode || fiber.mode & 1) + ) { var tag = fiber.tag; if ( 3 === tag || @@ -13736,14 +14065,18 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - isConcurrentActEnvironment() && - null === ReactSharedInternals.actQueue && - runWithFiberInDEV(fiber, function () { - error$jscomp$0( - "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) - ); - }); + disableLegacyMode || fiber.mode & 1 + ? isConcurrentActEnvironment() && + null === ReactSharedInternals.actQueue && + runWithFiberInDEV(fiber, function () { + error$jscomp$0( + "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) + ); + }) + : "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT + ? IS_REACT_ACT_ENVIRONMENT + : void 0; } function resolveFunctionForHotReloading(type) { if (null === resolveFamily) return type; @@ -14104,10 +14437,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -14332,7 +14667,7 @@ __DEV__ && onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -14372,16 +14707,30 @@ __DEV__ && for ( this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], - tag = 0; - tag < TotalLanes; - tag++ + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; tag < TotalLanes; tag++) containerInfo.push(new Set()); - this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + for ( + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ + ) + containerInfo.push(new Set()); + if (disableLegacyMode) + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + else + switch (tag) { + case 1: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case 0: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + } } function updateContainerSync( element, @@ -14531,6 +14880,7 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -16469,9 +16819,10 @@ __DEV__ && +_this$props.height, this._tagRef ); + var tag = disableLegacyMode ? 1 : 0; _this$props = new FiberRootNode( this._surface, - 1, + tag, !1, "", void 0, @@ -16481,21 +16832,21 @@ __DEV__ && ); _this$props.hydrationCallbacks = null; enableTransitionTracing && (_this$props.transitionCallbacks = void 0); - var uninitializedFiber = 1; - isDevToolsPresent && (uninitializedFiber |= 2); - uninitializedFiber = createFiber(3, null, null, uninitializedFiber); - _this$props.current = uninitializedFiber; - uninitializedFiber.stateNode = _this$props; + tag = disableLegacyMode || 1 === tag ? 1 : 0; + isDevToolsPresent && (tag |= 2); + tag = createFiber(3, null, null, tag); + _this$props.current = tag; + tag.stateNode = _this$props; var initialCache = createCache(); retainCache(initialCache); _this$props.pooledCache = initialCache; retainCache(initialCache); - uninitializedFiber.memoizedState = { + tag.memoizedState = { element: null, isDehydrated: !1, cache: initialCache }; - initializeUpdateQueue(uninitializedFiber); + initializeUpdateQueue(tag); this._mountNode = _this$props; updateContainerSync(this.props.children, this._mountNode, this); flushSyncWork(); @@ -16583,14 +16934,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); })({ findFiberByHostInstance: function () { return null; }, bundleType: 1, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-art" }); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 29d3f8c97c..034bd565c9 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -16364,14 +16364,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); })({ findFiberByHostInstance: function () { return null; }, bundleType: 1, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-art" }); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 84bcdd0024..2b95a51a54 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -84,6 +84,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -221,6 +222,9 @@ function getComponentNameFromFiber(fiber) { return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -1046,6 +1050,10 @@ function isContextProvider(type) { type = type.childContextTypes; return null !== type && void 0 !== type; } +function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor$1); +} function pushTopLevelContextObject(fiber, context, didChange) { if (contextStackCursor$1.current !== emptyContextObject) throw Error(formatProdErrorMessage(168)); @@ -1249,7 +1257,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$13 = getNextLanes( root, @@ -2458,7 +2466,15 @@ function createChildReconciler(shouldTrackSideEffects) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -3416,7 +3432,7 @@ function refreshCache(fiber, seedKey, seedValue) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(); + var lane = requestUpdateLane(provider); fiber = createUpdate(lane); var root = enqueueUpdate(provider, fiber, lane); null !== root && @@ -3434,7 +3450,7 @@ function refreshCache(fiber, seedKey, seedValue) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); + var lane = requestUpdateLane(fiber); action = { lane: lane, revertLane: 0, @@ -3451,7 +3467,7 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), update = { lane: lane, revertLane: 0, @@ -3847,7 +3863,7 @@ var classComponentUpdater = { }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.payload = payload; void 0 !== callback && null !== callback && (update.callback = callback); @@ -3858,7 +3874,7 @@ var classComponentUpdater = { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -3870,7 +3886,7 @@ var classComponentUpdater = { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 2; void 0 !== callback && null !== callback && (update.callback = callback); @@ -3896,6 +3912,33 @@ function checkShouldComponentUpdate( ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; +} function callComponentWillReceiveProps( workInProgress, instance, @@ -3910,6 +3953,41 @@ 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; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} function resolveClassComponentProps( Component, baseProps, @@ -4048,69 +4126,106 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - returnFiber = suspenseHandlerStackCursor.current; - if (null !== returnFiber) { - switch (returnFiber.tag) { + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === returnFiber.alternate && + : null === currentSourceFiber.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 - ); + (workInProgressRootExitStatus = 3); + currentSourceFiber.flags &= -257; + disableLegacyMode || 0 !== (currentSourceFiber.mode & 1) + ? ((currentSourceFiber.flags |= 65536), + (currentSourceFiber.lanes = rootRenderLanes)) + : 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)); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((returnFiber = currentSourceFiber.updateQueue), + null === returnFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !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 - ); + if (disableLegacyMode || 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(formatProdErrorMessage(435, returnFiber.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); - wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wrapperError]) - : workInProgressRootConcurrentErrors.push(wrapperError); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; value = createCapturedValueAtFiber(value, sourceFiber); @@ -4128,13 +4243,15 @@ function throwException( case 1: if ( ((sourceFiber = returnFiber.type), - (wrapperError = returnFiber.stateNode), + (currentSourceFiber = returnFiber.stateNode), 0 === (returnFiber.flags & 128) && ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== wrapperError && - "function" === typeof wrapperError.componentDidCatch && + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( (returnFiber.flags |= 65536), @@ -4451,28 +4568,36 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -4598,7 +4723,7 @@ function replayFunctionComponent( return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -4609,123 +4734,47 @@ function updateClassComponent( pushContextProvider(workInProgress); } else hasContext = !1; prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (isLegacyContextConsumer = Component.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - var instance = new Component(nextProps, context); - workInProgress.memoizedState = - null !== instance.state && void 0 !== instance.state - ? instance.state - : null; - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - instance._reactInternals = workInProgress; - isLegacyContextConsumer && - ((isLegacyContextConsumer = workInProgress.stateNode), - (isLegacyContextConsumer.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (isLegacyContextConsumer.__reactInternalMemoizedMaskedChildContext = - context)); - unmaskedContext = workInProgress.stateNode; - unmaskedContext.props = nextProps; - unmaskedContext.state = workInProgress.memoizedState; - unmaskedContext.refs = {}; - initializeUpdateQueue(workInProgress); - isLegacyContextConsumer = Component.contextType; - "object" === typeof isLegacyContextConsumer && - null !== isLegacyContextConsumer - ? (unmaskedContext.context = readContext(isLegacyContextConsumer)) - : ((isLegacyContextConsumer = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (unmaskedContext.context = getMaskedContext( - workInProgress, - isLegacyContextConsumer - ))); - unmaskedContext.state = workInProgress.memoizedState; - isLegacyContextConsumer = Component.getDerivedStateFromProps; - "function" === typeof isLegacyContextConsumer && - (applyDerivedStateFromProps( - 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, - isLegacyContextConsumer, - nextProps - ), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ((isLegacyContextConsumer = unmaskedContext.state), - "function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount(), - isLegacyContextConsumer !== unmaskedContext.state && - classComponentUpdater.enqueueReplaceState( - unmaskedContext, - unmaskedContext.state, - null - ), - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ), - suspendIfUpdateReadFromEntangledAsyncAction(), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof unmaskedContext.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current$jscomp$0) { - unmaskedContext = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - isLegacyContextConsumer = resolveClassComponentProps( - Component, - unresolvedOldProps, - workInProgress.type === workInProgress.elementType - ); - unmaskedContext.props = isLegacyContextConsumer; - var oldContext = unmaskedContext.context; - context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) + unresolvedOldProps, + workInProgress.type === workInProgress.elementType + ); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor$1.current), - (context = getMaskedContext(workInProgress, context))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - instance = - "function" === typeof getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate; + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - instance || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== context) && + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, - context + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - unmaskedContext.state = oldState; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || @@ -4740,50 +4789,49 @@ function updateClassComponent( nextProps ), (oldContext = workInProgress.memoizedState)), - (isLegacyContextConsumer = + (oldProps = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - isLegacyContextConsumer, + oldProps, nextProps, oldState, oldContext, - context + contextType )) - ? (instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ("function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount()), - "function" === typeof unmaskedContext.componentDidMount && + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof unmaskedContext.componentDidMount && + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = oldContext), - (unmaskedContext.context = context), - (nextProps = isLegacyContextConsumer)) - : ("function" === typeof unmaskedContext.componentDidMount && + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - unmaskedContext = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - isLegacyContextConsumer = workInProgress.memoizedProps; - context = resolveClassComponentProps( + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( Component, - isLegacyContextConsumer, + oldProps, workInProgress.type === workInProgress.elementType ); - unmaskedContext.props = context; - instance = workInProgress.pendingProps; - unresolvedOldProps = unmaskedContext.context; + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; oldContext = Component.contextType; "object" === typeof oldContext && null !== oldContext ? (oldContext = readContext(oldContext)) @@ -4794,31 +4842,30 @@ function updateClassComponent( oldState = Component.getDerivedStateFromProps; (getDerivedStateFromProps = "function" === typeof oldState || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate) || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((isLegacyContextConsumer !== instance || - unresolvedOldProps !== oldContext) && + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, oldContext )); hasForceUpdate = !1; unresolvedOldProps = workInProgress.memoizedState; - unmaskedContext.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - isLegacyContextConsumer !== instance || + oldProps !== hasNewLifecycles || unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && (applyDerivedStateFromProps( workInProgress, @@ -4827,106 +4874,117 @@ function updateClassComponent( nextProps ), (newState = workInProgress.memoizedState)), - (context = + (contextType = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + contextType, nextProps, unresolvedOldProps, newState, oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillUpdate && - "function" !== typeof unmaskedContext.componentWillUpdate) || - ("function" === typeof unmaskedContext.componentWillUpdate && - unmaskedContext.componentWillUpdate( - nextProps, - newState, - oldContext - ), - "function" === - typeof unmaskedContext.UNSAFE_componentWillUpdate && - unmaskedContext.UNSAFE_componentWillUpdate( + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( nextProps, newState, oldContext )), - "function" === typeof unmaskedContext.componentDidUpdate && + "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate && + "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = newState), - (unmaskedContext.context = oldContext), - (nextProps = context)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - unmaskedContext = nextProps; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { markRef(current$jscomp$0, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - unmaskedContext || nextProps - ? ((unmaskedContext = workInProgress.stateNode), - (current = workInProgress), - (isLegacyContextConsumer = - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? null - : unmaskedContext.render()), - (workInProgress.flags |= 1), - null !== current$jscomp$0 && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - isLegacyContextConsumer, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - isLegacyContextConsumer, - renderLanes - ), - (workInProgress.memoizedState = unmaskedContext.state), - hasContext && invalidateContextProvider(workInProgress, Component, !0), - (current$jscomp$0 = workInProgress.child)) - : (hasContext && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( current$jscomp$0, workInProgress, renderLanes - ))); - return current$jscomp$0; + ) + ); + shouldUpdate = workInProgress.stateNode; + current = workInProgress; + var nextChildren = + didCaptureError && "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -4992,18 +5050,18 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = nextPrimaryChildren.updateQueue), - null === renderLanes + (current = nextPrimaryChildren.updateQueue), + null === current ? (nextPrimaryChildren.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -5049,9 +5107,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { : (reuseSuspenseHandlerOnStack(workInProgress), (nextPrimaryChildren = nextProps.fallback), (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - showFallback + showFallback, + 0, + null )), (nextPrimaryChildren = createFiberFromFragment( nextPrimaryChildren, @@ -5064,12 +5124,13 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextPrimaryChildren.return = workInProgress), (nextProps.sibling = nextPrimaryChildren), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), (nextProps.childLanes = getRemainingWorkInPrimaryTree( @@ -5180,12 +5241,17 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextPrimaryChildren = nextProps.fallback; showFallback = workInProgress.mode; didSuspend = current.child; - var currentFallbackChildFragment = didSuspend.sibling; - nextProps = createWorkInProgress(didSuspend, { - mode: "hidden", - children: nextProps.children - }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + var currentFallbackChildFragment = didSuspend.sibling, + primaryChildProps = { mode: "hidden", children: nextProps.children }; + disableLegacyMode || + 0 !== (showFallback & 1) || + workInProgress.child === didSuspend + ? ((nextProps = createWorkInProgress(didSuspend, primaryChildProps)), + (nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = primaryChildProps), + (workInProgress.deletions = null)); null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -5223,34 +5289,31 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { cachePool: didSuspend })); nextPrimaryChildren.memoizedState = showFallback; - if ( - enableTransitionTracing && + enableTransitionTracing && ((showFallback = enableTransitionTracing ? transitionStack.current : null), - null !== showFallback) - ) { - didSuspend = enableTransitionTracing ? markerInstanceStack.current : null; - currentFallbackChildFragment = nextPrimaryChildren.updateQueue; - var currentOffscreenQueue = current.updateQueue; - null === currentFallbackChildFragment - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: null - }) - : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); - } + null !== showFallback && + ((didSuspend = enableTransitionTracing + ? markerInstanceStack.current + : null), + (currentFallbackChildFragment = nextPrimaryChildren.updateQueue), + (primaryChildProps = current.updateQueue), + null === currentFallbackChildFragment + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: null + }) + : currentFallbackChildFragment === primaryChildProps + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps ? primaryChildProps.retryQueue : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -5260,27 +5323,32 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { return nextProps; } pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -5291,26 +5359,30 @@ function mountSuspenseFallbackChildren( fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || 0 !== (mode & 1) || null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); -} function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -5388,57 +5460,68 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) { nextProps &= 1; } push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 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; @@ -5603,11 +5686,12 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: + var elementType = workInProgress.elementType; a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); var props = workInProgress.pendingProps; - current = workInProgress.elementType; - var init = current._init; - current = init(current._payload); + current = elementType._init; + current = current(elementType._payload); workInProgress.type = current; if ("function" === typeof current) shouldConstruct(current) @@ -5633,7 +5717,10 @@ function beginWork(current, workInProgress, renderLanes) { ))); else { if (void 0 !== current && null !== current) - if (((init = current.$$typeof), init === REACT_FORWARD_REF_TYPE)) { + if ( + ((elementType = current.$$typeof), + elementType === REACT_FORWARD_REF_TYPE) + ) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -5646,7 +5733,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); break a; - } else if (init === REACT_MEMO_TYPE) { + } else if (elementType === REACT_MEMO_TYPE) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -5669,36 +5756,42 @@ function beginWork(current, workInProgress, renderLanes) { case 0: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), updateFunctionComponent( current, workInProgress, props, - init, + elementType, renderLanes ) ); case 1: return ( (props = workInProgress.type), - (init = resolveClassComponentProps( + (elementType = resolveClassComponentProps( props, workInProgress.pendingProps, workInProgress.elementType === props )), - updateClassComponent(current, workInProgress, props, init, renderLanes) + updateClassComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 3: pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - props = init.element; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; @@ -5707,17 +5800,17 @@ function beginWork(current, workInProgress, renderLanes) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === props + elementType = nextProps.element; + elementType === props ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, elementType, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: @@ -5725,17 +5818,17 @@ function beginWork(current, workInProgress, renderLanes) { case 5: return ( pushHostContext(workInProgress), - (init = workInProgress.type), + (elementType = workInProgress.type), (nextProps = workInProgress.pendingProps), (nextCache = null !== current ? current.memoizedProps : null), (props = nextProps.children), - shouldSetTextContent(init, nextProps) + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextCache && - shouldSetTextContent(init, nextCache) && + shouldSetTextContent(elementType, nextCache) && (workInProgress.flags |= 32), null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((elementType = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -5743,11 +5836,11 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = init), + (HostTransitionContext._currentValue2 = elementType), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== elementType && propagateContextChange( workInProgress, HostTransitionContext, @@ -5781,13 +5874,19 @@ function beginWork(current, workInProgress, renderLanes) { case 11: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - updateForwardRef(current, workInProgress, props, init, renderLanes) + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + updateForwardRef( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 7: return ( @@ -5824,14 +5923,14 @@ function beginWork(current, workInProgress, renderLanes) { props = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + elementType = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; + nextCache = elementType.value; pushProvider(workInProgress, props, nextCache); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -5842,19 +5941,24 @@ function beginWork(current, workInProgress, renderLanes) { break a; } } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (props = props(init)), + (elementType = readContext(elementType)), + (props = props(elementType)), (workInProgress.flags |= 1), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5862,14 +5966,20 @@ function beginWork(current, workInProgress, renderLanes) { case 14: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props.type, init)), - updateMemoComponent(current, workInProgress, props, init, renderLanes) + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props.type, elementType)), + updateMemoComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -5879,6 +5989,47 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(props) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, props, elementType); + mountClassInstance(workInProgress, props, elementType, renderLanes); + return finishClassComponent( + null, + workInProgress, + props, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + props, + elementType, + renderLanes + ); case 19: return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: @@ -5897,34 +6048,38 @@ function beginWork(current, workInProgress, renderLanes) { prepareToReadContext(workInProgress, renderLanes), (props = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((elementType = peekCacheFromPool()), + null === elementType && + ((elementType = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (elementType.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: props, cache: init }), + null !== nextProps && + (elementType.pooledCacheLanes |= renderLanes), + (elementType = nextProps)), + (workInProgress.memoizedState = { + parent: props, + cache: elementType + }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, elementType)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (elementType = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== props - ? ((init = { parent: props, cache: props }), - (workInProgress.memoizedState = init), + elementType.parent !== props + ? ((elementType = { parent: props, cache: props }), + (workInProgress.memoizedState = elementType), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), + elementType), pushProvider(workInProgress, CacheContext, props)) : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), - props !== init.cache && + props !== elementType.cache && propagateContextChange( workInProgress, CacheContext, @@ -6440,14 +6595,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$92 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$92 = lastTailNode), + for (var lastTailNode$100 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$92 + null === lastTailNode$100 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$92.sibling = null); + : (lastTailNode$100.sibling = null); } } function bubbleProperties(completedWork) { @@ -6457,19 +6612,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags & 31457280), - (subtreeFlags |= child$93.flags & 31457280), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (var child$101 = completedWork.child; null !== child$101; ) + (newChildLanes |= child$101.lanes | child$101.childLanes), + (subtreeFlags |= child$101.subtreeFlags & 31457280), + (subtreeFlags |= child$101.flags & 31457280), + (child$101.return = completedWork), + (child$101 = child$101.sibling); else - for (child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags), - (subtreeFlags |= child$93.flags), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (child$101 = completedWork.child; null !== child$101; ) + (newChildLanes |= child$101.lanes | child$101.childLanes), + (subtreeFlags |= child$101.subtreeFlags), + (subtreeFlags |= child$101.flags), + (child$101.return = completedWork), + (child$101 = child$101.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6477,6 +6632,8 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -6489,8 +6646,7 @@ function completeWork(current, workInProgress, renderLanes) { return bubbleProperties(workInProgress), null; case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)), + isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null ); @@ -6647,11 +6803,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$97 = null; + var cache$105 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$97 = newProps.memoizedState.cachePool.pool); - cache$97 !== instance && (newProps.flags |= 2048); + (cache$105 = newProps.memoizedState.cachePool.pool); + cache$105 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6674,13 +6830,18 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor); instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$97 = instance.rendering; - if (null === cache$97) + cache$105 = instance.rendering; + if (null === cache$105) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6688,11 +6849,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$97 = findFirstSuspended(current); - if (null !== cache$97) { + cache$105 = findFirstSuspended(current); + if (null !== cache$105) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$97.updateQueue; + current = cache$105.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6717,7 +6878,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$97)), null !== current)) { + if (((current = findFirstSuspended(cache$105)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6727,7 +6888,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$97.alternate) + !cache$105.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6739,13 +6900,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$97.sibling = workInProgress.child), - (workInProgress.child = cache$97)) + ? ((cache$105.sibling = workInProgress.child), + (workInProgress.child = cache$105)) : ((current = instance.last), null !== current - ? (current.sibling = cache$97) - : (workInProgress.child = cache$97), - (instance.last = cache$97)); + ? (current.sibling = cache$105) + : (workInProgress.child = cache$105), + (instance.last = cache$105)); } if (null !== instance.tail) return ( @@ -6785,14 +6946,14 @@ function completeWork(current, workInProgress, renderLanes) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -6828,6 +6989,8 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error(formatProdErrorMessage(156, workInProgress.tag)); } @@ -6835,8 +6998,7 @@ function unwindWork(current, workInProgress) { switch (workInProgress.tag) { case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)), + isContextProvider(workInProgress.type) && popContext(), (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) @@ -6916,9 +7078,7 @@ function unwindInterruptedWork(current, interruptedWork) { switch (interruptedWork.tag) { case 1: current = interruptedWork.type.childContextTypes; - null !== current && - void 0 !== current && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)); + null !== current && void 0 !== current && popContext(); break; case 3: popProvider(CacheContext); @@ -7020,8 +7180,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$123) { + captureCommitPhaseError(current, nearestMountedAncestor, error$123); } else ref.current = null; } @@ -7225,11 +7385,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$124) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$124 ); } } @@ -7269,25 +7429,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: - prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevProps) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -7681,15 +7846,21 @@ function commitDeletionEffectsOnFiber( break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -7809,8 +7980,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); + } catch (error$132) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$132); } } break; @@ -7843,8 +8014,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = null !== current ? current.memoizedProps : newProps; try { flags._applyProps(flags, newProps, current); - } catch (error$126) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$126); + } catch (error$135) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$135); } } break; @@ -7880,8 +8051,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$128) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$128); + } catch (error$137) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$137); } flags = finishedWork.updateQueue; null !== flags && @@ -7895,14 +8066,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { safelyDetachRef(current, current.return); suspenseCallback = null !== finishedWork.memoizedState; retryQueue = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + if (disableLegacyMode || finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -7918,7 +8091,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null === current || retryQueue || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -8018,12 +8192,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$127 = JSCompiler_inline_result.stateNode.containerInfo, + before$128 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$128, + parent$127 ); break; default: @@ -8375,7 +8549,15 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -8473,9 +8655,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$138 = finishedWork.stateNode; + var instance$147 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$138._visibility & 4 + ? instance$147._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8483,11 +8665,20 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) - : ((instance$138._visibility |= 4), + : ((instance$147._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$147._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8500,7 +8691,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$138 + instance$147 ); break; case 24: @@ -8594,12 +8785,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$143 = fiber.alternate; - null !== current$143 && null !== current$143.memoizedState - ? ((current$143 = suspenseyCommitFlag), + var current$152 = fiber.alternate; + null !== current$152 && null !== current$152.memoizedState + ? ((current$152 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$143)) + (suspenseyCommitFlag = current$152)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8901,14 +9092,16 @@ var legacyErrorBoundariesThatAlreadyFailed = null, pendingPassiveTransitions = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; -function requestUpdateLane() { - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== ReactSharedInternals.T) { - var actionScopeLane = currentEntangledLane; - return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); - } - return currentUpdatePriority || 32; +function requestUpdateLane(fiber) { + fiber = fiber.mode; + return disableLegacyMode || 0 !== (fiber & 1) + ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : currentUpdatePriority || 32 + : 2; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -8933,20 +9126,21 @@ function scheduleUpdateOnFiber(root, fiber, lane) { ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index$9 = 31 - clz32(lane), - transitions = transitionLanesMap[index$9]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index$9] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$9 = 31 - clz32(lane), + transitions = transitionLanesMap[index$9]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$9] = transitions; + } } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8958,6 +9152,12 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + 0 !== executionContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ((workInProgressRootRenderTargetTime = now() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -9204,7 +9404,7 @@ function performSyncWorkOnRoot(root, lanes) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { + if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -9400,8 +9600,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$149) { - handleThrow(root, thrownValue$149); + } catch (thrownValue$158) { + handleThrow(root, thrownValue$158); } while (1); lanes && root.shellSuspendCounter++; @@ -9510,8 +9710,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$151) { - handleThrow(root, thrownValue$151); + } catch (thrownValue$160) { + handleThrow(root, thrownValue$160); } while (1); resetContextDependencies(); @@ -9764,7 +9964,9 @@ function commitRootImpl( renderPriorityLevel(remainingLanes.value, { componentStack: remainingLanes.stack }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -9924,7 +10126,10 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -10090,10 +10295,12 @@ function createFiberFromTypeAndProps( return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -10263,7 +10470,7 @@ function FiberRootNode( onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -10410,9 +10617,10 @@ var slice = Array.prototype.slice, +_this$props.height, this._tagRef ); + var tag = disableLegacyMode ? 1 : 0; _this$props = new FiberRootNode( this._surface, - 1, + tag, !1, "", void 0, @@ -10422,19 +10630,19 @@ var slice = Array.prototype.slice, ); _this$props.hydrationCallbacks = null; enableTransitionTracing && (_this$props.transitionCallbacks = void 0); - var JSCompiler_inline_result = createFiber(3, null, null, 1); - _this$props.current = JSCompiler_inline_result; - JSCompiler_inline_result.stateNode = _this$props; + tag = createFiber(3, null, null, disableLegacyMode || 1 === tag ? 1 : 0); + _this$props.current = tag; + tag.stateNode = _this$props; var initialCache = createCache(); initialCache.refCount++; _this$props.pooledCache = initialCache; initialCache.refCount++; - JSCompiler_inline_result.memoizedState = { + tag.memoizedState = { element: null, isDehydrated: !1, cache: initialCache }; - initializeUpdateQueue(JSCompiler_inline_result); + initializeUpdateQueue(tag); this._mountNode = _this$props; updateContainerSync(this.props.children, this._mountNode, this); flushSyncWork(); @@ -10496,19 +10704,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1157 = { + devToolsConfig$jscomp$inline_1174 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1399 = { - bundleType: devToolsConfig$jscomp$inline_1157.bundleType, - version: devToolsConfig$jscomp$inline_1157.version, - rendererPackageName: devToolsConfig$jscomp$inline_1157.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1157.rendererConfig, +var internals$jscomp$inline_1386 = { + bundleType: devToolsConfig$jscomp$inline_1174.bundleType, + version: devToolsConfig$jscomp$inline_1174.version, + rendererPackageName: devToolsConfig$jscomp$inline_1174.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1174.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10525,26 +10733,26 @@ var internals$jscomp$inline_1399 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1157.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1174.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1400 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1400.isDisabled && - hook$jscomp$inline_1400.supportsFiber + !hook$jscomp$inline_1387.isDisabled && + hook$jscomp$inline_1387.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1400.inject( - internals$jscomp$inline_1399 + (rendererID = hook$jscomp$inline_1387.inject( + internals$jscomp$inline_1386 )), - (injectedHook = hook$jscomp$inline_1400); + (injectedHook = hook$jscomp$inline_1387); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 872ee43ebb..bb2ca9bd22 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -10162,7 +10162,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-art" }; var internals$jscomp$inline_1372 = { @@ -10193,7 +10193,7 @@ var internals$jscomp$inline_1372 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 95cda925da..9d44c56031 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -295,6 +295,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -745,6 +748,19 @@ __DEV__ && } return null; } + function findCurrentHostFiberWithNoPortalsImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + if ( + 4 !== node.tag && + ((tag = findCurrentHostFiberWithNoPortalsImpl(node)), null !== tag) + ) + return tag; + node = node.sibling; + } + return null; + } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -3787,6 +3803,10 @@ __DEV__ && scheduleImmediateTask(processRootScheduleInMicrotask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); + !disableLegacyMode && + ReactSharedInternals.isBatchingLegacy && + 0 === root.tag && + (ReactSharedInternals.didScheduleLegacyUpdate = !0); } function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -3794,7 +3814,7 @@ __DEV__ && do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( @@ -5449,7 +5469,15 @@ __DEV__ && thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -5732,8 +5760,9 @@ __DEV__ && currentlyRenderingFiber$1 = null; hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + null === current || + (current.flags & 31457280) === (workInProgress.flags & 31457280) || + (!disableLegacyMode && 0 === (current.mode & 1)) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -7275,7 +7304,7 @@ __DEV__ && for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function warnOnInvalidCallback(callback) { + function warnOnInvalidCallback$1(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); didWarnOnInvalidCallback.has(key) || @@ -7357,6 +7386,124 @@ __DEV__ && ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum + ); + } + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + addendum = new ctor(props, context); + } finally { + setIsStrictModeForDevtools(!1); + } + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), + error$jscomp$0( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; + } function callComponentWillReceiveProps( workInProgress, instance, @@ -7383,6 +7530,192 @@ __DEV__ && null )); } + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name + ); + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name + ); + instance.propTypes && + error$jscomp$0( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + name + ); + instance.contextType && + error$jscomp$0( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name + ); + instance.contextTypes && + error$jscomp$0( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name + ); + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name + ); + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" + ); + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name + ); + "function" === typeof instance.componentDidReceiveProps && + error$jscomp$0( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name + ); + "function" === typeof instance.componentWillRecieveProps && + error$jscomp$0( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name + ); + "function" === typeof instance.UNSAFE_componentWillRecieveProps && + error$jscomp$0( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name + ); + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && + error$jscomp$0( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name + ); + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & 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 && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + } function resolveClassComponentProps( Component, baseProps, @@ -7539,6 +7872,36 @@ __DEV__ && )); }); } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(SyncLane)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, SyncLane)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= SyncLane)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } function throwException( root, returnFiber, @@ -7553,81 +7916,115 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - isHydrating && (didSuspendOrErrorDEV = !0); + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 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))); + isHydrating && + (disableLegacyMode || sourceFiber.mode & 1) && + (didSuspendOrErrorDEV = !0); enableDebugTracing && sourceFiber.mode & 4 && - ((sourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(sourceFiber, value)); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ((currentSourceFiber = + getComponentNameFromFiber(sourceFiber) || "Unknown"), + logComponentSuspended(currentSourceFiber, value)); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = RootSuspended); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } throw Error( "Unexpected Suspense handler tag (" + - sourceFiber.tag + + currentSourceFiber.tag + "). This is a bug in React." ); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( (didSuspendOrErrorDEV = !0), - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && queueHydrationError( createCapturedValueAtFiber( @@ -7652,10 +8049,10 @@ __DEV__ && (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -7663,7 +8060,7 @@ __DEV__ && (workInProgressRootExitStatus = RootErrored)), !1 ); - var error = createCapturedValueAtFiber( + 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 } @@ -7671,56 +8068,58 @@ __DEV__ && sourceFiber ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [error]) - : workInProgressRootConcurrentErrors.push(error); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), + (returnFiber.lanes |= root), (root = createRootErrorUpdate( - sourceFiber.stateNode, - value, + returnFiber.stateNode, + sourceFiber, root )), - enqueueCapturedUpdate(sourceFiber, root), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (error = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== error && - "function" === typeof error.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(error))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks( @@ -8053,30 +8452,37 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & OffscreenLane)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = OffscreenLane), - deferHiddenOffscreenComponent( - current, - workInProgress, + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & OffscreenLane)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = + OffscreenLane), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + else + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -8238,7 +8644,7 @@ __DEV__ && return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8277,570 +8683,214 @@ __DEV__ && ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - lane = !1; - state = emptyContextObject; - var context = Component.contextType; - if ( - "contextType" in Component && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) - ) { - didWarnAboutInvalidateContextType.add(Component); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((state = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (lane = Component.contextTypes), - (context = (lane = null !== lane && void 0 !== lane) - ? getMaskedContext(workInProgress, state) - : emptyContextObject)); - addendum = new Component(nextProps, context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - addendum = new Component(nextProps, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - var state$jscomp$0 = (workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null); - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state$jscomp$0 && - ((state$jscomp$0 = - getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state$jscomp$0) || - (didWarnAboutUninitializedState.add(state$jscomp$0), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state$jscomp$0, - null === addendum.state ? "null" : "undefined", - state$jscomp$0 - ))); - if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (state$jscomp$0 = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (state$jscomp$0 = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (state$jscomp$0 = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== state$jscomp$0 || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - addendum = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(addendum) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(addendum), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - addendum, - newApiName, - null !== state$jscomp$0 ? "\n " + state$jscomp$0 : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); - } - } - lane && - ((lane = workInProgress.stateNode), - (lane.__reactInternalMemoizedUnmaskedChildContext = state), - (lane.__reactInternalMemoizedMaskedChildContext = context)); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { state = workInProgress.stateNode; - lane = getComponentNameFromType(Component) || "Component"; - state.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - lane - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - lane - )); - !state.getInitialState || - state.getInitialState.isReactClassApproved || - state.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - lane - ); - state.getDefaultProps && - !state.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - lane - ); - state.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - lane - ); - state.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - lane - ); - state.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - lane - ); - Component.contextType && - Component.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(Component) && - (didWarnAboutContextTypeAndContextTypes.add(Component), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - lane - )); - "function" === typeof state.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - lane - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof state.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof state.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - lane - ); - "function" === typeof state.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - lane - ); - "function" === typeof state.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - lane - ); - "function" === typeof state.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - lane - ); - context = state.props !== nextProps; - void 0 !== state.props && - context && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - lane - ); - state.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - lane, - lane - ); - "function" !== typeof state.getSnapshotBeforeUpdate || - "function" === typeof state.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof state.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof state.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - lane - ); - (context = state.state) && - ("object" !== typeof context || isArrayImpl(context)) && - error$jscomp$0("%s.state: must be set to an object or null", lane); - "function" === typeof state.getChildContext && - "object" !== typeof Component.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - lane - ); - state = workInProgress.stateNode; - state.props = nextProps; - state.state = workInProgress.memoizedState; - state.refs = {}; - initializeUpdateQueue(workInProgress); - lane = Component.contextType; - "object" === typeof lane && null !== lane - ? (state.context = readContext(lane)) - : ((lane = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (state.context = getMaskedContext(workInProgress, lane))); - state.state === nextProps && - ((lane = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(lane) || - (didWarnAboutDirectlyAssigningPropsToState.add(lane), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - lane - ))); - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - state - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - state - ); - state.state = workInProgress.memoizedState; - lane = Component.getDerivedStateFromProps; - "function" === typeof lane && - (applyDerivedStateFromProps( - workInProgress, - Component, - lane, - nextProps - ), - (state.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ((lane = state.state), - "function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount(), - lane !== state.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - state, - state.state, - null - )), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state.state = workInProgress.memoizedState)); - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); - state = !0; - } else if (null === current$jscomp$0) - (state = workInProgress.stateNode), - (foundWillUpdateName = workInProgress.memoizedProps), - (lane = resolveClassComponentProps( - Component, - foundWillUpdateName, - workInProgress.type === workInProgress.elementType - )), - (state.props = lane), - (state$jscomp$0 = state.context), - (context = Component.contextType), - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (context = getMaskedContext(workInProgress, context))), - (foundWillReceivePropsName = Component.getDerivedStateFromProps), - (addendum = - "function" === typeof foundWillReceivePropsName || - "function" === typeof state.getSnapshotBeforeUpdate), - (foundWillUpdateName = - workInProgress.pendingProps !== foundWillUpdateName), - addendum || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((foundWillUpdateName || state$jscomp$0 !== context) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - context - )), - (hasForceUpdate = !1), - (newApiName = workInProgress.memoizedState), - (state.state = newApiName), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state$jscomp$0 = workInProgress.memoizedState), - foundWillUpdateName || - newApiName !== state$jscomp$0 || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof foundWillReceivePropsName && - (applyDerivedStateFromProps( - workInProgress, - Component, - foundWillReceivePropsName, - nextProps - ), - (state$jscomp$0 = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - newApiName, - state$jscomp$0, - context - )) - ? (addendum || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = state$jscomp$0)), - (state.props = nextProps), - (state.state = state$jscomp$0), - (state.context = context), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (state = !1)); - else { - state = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - lane = workInProgress.memoizedProps; - context = resolveClassComponentProps( + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps( Component, - lane, + unresolvedOldProps, workInProgress.type === workInProgress.elementType ); - state.props = context; - addendum = workInProgress.pendingProps; - foundWillUpdateName = state.context; - state$jscomp$0 = Component.contextType; - "object" === typeof state$jscomp$0 && null !== state$jscomp$0 - ? (state$jscomp$0 = readContext(state$jscomp$0)) - : ((state$jscomp$0 = isContextProvider(Component) + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current), - (state$jscomp$0 = getMaskedContext( - workInProgress, - state$jscomp$0 - ))); - newApiName = Component.getDerivedStateFromProps; - (foundWillReceivePropsName = - "function" === typeof newApiName || - "function" === typeof state.getSnapshotBeforeUpdate) || + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || ("function" !== typeof state.UNSAFE_componentWillReceiveProps && "function" !== typeof state.componentWillReceiveProps) || - ((lane !== addendum || foundWillUpdateName !== state$jscomp$0) && + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, state, nextProps, - state$jscomp$0 + contextType )); hasForceUpdate = !1; - foundWillUpdateName = workInProgress.memoizedState; - state.state = foundWillUpdateName; + var oldState = workInProgress.memoizedState; + state.state = oldState; processUpdateQueue(workInProgress, nextProps, state, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== addendum || - foundWillUpdateName !== newState || + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || didPerformWorkStackCursor.current || - hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof newApiName && + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps( workInProgress, Component, - newApiName, + getDerivedStateFromProps, nextProps ), - (newState = workInProgress.memoizedState)), - (context = + (oldContext = workInProgress.memoizedState)), + (lane = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + lane, nextProps, - foundWillUpdateName, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( + Component, + lane, + workInProgress.type === workInProgress.elementType + ); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (enableLazyContextPropagation && + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, newState, - state$jscomp$0 + oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (foundWillReceivePropsName || + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || ("function" !== typeof state.UNSAFE_componentWillUpdate && "function" !== typeof state.componentWillUpdate) || ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate( - nextProps, - newState, - state$jscomp$0 - ), + state.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof state.UNSAFE_componentWillUpdate && state.UNSAFE_componentWillUpdate( nextProps, newState, - state$jscomp$0 + oldContext )), "function" === typeof state.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof state.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), (state.props = nextProps), (state.state = newState), - (state.context = state$jscomp$0), - (state = context)) + (state.context = oldContext), + (state = contextType)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (state = !1)); } - context = state; - markRef(current$jscomp$0, workInProgress); - lane = 0 !== (workInProgress.flags & 128); - if (context || lane) { - context = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (lane && "function" !== typeof Component.getDerivedStateFromError) - (addendum = null), (profilerStartTime = -1); - else { - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - addendum = callRenderInDEV(context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - enableSchedulingProfiler && markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && lane - ? ((lane = addendum), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lane, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - addendum, - renderLanes - ); - workInProgress.memoizedState = context.state; - _instance && invalidateContextProvider(workInProgress, Component, !0); - current$jscomp$0 = workInProgress.child; - } else - _instance && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - )); + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); Component = workInProgress.stateNode; state && Component.props !== nextProps && @@ -8850,7 +8900,76 @@ __DEV__ && getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + enableSchedulingProfiler && markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -8923,32 +9042,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2460; - var JSCompiler_object_inline_stack_2461 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2433; + var JSCompiler_object_inline_stack_2434 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2462 = !1; + var JSCompiler_object_inline_componentStack_2435 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2460 = didSuspend) || - (JSCompiler_object_inline_digest_2460 = + (JSCompiler_object_inline_digest_2433 = didSuspend) || + (JSCompiler_object_inline_digest_2433 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2460 && - ((JSCompiler_object_inline_componentStack_2462 = !0), + JSCompiler_object_inline_digest_2433 && + ((JSCompiler_object_inline_componentStack_2435 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2460 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2433 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2462 + JSCompiler_object_inline_componentStack_2435 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2459 = nextHydratableInstance; + var JSCompiler_object_inline_message_2432 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2459)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2432)) { c: { - var instance = JSCompiler_object_inline_message_2459; + var instance = JSCompiler_object_inline_message_2432; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -8989,19 +9108,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2459 + JSCompiler_object_inline_message_2432 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2459 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2432 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2459 && - ((JSCompiler_object_inline_message_2459 = - JSCompiler_object_inline_message_2459.dehydrated), - null !== JSCompiler_object_inline_message_2459) + null !== JSCompiler_object_inline_message_2432 && + ((JSCompiler_object_inline_message_2432 = + JSCompiler_object_inline_message_2432.dehydrated), + null !== JSCompiler_object_inline_message_2432) ) return ( - JSCompiler_object_inline_message_2459.data === + JSCompiler_object_inline_message_2432.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = DefaultHydrationLane) : (workInProgress.lanes = OffscreenLane), @@ -9009,27 +9128,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2459 = - JSCompiler_object_inline_stack_2461.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2461.fallback; - if (JSCompiler_object_inline_componentStack_2462) + JSCompiler_object_inline_message_2432 = + JSCompiler_object_inline_stack_2434.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2434.fallback; + if (JSCompiler_object_inline_componentStack_2435) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2461 = + (JSCompiler_object_inline_stack_2434 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2459, + JSCompiler_object_inline_message_2432, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2462 = + (JSCompiler_object_inline_componentStack_2435 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2462.memoizedState = + (JSCompiler_object_inline_componentStack_2435.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2462.childLanes = + (JSCompiler_object_inline_componentStack_2435.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2460, + JSCompiler_object_inline_digest_2433, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9038,60 +9157,60 @@ __DEV__ && ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = - JSCompiler_object_inline_componentStack_2462.updateQueue), - null === renderLanes - ? (JSCompiler_object_inline_componentStack_2462.updateQueue = + (current = + JSCompiler_object_inline_componentStack_2435.updateQueue), + null === current + ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2461 + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), + JSCompiler_object_inline_stack_2434 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2461.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2434.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2461 = + (JSCompiler_object_inline_stack_2434 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2459, + JSCompiler_object_inline_message_2432, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2462 = + (JSCompiler_object_inline_componentStack_2435 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2462.memoizedState = + (JSCompiler_object_inline_componentStack_2435.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2462.childLanes = + (JSCompiler_object_inline_componentStack_2435.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2460, + JSCompiler_object_inline_digest_2433, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2461 + JSCompiler_object_inline_stack_2434 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2459 + JSCompiler_object_inline_message_2432 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2459 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2459) + ((JSCompiler_object_inline_message_2432 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2432) ) { if (didSuspend) workInProgress.flags & 256 @@ -9108,93 +9227,95 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2462 = - JSCompiler_object_inline_stack_2461.fallback), - (JSCompiler_object_inline_message_2459 = workInProgress.mode), - (JSCompiler_object_inline_stack_2461 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2461.children - }, - JSCompiler_object_inline_message_2459 - )), - (JSCompiler_object_inline_componentStack_2462 = + (JSCompiler_object_inline_componentStack_2435 = + JSCompiler_object_inline_stack_2434.fallback), + (JSCompiler_object_inline_message_2432 = workInProgress.mode), + (JSCompiler_object_inline_stack_2434 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2434.children + }, + JSCompiler_object_inline_message_2432, + 0, + null + )), + (JSCompiler_object_inline_componentStack_2435 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2462, - JSCompiler_object_inline_message_2459, + JSCompiler_object_inline_componentStack_2435, + JSCompiler_object_inline_message_2432, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2462.flags |= 2), - (JSCompiler_object_inline_stack_2461.return = workInProgress), - (JSCompiler_object_inline_componentStack_2462.return = + (JSCompiler_object_inline_componentStack_2435.flags |= 2), + (JSCompiler_object_inline_stack_2434.return = workInProgress), + (JSCompiler_object_inline_componentStack_2435.return = workInProgress), - (JSCompiler_object_inline_stack_2461.sibling = - JSCompiler_object_inline_componentStack_2462), - (workInProgress.child = JSCompiler_object_inline_stack_2461), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2461 = workInProgress.child), - (JSCompiler_object_inline_stack_2461.memoizedState = + (JSCompiler_object_inline_stack_2434.sibling = + JSCompiler_object_inline_componentStack_2435), + (workInProgress.child = JSCompiler_object_inline_stack_2434), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2434 = workInProgress.child), + (JSCompiler_object_inline_stack_2434.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2461.childLanes = + (JSCompiler_object_inline_stack_2434.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2460, + JSCompiler_object_inline_digest_2433, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_componentStack_2462)); + (workInProgress = JSCompiler_object_inline_componentStack_2435)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2459.data === + JSCompiler_object_inline_message_2432.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2460 = - JSCompiler_object_inline_message_2459.nextSibling && - JSCompiler_object_inline_message_2459.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2460) { - JSCompiler_temp = JSCompiler_object_inline_digest_2460.dgst; - var message = JSCompiler_object_inline_digest_2460.msg; - instance = JSCompiler_object_inline_digest_2460.stck; - var componentStack = JSCompiler_object_inline_digest_2460.cstck; + JSCompiler_object_inline_digest_2433 = + JSCompiler_object_inline_message_2432.nextSibling && + JSCompiler_object_inline_message_2432.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2433) { + JSCompiler_temp = JSCompiler_object_inline_digest_2433.dgst; + var message = JSCompiler_object_inline_digest_2433.msg; + instance = JSCompiler_object_inline_digest_2433.stck; + var componentStack = JSCompiler_object_inline_digest_2433.cstck; } - JSCompiler_object_inline_message_2459 = message; - JSCompiler_object_inline_digest_2460 = JSCompiler_temp; - JSCompiler_object_inline_stack_2461 = instance; - JSCompiler_object_inline_componentStack_2462 = componentStack; - JSCompiler_object_inline_message_2459 = - JSCompiler_object_inline_message_2459 - ? Error(JSCompiler_object_inline_message_2459) + JSCompiler_object_inline_message_2432 = message; + JSCompiler_object_inline_digest_2433 = JSCompiler_temp; + JSCompiler_object_inline_stack_2434 = instance; + JSCompiler_object_inline_componentStack_2435 = componentStack; + JSCompiler_object_inline_message_2432 = + JSCompiler_object_inline_message_2432 + ? Error(JSCompiler_object_inline_message_2432) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2459.stack = - JSCompiler_object_inline_stack_2461 || ""; - JSCompiler_object_inline_message_2459.digest = - JSCompiler_object_inline_digest_2460; - JSCompiler_object_inline_digest_2460 = - void 0 === JSCompiler_object_inline_componentStack_2462 + JSCompiler_object_inline_message_2432.stack = + JSCompiler_object_inline_stack_2434 || ""; + JSCompiler_object_inline_message_2432.digest = + JSCompiler_object_inline_digest_2433; + JSCompiler_object_inline_digest_2433 = + void 0 === JSCompiler_object_inline_componentStack_2435 ? null - : JSCompiler_object_inline_componentStack_2462; - "string" === typeof JSCompiler_object_inline_digest_2460 && + : JSCompiler_object_inline_componentStack_2435; + "string" === typeof JSCompiler_object_inline_digest_2433 && CapturedStacks.set( - JSCompiler_object_inline_message_2459, - JSCompiler_object_inline_digest_2460 + JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_digest_2433 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2459, + value: JSCompiler_object_inline_message_2432, source: null, - stack: JSCompiler_object_inline_digest_2460 + stack: JSCompiler_object_inline_digest_2433 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9210,29 +9331,29 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2460 = + (JSCompiler_object_inline_digest_2433 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2460) + didReceiveUpdate || JSCompiler_object_inline_digest_2433) ) { - JSCompiler_object_inline_digest_2460 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2460) { - JSCompiler_object_inline_stack_2461 = renderLanes & -renderLanes; + JSCompiler_object_inline_digest_2433 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2433) { + JSCompiler_object_inline_stack_2434 = renderLanes & -renderLanes; if ( enableUnifiedSyncLane && - 0 !== (JSCompiler_object_inline_stack_2461 & SyncUpdateLanes) + 0 !== (JSCompiler_object_inline_stack_2434 & SyncUpdateLanes) ) - JSCompiler_object_inline_stack_2461 = SyncHydrationLane; + JSCompiler_object_inline_stack_2434 = SyncHydrationLane; else - switch (JSCompiler_object_inline_stack_2461) { + switch (JSCompiler_object_inline_stack_2434) { case SyncLane: - JSCompiler_object_inline_stack_2461 = SyncHydrationLane; + JSCompiler_object_inline_stack_2434 = SyncHydrationLane; break; case InputContinuousLane: - JSCompiler_object_inline_stack_2461 = + JSCompiler_object_inline_stack_2434 = InputContinuousHydrationLane; break; case DefaultLane: - JSCompiler_object_inline_stack_2461 = DefaultHydrationLane; + JSCompiler_object_inline_stack_2434 = DefaultHydrationLane; break; case 128: case 256: @@ -9253,40 +9374,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2461 = TransitionHydrationLane; + JSCompiler_object_inline_stack_2434 = TransitionHydrationLane; break; case IdleLane: - JSCompiler_object_inline_stack_2461 = IdleHydrationLane; + JSCompiler_object_inline_stack_2434 = IdleHydrationLane; break; default: - JSCompiler_object_inline_stack_2461 = 0; + JSCompiler_object_inline_stack_2434 = 0; } - JSCompiler_object_inline_stack_2461 = + JSCompiler_object_inline_stack_2434 = 0 !== - (JSCompiler_object_inline_stack_2461 & - (JSCompiler_object_inline_digest_2460.suspendedLanes | + (JSCompiler_object_inline_stack_2434 & + (JSCompiler_object_inline_digest_2433.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2461; + : JSCompiler_object_inline_stack_2434; if ( - 0 !== JSCompiler_object_inline_stack_2461 && - JSCompiler_object_inline_stack_2461 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2434 && + JSCompiler_object_inline_stack_2434 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2461), + ((prevState.retryLane = JSCompiler_object_inline_stack_2434), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2461 + JSCompiler_object_inline_stack_2434 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2460, + JSCompiler_object_inline_digest_2433, current, - JSCompiler_object_inline_stack_2461 + JSCompiler_object_inline_stack_2434 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2459.data === + JSCompiler_object_inline_message_2432.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9294,7 +9415,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2459.data === + JSCompiler_object_inline_message_2432.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9302,12 +9423,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2459._reactRetry = + (JSCompiler_object_inline_message_2432._reactRetry = workInProgress), (workInProgress = null)) - : ((current = prevState.treeContext), + : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2459.nextSibling + JSCompiler_object_inline_message_2432.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9315,67 +9436,83 @@ __DEV__ && (didSuspendOrErrorDEV = !1), (hydrationDiffRootDEV = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && (warnIfNotHydrating(), (idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2461.children + JSCompiler_object_inline_stack_2434.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2462) + if (JSCompiler_object_inline_componentStack_2435) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2462 = - JSCompiler_object_inline_stack_2461.fallback), - (JSCompiler_object_inline_message_2459 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2435 = + JSCompiler_object_inline_stack_2434.fallback), + (JSCompiler_object_inline_message_2432 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2461 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2461.children - } - )), - (JSCompiler_object_inline_stack_2461.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (componentStack = { + mode: "hidden", + children: JSCompiler_object_inline_stack_2434.children + }), + disableLegacyMode || + 0 !== (JSCompiler_object_inline_message_2432 & 1) || + workInProgress.child === JSCompiler_temp + ? ((JSCompiler_object_inline_stack_2434 = createWorkInProgress( + JSCompiler_temp, + componentStack + )), + (JSCompiler_object_inline_stack_2434.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280)) + : ((JSCompiler_object_inline_stack_2434 = workInProgress.child), + (JSCompiler_object_inline_stack_2434.childLanes = 0), + (JSCompiler_object_inline_stack_2434.pendingProps = + componentStack), + workInProgress.mode & 2 && + ((JSCompiler_object_inline_stack_2434.actualDuration = 0), + (JSCompiler_object_inline_stack_2434.actualStartTime = -1), + (JSCompiler_object_inline_stack_2434.selfBaseDuration = + JSCompiler_temp.selfBaseDuration), + (JSCompiler_object_inline_stack_2434.treeBaseDuration = + JSCompiler_temp.treeBaseDuration)), + (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2462 = + ? (JSCompiler_object_inline_componentStack_2435 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2462 + JSCompiler_object_inline_componentStack_2435 )) - : ((JSCompiler_object_inline_componentStack_2462 = + : ((JSCompiler_object_inline_componentStack_2435 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2462, - JSCompiler_object_inline_message_2459, + JSCompiler_object_inline_componentStack_2435, + JSCompiler_object_inline_message_2432, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2462.flags |= 2)), - (JSCompiler_object_inline_componentStack_2462.return = + (JSCompiler_object_inline_componentStack_2435.flags |= 2)), + (JSCompiler_object_inline_componentStack_2435.return = workInProgress), - (JSCompiler_object_inline_stack_2461.return = workInProgress), - (JSCompiler_object_inline_stack_2461.sibling = - JSCompiler_object_inline_componentStack_2462), - (workInProgress.child = JSCompiler_object_inline_stack_2461), - (JSCompiler_object_inline_stack_2461 = - JSCompiler_object_inline_componentStack_2462), - (JSCompiler_object_inline_componentStack_2462 = workInProgress.child), - (JSCompiler_object_inline_message_2459 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2459 - ? (JSCompiler_object_inline_message_2459 = + (JSCompiler_object_inline_stack_2434.return = workInProgress), + (JSCompiler_object_inline_stack_2434.sibling = + JSCompiler_object_inline_componentStack_2435), + (workInProgress.child = JSCompiler_object_inline_stack_2434), + (JSCompiler_object_inline_stack_2434 = + JSCompiler_object_inline_componentStack_2435), + (JSCompiler_object_inline_componentStack_2435 = workInProgress.child), + (JSCompiler_object_inline_message_2432 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2432 + ? (JSCompiler_object_inline_message_2432 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2459.cachePool), + JSCompiler_object_inline_message_2432.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9383,72 +9520,80 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2459 = { + (JSCompiler_object_inline_message_2432 = { baseLanes: - JSCompiler_object_inline_message_2459.baseLanes | renderLanes, + JSCompiler_object_inline_message_2432.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2462.memoizedState = - JSCompiler_object_inline_message_2459), + (JSCompiler_object_inline_componentStack_2435.memoizedState = + JSCompiler_object_inline_message_2432), enableTransitionTracing && - ((JSCompiler_object_inline_message_2459 = enableTransitionTracing + ((JSCompiler_object_inline_message_2432 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2459 && + null !== JSCompiler_object_inline_message_2432 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2462.updateQueue), + JSCompiler_object_inline_componentStack_2435.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2462.updateQueue = { - transitions: JSCompiler_object_inline_message_2459, + ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { + transitions: JSCompiler_object_inline_message_2432, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2462.updateQueue = { - transitions: JSCompiler_object_inline_message_2459, + ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { + transitions: JSCompiler_object_inline_message_2432, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack ? componentStack.retryQueue : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2459), + JSCompiler_object_inline_message_2432), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2462.childLanes = + (JSCompiler_object_inline_componentStack_2435.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2460, + JSCompiler_object_inline_digest_2433, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2461 + JSCompiler_object_inline_stack_2434 ); pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2461.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + JSCompiler_object_inline_digest_2433 = current.child; + current = JSCompiler_object_inline_digest_2433.sibling; + JSCompiler_object_inline_digest_2433 = createWorkInProgress( + JSCompiler_object_inline_digest_2433, + { + mode: "visible", + children: JSCompiler_object_inline_stack_2434.children + } + ); + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_object_inline_digest_2433.lanes = renderLanes); + JSCompiler_object_inline_digest_2433.return = workInProgress; + JSCompiler_object_inline_digest_2433.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2460 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2460 + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2460.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_object_inline_digest_2433; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_object_inline_digest_2433; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -9459,26 +9604,37 @@ __DEV__ && fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || + 0 !== (mode & 1) || + null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = 0), + (progressedPrimaryFragment.actualStartTime = -1), + (progressedPrimaryFragment.selfBaseDuration = 0), + (progressedPrimaryFragment.treeBaseDuration = 0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); - } function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9657,59 +9813,69 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + null === current || + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } function bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -9883,7 +10049,7 @@ __DEV__ && } function beginWork(current, workInProgress, renderLanes) { if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( + var copiedFiber = createFiberFromTypeAndProps( workInProgress.type, workInProgress.key, workInProgress.pendingProps, @@ -9895,13 +10061,13 @@ __DEV__ && 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; + copiedFiber.index = workInProgress.index; + copiedFiber.sibling = workInProgress.sibling; + copiedFiber.return = workInProgress.return; + copiedFiber.ref = workInProgress.ref; + copiedFiber._debugInfo = workInProgress._debugInfo; if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; + returnFiber.child = copiedFiber; else { var prevSibling = returnFiber.child; if (null === prevSibling) @@ -9909,14 +10075,14 @@ __DEV__ && for (; prevSibling.sibling !== workInProgress; ) if (((prevSibling = prevSibling.sibling), null === prevSibling)) throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; + prevSibling.sibling = copiedFiber; } - workInProgress = returnFiber.deletions; - null === workInProgress + var deletions = returnFiber.deletions; + null === deletions ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + : deletions.push(current); + copiedFiber.flags |= 2; + return copiedFiber; } if (null !== current) if ( @@ -9942,150 +10108,142 @@ __DEV__ && } else { didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) + var JSCompiler_temp; + if ((JSCompiler_temp = isHydrating)) warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + (JSCompiler_temp = 0 !== (workInProgress.flags & 1048576)); + if (JSCompiler_temp) { + var slotIndex = workInProgress.index; + warnIfNotHydrating(); + pushTreeId(workInProgress, treeForkCount, slotIndex); + } } workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber, + a: { + var elementType = workInProgress.elementType; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + var props = workInProgress.pendingProps; + var Component = callLazyInitInDEV(elementType); + workInProgress.type = Component; + if ("function" === typeof Component) + if (shouldConstruct(Component)) { + var resolvedProps = resolveClassComponentProps( + Component, + props, !1 - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( + ); + workInProgress.tag = 1; + workInProgress.type = Component = + resolveFunctionForHotReloading(Component); + var JSCompiler_inline_result = updateClassComponent( null, workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - )), - (workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - ); - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, + Component, + resolvedProps, renderLanes ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - ); - workInProgress.tag = 14; - workInProgress = updateMemoComponent( + } else { + var _resolvedProps = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 0; + validateFunctionComponentInDev(workInProgress, Component); + workInProgress.type = Component = + resolveFunctionForHotReloading(Component); + JSCompiler_inline_result = updateFunctionComponent( null, workInProgress, - current, - disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current.type, - returnFiber - ), + Component, + _resolvedProps, 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?"); - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); + else { + if (void 0 !== Component && null !== Component) { + var $$typeof = Component.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) { + var _resolvedProps2 = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 11; + workInProgress.type = Component = + resolveForwardRefForHotReloading(Component); + JSCompiler_inline_result = updateForwardRef( + null, + workInProgress, + Component, + _resolvedProps2, + renderLanes + ); + break a; + } else if ($$typeof === REACT_MEMO_TYPE) { + var _resolvedProps3 = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 14; + JSCompiler_inline_result = updateMemoComponent( + null, + workInProgress, + Component, + disableDefaultPropsExceptForClasses + ? _resolvedProps3 + : resolveDefaultPropsOnNonClassComponent( + Component.type, + _resolvedProps3 + ), + renderLanes + ); + break a; + } + } + var hint = ""; + null !== Component && + "object" === typeof Component && + Component.$$typeof === REACT_LAZY_TYPE && + (hint = + " Did you wrap a component in React.lazy() more than once?"); + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + + hint + ); + } } - return workInProgress; + return JSCompiler_inline_result; case 0: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = + var Component$jscomp$0 = workInProgress.type, + unresolvedProps = workInProgress.pendingProps, + resolvedProps$jscomp$0 = disableDefaultPropsExceptForClasses || - workInProgress.elementType === returnFiber - ? prevSibling + workInProgress.elementType === Component$jscomp$0 + ? unresolvedProps : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - updateFunctionComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + Component$jscomp$0, + unresolvedProps + ); + return updateFunctionComponent( + current, + workInProgress, + Component$jscomp$0, + resolvedProps$jscomp$0, + renderLanes ); case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, + var _Component = workInProgress.type, + _resolvedProps4 = resolveClassComponentProps( + _Component, workInProgress.pendingProps, - workInProgress.elementType === returnFiber - )), - updateClassComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + workInProgress.elementType === _Component + ); + return updateClassComponent( + current, + workInProgress, + _Component, + _resolvedProps4, + renderLanes ); case 3: a: { @@ -10094,330 +10252,325 @@ __DEV__ && throw Error( "Should have a current fiber. This is a bug in React." ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; + var nextProps = workInProgress.pendingProps, + prevState = workInProgress.memoizedState, + prevChildren = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions, workInProgress); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && + var nextCache = nextState.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== prevState.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); + var nextChildren = nextState.element; + if (prevState.isDehydrated) { + var overrideState = { + element: nextChildren, + isDehydrated: !1, + cache: nextState.cache + }; + workInProgress.updateQueue.baseState = overrideState; + workInProgress.memoizedState = overrideState; + if (workInProgress.flags & 256) { + var JSCompiler_inline_result$jscomp$0 = + mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ); break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( + } else if (nextChildren !== prevChildren) { + var recoverableError = createCapturedValueAtFiber( Error( "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." ), workInProgress ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); + queueHydrationError(recoverableError); + JSCompiler_inline_result$jscomp$0 = + mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ); break a; - } else + } else { + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ); + hydrationParentFiber = workInProgress; + isHydrating = !0; + hydrationErrors = null; + didSuspendOrErrorDEV = !1; + hydrationDiffRootDEV = null; + rootOrSingletonContext = !0; for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( + var child = mountChildFibers( workInProgress, null, - nextProps, + nextChildren, renderLanes ), - workInProgress.child = renderLanes; - renderLanes; + node = (workInProgress.child = child); + node; ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { + (node.flags = (node.flags & -3) | 4096), + (node = node.sibling); + } + } else { resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + if (nextChildren === prevChildren) { + JSCompiler_inline_result$jscomp$0 = + bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } reconcileChildren( current, workInProgress, - nextProps, + nextChildren, renderLanes ); } - workInProgress = workInProgress.child; + JSCompiler_inline_result$jscomp$0 = workInProgress.child; } - return workInProgress; + return JSCompiler_inline_result$jscomp$0; case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(renderLanes)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = current), - setInitialProperties(returnFiber, renderLanes, current), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); + markRef(current, workInProgress); + if (null === current) { + var resource = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + ); + if (resource) workInProgress.memoizedState = resource; + else if (!isHydrating) { + var type = workInProgress.type, + props$jscomp$0 = workInProgress.pendingProps, + rootContainerInstance = requiredContext( + rootInstanceStackCursor.current + ), + domElement = getOwnerDocumentFromRootContainer( + rootContainerInstance + ).createElement(type); + domElement[internalInstanceKey] = workInProgress; + domElement[internalPropsKey] = props$jscomp$0; + setInitialProperties(domElement, type, props$jscomp$0); + markNodeAsHoistable(domElement); + workInProgress.stateNode = domElement; + } + } else + workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + ); + return null; case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( + pushHostContext(workInProgress); + if (null === current && isHydrating) { + var currentRootContainer = requiredContext( + rootInstanceStackCursor.current + ), + currentHostContext = getHostContext(), + instance = (workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( + workInProgress.pendingProps, + currentRootContainer, + currentHostContext, + !1 + )); + if (!didSuspendOrErrorDEV) { + var differences = diffHydratedProperties( + instance, + workInProgress.type, + workInProgress.pendingProps, + currentHostContext + ); + null !== differences && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + differences); + } + hydrationParentFiber = workInProgress; + rootOrSingletonContext = !0; + nextHydratableInstance = getNextHydratable(instance.firstChild); + } + var nextChildren$jscomp$0 = workInProgress.pendingProps.children; + null !== current || isHydrating + ? reconcileChildren( current, workInProgress, - TransitionAwareHostComponent, - null, - null, + nextChildren$jscomp$0, renderLanes - )), - (HostTransitionContext._currentValue = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), - markRef(current, workInProgress), - reconcileChildren( + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren$jscomp$0, + renderLanes + )); + markRef(current, workInProgress); + return workInProgress.child; + case 5: + if (null === current && isHydrating) { + var currentHostContext$jscomp$0 = getHostContext(), + shouldKeepWarning = validateDOMNesting( + workInProgress.type, + currentHostContext$jscomp$0.ancestorInfo + ), + nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if (!(JSCompiler_temp$jscomp$0 = !nextInstance)) { + var instance$jscomp$0 = canHydrateInstance( + nextInstance, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + ); + if (null !== instance$jscomp$0) { + workInProgress.stateNode = instance$jscomp$0; + if (!didSuspendOrErrorDEV) { + var differences$jscomp$0 = diffHydratedProperties( + instance$jscomp$0, + workInProgress.type, + workInProgress.pendingProps, + currentHostContext$jscomp$0 + ); + null !== differences$jscomp$0 && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + differences$jscomp$0); + } + hydrationParentFiber = workInProgress; + nextHydratableInstance = getNextHydratable( + instance$jscomp$0.firstChild + ); + rootOrSingletonContext = !1; + var JSCompiler_inline_result$jscomp$1 = !0; + } else JSCompiler_inline_result$jscomp$1 = !1; + JSCompiler_temp$jscomp$0 = !JSCompiler_inline_result$jscomp$1; + } + JSCompiler_temp$jscomp$0 && + (shouldKeepWarning && + warnNonHydratedInstance(workInProgress, nextInstance), + throwOnHydrationMismatch(workInProgress)); + } + pushHostContext(workInProgress); + var type$jscomp$0 = workInProgress.type, + nextProps$jscomp$0 = workInProgress.pendingProps, + prevProps = null !== current ? current.memoizedProps : null, + nextChildren$jscomp$1 = nextProps$jscomp$0.children; + shouldSetTextContent(type$jscomp$0, nextProps$jscomp$0) + ? (nextChildren$jscomp$1 = null) + : null !== prevProps && + shouldSetTextContent(type$jscomp$0, prevProps) && + (workInProgress.flags |= 32); + if (null !== workInProgress.memoizedState) { + var newState = renderWithHooks( current, workInProgress, - returnFiber, + TransitionAwareHostComponent, + null, + null, renderLanes - ), - workInProgress.child + ); + HostTransitionContext._currentValue = newState; + enableLazyContextPropagation || + (didReceiveUpdate && + null !== current && + current.memoizedState.memoizedState !== newState && + propagateContextChange( + workInProgress, + HostTransitionContext, + renderLanes + )); + } + markRef(current, workInProgress); + reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$1, + renderLanes ); + return workInProgress.child; case 6: - return ( - null === current && - isHydrating && - ((renderLanes = workInProgress.pendingProps), - (current = getHostContext().ancestorInfo.current), - (renderLanes = - null != current - ? validateTextNesting(renderLanes, current.tag) - : !0), - (current = nextHydratableInstance), - (returnFiber = !current) || - ((returnFiber = canHydrateTextInstance( - current, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (renderLanes && - warnNonHydratedInstance(workInProgress, current), - throwOnHydrationMismatch(workInProgress))), - null - ); + if (null === current && isHydrating) { + var text = workInProgress.pendingProps, + ancestor = getHostContext().ancestorInfo.current; + var shouldKeepWarning$jscomp$0 = + null != ancestor ? validateTextNesting(text, ancestor.tag) : !0; + var nextInstance$jscomp$0 = nextHydratableInstance, + JSCompiler_temp$jscomp$1; + if (!(JSCompiler_temp$jscomp$1 = !nextInstance$jscomp$0)) { + var textInstance = canHydrateTextInstance( + nextInstance$jscomp$0, + workInProgress.pendingProps, + rootOrSingletonContext + ); + if (null !== textInstance) { + workInProgress.stateNode = textInstance; + hydrationParentFiber = workInProgress; + nextHydratableInstance = null; + var JSCompiler_inline_result$jscomp$2 = !0; + } else JSCompiler_inline_result$jscomp$2 = !1; + JSCompiler_temp$jscomp$1 = !JSCompiler_inline_result$jscomp$2; + } + JSCompiler_temp$jscomp$1 && + (shouldKeepWarning$jscomp$0 && + warnNonHydratedInstance(workInProgress, nextInstance$jscomp$0), + throwOnHydrationMismatch(workInProgress)); + } + 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 + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo ); + var nextChildren$jscomp$2 = workInProgress.pendingProps; + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren$jscomp$2, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$2, + renderLanes + ); + return workInProgress.child; case 11: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = + var type$jscomp$1 = workInProgress.type, + _unresolvedProps2 = workInProgress.pendingProps, + _resolvedProps5 = disableDefaultPropsExceptForClasses || - workInProgress.elementType === returnFiber - ? prevSibling + workInProgress.elementType === type$jscomp$1 + ? _unresolvedProps2 : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - updateForwardRef( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + type$jscomp$1, + _unresolvedProps2 + ); + return updateForwardRef( + current, + workInProgress, + type$jscomp$1, + _resolvedProps5, + renderLanes ); case 7: return ( @@ -10440,116 +10593,103 @@ __DEV__ && workInProgress.child ); case 12: - return ( - (workInProgress.flags |= 4), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = 0), - (returnFiber.passiveEffectDuration = 0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + workInProgress.flags |= 4; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ); + return workInProgress.child; case 10: a: { - returnFiber = enableRenderableContext + var context = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextState = prevSibling.value; - "value" in prevSibling || + var newProps = workInProgress.pendingProps, + oldProps = workInProgress.memoizedProps, + newValue = newProps.value; + "value" in newProps || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" )); - pushProvider(workInProgress, returnFiber, nextState); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextState)) { + pushProvider(workInProgress, context, newValue); + if (!enableLazyContextPropagation && null !== oldProps) + if (objectIs(oldProps.value, newValue)) { if ( - nextProps.children === prevSibling.children && + oldProps.children === newProps.children && !didPerformWorkStackCursor.current ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + var JSCompiler_inline_result$jscomp$3 = + bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + propagateContextChange(workInProgress, context, renderLanes); reconcileChildren( current, workInProgress, - prevSibling.children, + newProps.children, renderLanes ); - workInProgress = workInProgress.child; + JSCompiler_inline_result$jscomp$3 = workInProgress.child; } - return workInProgress; + return JSCompiler_inline_result$jscomp$3; case 9: - return ( - enableRenderableContext - ? (prevSibling = workInProgress.type._context) - : ((prevSibling = workInProgress.type), - void 0 !== prevSibling._context && - (prevSibling = prevSibling._context)), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress, renderLanes), - (prevSibling = readContext(prevSibling)), - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - enableSchedulingProfiler && markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + if (enableRenderableContext) + var context$jscomp$0 = workInProgress.type._context; + else + (context$jscomp$0 = workInProgress.type), + void 0 !== context$jscomp$0._context && + (context$jscomp$0 = context$jscomp$0._context); + var render = workInProgress.pendingProps.children; + "function" !== typeof render && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ); + prepareToReadContext(workInProgress, renderLanes); + var newValue$jscomp$0 = readContext(context$jscomp$0); + enableSchedulingProfiler && + markComponentRenderStarted(workInProgress); + var newChildren = callComponentInDEV( + render, + newValue$jscomp$0, + void 0 ); + enableSchedulingProfiler && markComponentRenderStopped(); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; case 14: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = disableDefaultPropsExceptForClasses - ? prevSibling + var _type = workInProgress.type, + _unresolvedProps3 = workInProgress.pendingProps, + _resolvedProps6 = disableDefaultPropsExceptForClasses + ? _unresolvedProps3 : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - (prevSibling = disableDefaultPropsExceptForClasses - ? prevSibling - : resolveDefaultPropsOnNonClassComponent( - returnFiber.type, - prevSibling - )), - updateMemoComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + _type, + _unresolvedProps3 + ); + _resolvedProps6 = disableDefaultPropsExceptForClasses + ? _resolvedProps6 + : resolveDefaultPropsOnNonClassComponent( + _type.type, + _resolvedProps6 + ); + return updateMemoComponent( + current, + workInProgress, + _type, + _resolvedProps6, + renderLanes ); case 15: return updateSimpleMemoComponent( @@ -10559,6 +10699,53 @@ __DEV__ && workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + var _Component2 = workInProgress.type, + _resolvedProps7 = resolveClassComponentProps( + _Component2, + workInProgress.pendingProps, + workInProgress.elementType === _Component2 + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + if (isContextProvider(_Component2)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, _Component2, _resolvedProps7); + mountClassInstance( + workInProgress, + _Component2, + _resolvedProps7, + renderLanes + ); + return finishClassComponent( + null, + workInProgress, + _Component2, + !0, + hasContext, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + var _Component3 = workInProgress.type, + _resolvedProps8 = resolveClassComponentProps( + _Component3, + workInProgress.pendingProps, + workInProgress.elementType === _Component3 + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + _Component3, + _resolvedProps8, + renderLanes + ); case 19: return updateSuspenseListComponent( current, @@ -10566,17 +10753,15 @@ __DEV__ && renderLanes ); case 21: - return ( - (returnFiber = workInProgress.pendingProps.children), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + var nextChildren$jscomp$3 = workInProgress.pendingProps.children; + markRef(current, workInProgress); + reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$3, + renderLanes ); + return workInProgress.child; case 22: return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: @@ -10586,94 +10771,96 @@ __DEV__ && renderLanes ); case 24: - return ( - prepareToReadContext(workInProgress, renderLanes), - (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 && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + prepareToReadContext(workInProgress, renderLanes); + var parentCache = readContext(CacheContext); + if (null === current) { + var cacheFromPool = peekCacheFromPool(); + if (null !== cacheFromPool) var freshCache = cacheFromPool; + else { + var root = workInProgressRoot, + freshCache$jscomp$0 = createCache(); + root.pooledCache = freshCache$jscomp$0; + retainCache(freshCache$jscomp$0); + null !== freshCache$jscomp$0 && + (root.pooledCacheLanes |= renderLanes); + freshCache = freshCache$jscomp$0; + } + workInProgress.memoizedState = { + parent: parentCache, + cache: freshCache + }; + initializeUpdateQueue(workInProgress); + pushProvider(workInProgress, CacheContext, freshCache); + } else { + 0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()); + var prevState$jscomp$0 = current.memoizedState, + nextState$jscomp$0 = workInProgress.memoizedState; + if (prevState$jscomp$0.parent !== parentCache) { + var derivedState = { parent: parentCache, cache: parentCache }; + workInProgress.memoizedState = derivedState; + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + derivedState); + pushProvider(workInProgress, CacheContext, parentCache); + } else { + var nextCache$jscomp$0 = nextState$jscomp$0.cache; + pushProvider(workInProgress, CacheContext, nextCache$jscomp$0); + nextCache$jscomp$0 !== prevState$jscomp$0.cache && + propagateContextChange( + workInProgress, + CacheContext, + renderLanes + ); + } + } + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ); + return workInProgress.child; case 25: - if (enableTransitionTracing) - return ( - enableTransitionTracing - ? (null === current - ? ((returnFiber = enableTransitionTracing - ? transitionStack.current - : null), - null !== returnFiber && - ((returnFiber = { - tag: TransitionTracingMarker, - transitions: new Set(returnFiber), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }), - (workInProgress.stateNode = returnFiber), - (workInProgress.flags |= 2048))) - : current.memoizedProps.name !== - workInProgress.pendingProps.name && - error$jscomp$0( - "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." - ), - (returnFiber = workInProgress.stateNode), - null !== returnFiber && - pushMarkerInstance(workInProgress, returnFiber), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - (workInProgress = workInProgress.child)) - : (workInProgress = null), - workInProgress - ); + if (enableTransitionTracing) { + if (enableTransitionTracing) { + if (null === current) { + var currentTransitions = enableTransitionTracing + ? transitionStack.current + : null; + if (null !== currentTransitions) { + var markerInstance = { + tag: TransitionTracingMarker, + transitions: new Set(currentTransitions), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }; + workInProgress.stateNode = markerInstance; + workInProgress.flags |= 2048; + } + } else + current.memoizedProps.name !== + workInProgress.pendingProps.name && + error$jscomp$0( + "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." + ); + var instance$jscomp$1 = workInProgress.stateNode; + null !== instance$jscomp$1 && + pushMarkerInstance(workInProgress, instance$jscomp$1); + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ); + var JSCompiler_inline_result$jscomp$4 = workInProgress.child; + } else JSCompiler_inline_result$jscomp$4 = null; + return JSCompiler_inline_result$jscomp$4; + } break; case 29: throw workInProgress.pendingProps; @@ -11281,6 +11468,8 @@ __DEV__ && var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -11711,6 +11900,11 @@ __DEV__ && bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(workInProgress); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor, workInProgress); _type = workInProgress.memoizedState; @@ -11833,14 +12027,14 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & OffscreenLane) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & OffscreenLane) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (newProps = workInProgress.updateQueue), null !== newProps && scheduleRetryEffect(workInProgress, newProps.retryQueue), @@ -11876,6 +12070,8 @@ __DEV__ && bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error( "Unknown unit of work tag (" + @@ -12036,20 +12232,30 @@ __DEV__ && (executionContext & CommitContext) !== NoContext ); } - function callComponentWillUnmountWithTimer(current, instance) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + try { + if ( + ((instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + )), + (instance.state = current.memoizedState), + shouldProfile(current)) + ) + try { + startLayoutEffectTimer(), instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + else instance.componentWillUnmount(); + } catch (error$7) { + captureCommitPhaseError(current, nearestMountedAncestor, error$7); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -12152,7 +12358,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$45) { + } catch (e$50) { JSCompiler_temp = null; break a; } @@ -12336,23 +12542,8 @@ __DEV__ && (current.__reactInternalSnapshotBeforeUpdate = flags)); break; case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - current === DOCUMENT_NODE) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } + 0 !== (flags & 1024) && + clearContainer(finishedWork.stateNode.containerInfo); break; case 5: case 26: @@ -12802,30 +12993,40 @@ __DEV__ && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevState = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevState) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevState; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else + recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -13288,21 +13489,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -13319,15 +13514,21 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -13921,13 +14122,15 @@ __DEV__ && safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + disableLegacyMode || finishedWork.mode & 1 + ? ((suspenseCallback = offscreenSubtreeIsHidden), + (retryQueue = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = suspenseCallback || domElement), + (offscreenSubtreeWasHidden = retryQueue || newProps), + recursivelyTraverseMutationEffects(root, finishedWork, lanes), + (offscreenSubtreeWasHidden = retryQueue), + (offscreenSubtreeIsHidden = suspenseCallback)) + : recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -13943,7 +14146,8 @@ __DEV__ && null === current || newProps || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -14164,18 +14368,12 @@ __DEV__ && case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -14554,12 +14752,20 @@ __DEV__ && committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -14682,12 +14888,21 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -15087,11 +15302,88 @@ __DEV__ && ))); } } + function invokeLayoutEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Layout | HasEffect, fiber); + } catch (error$40) { + captureCommitPhaseError(fiber, fiber.return, error$40); + } + break; + case 1: + var instance = fiber.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error$41) { + captureCommitPhaseError(fiber, fiber.return, error$41); + } + } + } + function invokePassiveEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Passive | HasEffect, fiber); + } catch (error$42) { + captureCommitPhaseError(fiber, fiber.return, error$42); + } + } + } + function invokeLayoutEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Layout | HasEffect, + fiber, + fiber.return + ); + } catch (error$43) { + captureCommitPhaseError(fiber, fiber.return, error$43); + } + break; + case 1: + var instance = fiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount(fiber, fiber.return, instance); + } + } + function invokePassiveEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Passive | HasEffect, + fiber, + fiber.return + ); + } catch (error$44) { + captureCommitPhaseError(fiber, fiber.return, error$44); + } + } + } function onCommitRoot() { commitHooks.forEach(function (commitHook) { return commitHook(); }); } + function isLegacyActEnvironment() { + var isReactActEnvironmentGlobal = + "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT + ? IS_REACT_ACT_ENVIRONMENT + : void 0; + return "undefined" !== typeof jest && !1 !== isReactActEnvironmentGlobal; + } function isConcurrentActEnvironment() { var isReactActEnvironmentGlobal = "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT @@ -15179,15 +15471,17 @@ __DEV__ && )); } function requestUpdateLane(fiber) { + var mode = fiber.mode; + if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; 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), + mode = ReactSharedInternals.T; + return null !== mode + ? (mode._updatedFibers || (mode._updatedFibers = new Set()), + mode._updatedFibers.add(fiber), (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane()) : resolveUpdatePriority(); @@ -15232,10 +15526,10 @@ __DEV__ && "Unknown"; didWarnAboutUpdateInRenderForAnotherComponent.has(root) || (didWarnAboutUpdateInRenderForAnotherComponent.add(root), - (lane = getComponentNameFromFiber(fiber) || "Unknown"), + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), error$jscomp$0( "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", - lane, + fiber, root, root )); @@ -15250,20 +15544,21 @@ __DEV__ && } else { isDevToolsPresent && addFiberToLanesMap(root, fiber, lane); warnIfUpdatesNotWrappedWithActDEV(fiber); - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now$1()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index = 31 - clz32(lane), - transitions = transitionLanesMap[index]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now$1()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index = 31 - clz32(lane), + transitions = transitionLanesMap[index]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index] = transitions; + } } root === workInProgressRoot && ((executionContext & RenderContext) === NoContext && @@ -15275,6 +15570,13 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); + lane !== SyncLane || + executionContext !== NoContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ReactSharedInternals.isBatchingLegacy || + ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -15507,7 +15809,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$40) { + } catch (error$45) { return !1; } } @@ -15563,7 +15865,7 @@ __DEV__ && currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { + if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -15602,6 +15904,20 @@ __DEV__ && ensureRootIsScheduled(root); return null; } + function batchedUpdates$1(fn, a) { + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + executionContext !== NoContext || + ReactSharedInternals.isBatchingLegacy || + ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } + } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(!1), !1) @@ -15816,8 +16132,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$41) { - handleThrow(root, thrownValue$41); + } catch (thrownValue$46) { + handleThrow(root, thrownValue$46); } while (1); lanes && root.shellSuspendCounter++; @@ -15959,8 +16275,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$42) { - handleThrow(root, thrownValue$42); + } catch (thrownValue$47) { + handleThrow(root, thrownValue$47); } while (1); resetContextDependencies(); @@ -16104,9 +16420,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$43) { + } catch (error$48) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$43); + throw ((workInProgress = returnFiber), error$48); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -16334,7 +16650,7 @@ __DEV__ && (rootWithPassiveNestedUpdates = null)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); + transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); @@ -16353,7 +16669,8 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) && + 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && @@ -16480,7 +16797,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); - commitDoubleInvokeEffectsInDEV(root); + commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(!1); if (enableTransitionTracing) { @@ -16618,7 +16935,8 @@ __DEV__ && : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); - isConcurrentActEnvironment() && + (disableLegacyMode || 0 !== root.tag) && + isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && error$jscomp$0( "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" @@ -16636,7 +16954,12 @@ __DEV__ && ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) + ? claimNextRetryLane() + : SyncLane)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -16747,17 +17070,52 @@ __DEV__ && reconnectPassiveEffects(root, fiber, 0, null, !1); setIsStrictModeForDevtools(!1); } - function commitDoubleInvokeEffectsInDEV(root) { - var doubleInvokeEffects = !0; - root.current.mode & 24 || (doubleInvokeEffects = !1); - recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root, - root.current, - doubleInvokeEffects - ); + function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { + disableLegacyMode || 0 !== root.tag + ? ((hasPassiveEffects = !0), + (!disableLegacyMode && 1 !== root.tag) || + root.current.mode & 24 || + (hasPassiveEffects = !1), + recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + root.current, + hasPassiveEffects + )) + : runWithFiberInDEV( + root.current, + legacyCommitDoubleInvokeEffectsInDEV, + root.current, + hasPassiveEffects + ); + } + function legacyCommitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectUnmountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, invokePassiveEffectUnmountInDEV); + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectMountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, 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))); + } } function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { - if ((executionContext & RenderContext) === NoContext) { + if ( + (executionContext & RenderContext) === NoContext && + (disableLegacyMode || fiber.mode & 1) + ) { var tag = fiber.tag; if ( 3 === tag || @@ -16793,8 +17151,15 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - isConcurrentActEnvironment() && - null === ReactSharedInternals.actQueue && + if (disableLegacyMode || fiber.mode & 1) { + if (!isConcurrentActEnvironment()) return; + } else if ( + !isLegacyActEnvironment() || + executionContext !== NoContext || + (0 !== fiber.tag && 11 !== fiber.tag && 15 !== fiber.tag) + ) + return; + null === ReactSharedInternals.actQueue && runWithFiberInDEV(fiber, function () { error$jscomp$0( "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", @@ -17167,10 +17532,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -17388,7 +17755,7 @@ __DEV__ && onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -17428,16 +17795,30 @@ __DEV__ && for ( this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], - tag = 0; - tag < TotalLanes; - tag++ + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; tag < TotalLanes; tag++) containerInfo.push(new Set()); - this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + for ( + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ + ) + containerInfo.push(new Set()); + if (disableLegacyMode) + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + else + switch (tag) { + case 1: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case 0: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + } } function createFiberRoot( containerInfo, @@ -17467,11 +17848,13 @@ __DEV__ && containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isDevToolsPresent && (hydrationCallbacks |= 2); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isDevToolsPresent && (tag |= 2); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -17575,6 +17958,61 @@ __DEV__ && } return component.stateNode; } + function createHydrationContainer( + initialChildren, + callback, + containerInfo, + tag, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ) { + initialChildren = createFiberRoot( + containerInfo, + tag, + !0, + initialChildren, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ); + initialChildren.context = getContextForSubtree(null); + containerInfo = initialChildren.current; + tag = requestUpdateLane(containerInfo); + hydrationCallbacks = createUpdate(tag); + hydrationCallbacks.callback = + void 0 !== callback && null !== callback ? callback : null; + enqueueUpdate(containerInfo, hydrationCallbacks, tag); + initialChildren.current.lanes = tag; + markRootUpdated(initialChildren, tag); + ensureRootIsScheduled(initialChildren); + return initialChildren; + } + function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; + } function updateContainerSync( element, container, @@ -17646,6 +18084,17 @@ __DEV__ && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane)); } + function getPublicRootInstance(container) { + container = container.current; + if (!container.child) return null; + switch (container.child.tag) { + case 27: + case 5: + return container.child.stateNode; + default: + return container.child.stateNode; + } + } function markRetryLaneImpl(fiber, retryLane) { fiber = fiber.memoizedState; if (null !== fiber && null !== fiber.dehydrated) { @@ -17679,7 +18128,7 @@ __DEV__ && if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; try { - return fn(a); + return batchedUpdates$1(fn, a, b); } finally { if ( ((isInsideEventHandler = !1), @@ -18370,8 +18819,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$46) { - reportGlobalError(error$46); + } catch (error$51) { + reportGlobalError(error$51); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18392,8 +18841,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$46) { - reportGlobalError(error$46); + } catch (error$51) { + reportGlobalError(error$51); } previousInstance.currentTarget = null; previousInstance = instance; @@ -21421,6 +21870,20 @@ __DEV__ && } while (node); retryIfBlockedOn(suspenseInstance); } + function clearContainer(container) { + var nodeType = container.nodeType; + if (nodeType === DOCUMENT_NODE) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break; + default: + container.textContent = ""; + } + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -21671,6 +22134,16 @@ __DEV__ && ? container.getRootNode() : container.ownerDocument; } + function flushSyncWork() { + if (disableLegacyMode) { + var previousWasRendering = previousDispatcher.f(), + wasRendering = flushSyncWork$1(); + return previousWasRendering || wasRendering; + } + throw Error( + "flushSyncWork should not be called from builds that support legacy mode. This is a bug in React." + ); + } function preconnectAs(rel, href, crossOrigin) { var ownerDocument = globalDocument; if (ownerDocument && "string" === typeof href && href) { @@ -23038,6 +23511,16 @@ __DEV__ && " react-mount-point-unstable " !== node.nodeValue)) ); } + function isValidContainerLegacy(node) { + return !( + !node || + (1 !== node.nodeType && + node.nodeType !== DOCUMENT_NODE && + node.nodeType !== DOCUMENT_FRAGMENT_NODE && + (node.nodeType !== COMMENT_NODE || + " react-mount-point-unstable " !== node.nodeValue)) + ); + } function registerReactDOMEvent( target, domEventName, @@ -23068,6 +23551,30 @@ __DEV__ && "ReactDOM.createEventHandle: setter called on an invalid target. Provide a valid EventTarget or an element managed by React." ); } + function flushSyncImpl(fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = Internals.p; + try { + if ( + ((ReactSharedInternals.T = null), + (Internals.p = DiscreteEventPriority), + fn) + ) + return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (Internals.p = previousUpdatePriority), + Internals.d.f() && + error$jscomp$0( + "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." + ); + } + } + function flushSyncErrorInBuildsThatSupportLegacyMode() { + throw Error( + "Expected this build of React to not support legacy mode but it does. This is a bug in React." + ); + } function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) @@ -23095,6 +23602,37 @@ __DEV__ && ? "`" + thing + "`" : 'something with type "' + typeof thing + '"'; } + function flushSyncFromReconciler(fn) { + (executionContext & (RenderContext | CommitContext)) !== NoContext && + error$jscomp$0( + "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." + ); + a: { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + (executionContext & (RenderContext | CommitContext)) !== NoContext || + flushPassiveEffects(); + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + var JSCompiler_inline_result = fn ? fn() : void 0; + break a; + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + (executionContext = prevExecutionContext), + (executionContext & (RenderContext | CommitContext)) === + NoContext && flushSyncWorkAcrossRoots_impl(!1); + } + JSCompiler_inline_result = void 0; + } + return JSCompiler_inline_result; + } function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; } @@ -23129,6 +23667,122 @@ __DEV__ && null != errorInfo.componentStack ? errorInfo.componentStack : "" }) && defaultOnCaughtError(error, errorInfo); } + function getReactRootElementInContainer(container) { + return container + ? container.nodeType === DOCUMENT_NODE + ? container.documentElement + : container.firstChild + : null; + } + function noopOnRecoverableError() {} + function legacyCreateRootFromDOMContainer( + container, + initialChildren, + parentComponent, + callback, + isHydrationContainer + ) { + if (isHydrationContainer) { + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + var root = createHydrationContainer( + initialChildren, + callback, + container, + 0, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root; + container[internalContainerInstanceKey] = root.current; + listenToAllSupportedEvents( + container.nodeType === COMMENT_NODE ? container.parentNode : container + ); + flushSyncWork$1(); + return root; + } + clearContainer(container); + if ("function" === typeof callback) { + var _originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(_root); + _originalCallback.call(instance); + }; + } + var _root = createFiberRoot( + container, + 0, + !1, + null, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = _root; + container[internalContainerInstanceKey] = _root.current; + listenToAllSupportedEvents( + container.nodeType === COMMENT_NODE ? container.parentNode : container + ); + updateContainerSync(initialChildren, _root, parentComponent, callback); + flushSyncWork$1(); + return _root; + } + function warnOnInvalidCallback(callback) { + null !== callback && + "function" !== typeof callback && + error$jscomp$0( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + ); + } + function legacyRenderSubtreeIntoContainer( + parentComponent, + children, + container, + forceHydrate, + callback + ) { + topLevelUpdateWarnings(container); + warnOnInvalidCallback(void 0 === callback ? null : callback); + var maybeRoot = container._reactRootContainer; + if (maybeRoot) { + var root = maybeRoot; + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + updateContainer(children, root, parentComponent, callback); + } else + root = legacyCreateRootFromDOMContainer( + container, + children, + parentComponent, + callback, + forceHydrate + ); + return getPublicRootInstance(root); + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -23169,6 +23823,7 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -25652,7 +26307,7 @@ __DEV__ && update.payload = payload; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -25671,7 +26326,7 @@ __DEV__ && update.payload = payload; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -25689,7 +26344,7 @@ __DEV__ && update.tag = ForceUpdate; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -25854,6 +26509,7 @@ __DEV__ && callbacks = [], PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, NoContext = 0, + BatchedContext = 1, RenderContext = 2, CommitContext = 4, RootInProgress = 0, @@ -26011,7 +26667,7 @@ __DEV__ && }); window.addEventListener("test", options$jscomp$0, options$jscomp$0); window.removeEventListener("test", options$jscomp$0, options$jscomp$0); - } catch (e$44) { + } catch (e$49) { passiveBrowserEventsSupported = !1; } var EventListenerWWW = require("EventListener"), @@ -26448,11 +27104,7 @@ __DEV__ && preconnectsSet = new Set(), previousDispatcher = Internals.d; Internals.d = { - f: function () { - var previousWasRendering = previousDispatcher.f(), - wasRendering = flushSyncWork$1(); - return previousWasRendering || wasRendering; - }, + f: disableLegacyMode ? flushSyncWork : previousDispatcher.f, r: function (form) { var formInst = getInstanceFromNode(form); null !== formInst && 5 === formInst.tag && "form" === formInst.type @@ -26715,14 +27367,17 @@ __DEV__ && ), lastScheduledReplayQueue = null, _enabled = !0, - return_targetInst = null; + return_targetInst = null, + flushSync$1 = disableLegacyMode + ? flushSyncImpl + : flushSyncErrorInBuildsThatSupportLegacyMode; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-f0e8164410-20240614" !== isomorphicReactPackageVersion) + if ("19.0.0-www-classic-88959fd54a-20240614" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-classic-f0e8164410-20240614\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-classic-88959fd54a-20240614\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26735,6 +27390,7 @@ __DEV__ && error$jscomp$0( "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills" ); + var flushSync = disableLegacyMode ? flushSync$1 : flushSyncFromReconciler; Internals.findDOMNode = function (componentOrElement) { var fiber = componentOrElement._reactInternals; if (void 0 === fiber) { @@ -26787,12 +27443,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); })({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-dom" }) && canUseDOM && @@ -26827,16 +27483,7 @@ __DEV__ && error$jscomp$0( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function (JSCompiler_OptimizeArgumentsArray_p3) { @@ -26884,6 +27531,33 @@ __DEV__ && throw Error( "Expected ReactFiberErrorDialog.showErrorDialog to be a function." ); + var topLevelUpdateWarnings = function (container) { + if ( + container._reactRootContainer && + container.nodeType !== COMMENT_NODE + ) { + var hostInstance = findCurrentFiberUsingSlowPath( + container._reactRootContainer.current + ); + hostInstance = + null !== hostInstance + ? findCurrentHostFiberWithNoPortalsImpl(hostInstance) + : null; + hostInstance = null === hostInstance ? null : hostInstance.stateNode; + hostInstance && + hostInstance.parentNode !== container && + error$jscomp$0( + "It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container." + ); + } + hostInstance = !!container._reactRootContainer; + (container = getReactRootElementInContainer(container)) && + getInstanceFromNode(container) && + !hostInstance && + error$jscomp$0( + "Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render." + ); + }; assign(Internals, { ReactBrowserEventEmitter: { isEnabled: function () { @@ -26981,25 +27655,7 @@ __DEV__ && ? componentOrElement : findHostInstanceWithWarning(componentOrElement, "findDOMNode"); }; - exports.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if ( - ((ReactSharedInternals.T = null), - (Internals.p = DiscreteEventPriority), - fn) - ) - return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f() && - error$jscomp$0( - "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.flushSync = flushSync; exports.hydrateRoot = function (container, initialChildren, options) { options = assign( { @@ -27039,11 +27695,11 @@ __DEV__ && void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState)); - initialChildren = createFiberRoot( + initialChildren = createHydrationContainer( + initialChildren, + null, container, 1, - !0, - initialChildren, null != options ? options : null, isStrictMode, concurrentUpdatesByDefaultOverride, @@ -27054,15 +27710,6 @@ __DEV__ && transitionCallbacks, formState ); - initialChildren.context = getContextForSubtree(null); - options = initialChildren.current; - isStrictMode = requestUpdateLane(options); - concurrentUpdatesByDefaultOverride = createUpdate(isStrictMode); - concurrentUpdatesByDefaultOverride.callback = null; - enqueueUpdate(options, concurrentUpdatesByDefaultOverride, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); - ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); @@ -27328,24 +27975,80 @@ __DEV__ && })) : Internals.d.m(href)); }; - exports.render = function () { + exports.render = function (element, container, callback) { + if (disableLegacyMode) + throw ( + (error$jscomp$0( + "ReactDOM.render was removed in React 19. Use createRoot instead." + ), + Error("ReactDOM: Unsupported Legacy Mode API.")) + ); error$jscomp$0( - "ReactDOM.render was removed in React 19. Use createRoot instead." + "ReactDOM.render has not been supported since React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot" + ); + if (!isValidContainerLegacy(container)) + throw Error("Target container is not a DOM element."); + container[internalContainerInstanceKey] && + void 0 === container._reactRootContainer && + error$jscomp$0( + "You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?" + ); + return legacyRenderSubtreeIntoContainer( + null, + element, + container, + !1, + callback ); - throw Error("ReactDOM: Unsupported Legacy Mode API."); }; exports.requestFormReset = function (form) { Internals.d.r(form); }; - exports.unmountComponentAtNode = function () { - error$jscomp$0( - "unmountComponentAtNode was removed in React 19. Use root.unmount() instead." - ); - throw Error("ReactDOM: Unsupported Legacy Mode API."); - }; - exports.unstable_batchedUpdates = function (fn, a) { - return fn(a); + exports.unmountComponentAtNode = function (container) { + if (disableLegacyMode) + throw ( + (error$jscomp$0( + "unmountComponentAtNode was removed in React 19. Use root.unmount() instead." + ), + Error("ReactDOM: Unsupported Legacy Mode API.")) + ); + if (!isValidContainerLegacy(container)) + throw Error("Target container is not a DOM element."); + container[internalContainerInstanceKey] && + void 0 === container._reactRootContainer && + error$jscomp$0( + "You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?" + ); + if (container._reactRootContainer) { + var root = container._reactRootContainer, + rootEl = getReactRootElementInContainer(container); + rootEl && + !getInstanceFromNode(rootEl) && + error$jscomp$0( + "unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React." + ); + updateContainerSync(null, root, null, null); + flushSyncWork$1(); + container._reactRootContainer = null; + container[internalContainerInstanceKey] = null; + return !0; + } + root = getReactRootElementInContainer(container); + root = !(!root || !getInstanceFromNode(root)); + container = + 1 === container.nodeType && + isValidContainerLegacy(container.parentNode) && + !!container.parentNode._reactRootContainer; + root && + error$jscomp$0( + "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", + container + ? "You may have accidentally passed in a React root node instead of its container." + : "Instead, have the parent component update its state and rerender in order to remove this component." + ); + return !1; }; + exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_createEventHandle = function (type, options) { function eventHandle(target, callback) { if ("function" !== typeof callback) @@ -27388,7 +28091,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-f0e8164410-20240614"; + exports.version = "19.0.0-www-classic-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 3a4bc0026a..b9d367581b 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -26520,11 +26520,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-f0e8164410-20240614" !== isomorphicReactPackageVersion) + if ("19.0.0-www-modern-88959fd54a-20240614" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-modern-f0e8164410-20240614\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-modern-88959fd54a-20240614\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26589,12 +26589,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); })({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-dom" }) && canUseDOM && @@ -27190,7 +27190,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-f0e8164410-20240614"; + exports.version = "19.0.0-www-modern-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index f33dff56bd..8528a00321 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -61,6 +61,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -198,6 +199,9 @@ function getComponentNameFromFiber(fiber) { return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -1547,6 +1551,10 @@ function isContextProvider(type) { type = type.childContextTypes; return null !== type && void 0 !== type; } +function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor); +} function pushTopLevelContextObject(fiber, context, didChange) { if (contextStackCursor.current !== emptyContextObject) throw Error(formatProdErrorMessage(168)); @@ -1926,7 +1934,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { do { var didPerformSomeWork = !1; for (var root$26 = firstScheduledRoot; null !== root$26; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root$26.tag)) { var workInProgressRootRenderLanes$28 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$28 = getNextLanes( root$26, @@ -3158,7 +3166,15 @@ function createChildReconciler(shouldTrackSideEffects) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -4240,7 +4256,7 @@ function refreshCache(fiber, seedKey, seedValue) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(); + var lane = requestUpdateLane(provider); fiber = createUpdate(lane); var root$77 = enqueueUpdate(provider, fiber, lane); null !== root$77 && @@ -4258,7 +4274,7 @@ function refreshCache(fiber, seedKey, seedValue) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); + var lane = requestUpdateLane(fiber); action = { lane: lane, revertLane: 0, @@ -4275,7 +4291,7 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), update = { lane: lane, revertLane: 0, @@ -4701,7 +4717,7 @@ var classComponentUpdater = { }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.payload = payload; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4712,7 +4728,7 @@ var classComponentUpdater = { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -4724,7 +4740,7 @@ var classComponentUpdater = { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 2; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4750,6 +4766,33 @@ function checkShouldComponentUpdate( ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; +} function callComponentWillReceiveProps( workInProgress, instance, @@ -4764,6 +4807,41 @@ 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; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} function resolveClassComponentProps( Component, baseProps, @@ -4899,6 +4977,36 @@ function initializeClassErrorUpdate(update, root, fiber, errorInfo) { }); }); } +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; +} function throwException( root, returnFiber, @@ -4912,71 +5020,100 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = 3); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - throw Error(formatProdErrorMessage(435, sourceFiber.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && ((root = Error(formatProdErrorMessage(422), { cause: value })), queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) @@ -4991,10 +5128,10 @@ function throwException( (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -5002,54 +5139,62 @@ function throwException( (workInProgressRootExitStatus = 2)), !1 ); - var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); - wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wrapperError]) - : workInProgressRootConcurrentErrors.push(wrapperError); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), - (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), - enqueueCapturedUpdate(sourceFiber, root), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (wrapperError = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== wrapperError && - "function" === typeof wrapperError.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5159,10 +5304,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$93 = workInProgress.stateNode; + root$94 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$93.incompleteTransitions.has(transition)) { + if (!root$94.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5170,11 +5315,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$93.incompleteTransitions.set(transition, markerInstance); + root$94.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$93.incompleteTransitions.forEach(function (markerInstance) { + root$94.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5350,28 +5495,36 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -5501,7 +5654,7 @@ function replayFunctionComponent( return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -5512,123 +5665,47 @@ function updateClassComponent( pushContextProvider(workInProgress); } else hasContext = !1; prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = Component.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - var instance = new Component(nextProps, context); - workInProgress.memoizedState = - null !== instance.state && void 0 !== instance.state - ? instance.state - : null; - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - instance._reactInternals = workInProgress; - isLegacyContextConsumer && - ((isLegacyContextConsumer = workInProgress.stateNode), - (isLegacyContextConsumer.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (isLegacyContextConsumer.__reactInternalMemoizedMaskedChildContext = - context)); - unmaskedContext = workInProgress.stateNode; - unmaskedContext.props = nextProps; - unmaskedContext.state = workInProgress.memoizedState; - unmaskedContext.refs = {}; - initializeUpdateQueue(workInProgress); - isLegacyContextConsumer = Component.contextType; - "object" === typeof isLegacyContextConsumer && - null !== isLegacyContextConsumer - ? (unmaskedContext.context = readContext(isLegacyContextConsumer)) - : ((isLegacyContextConsumer = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (unmaskedContext.context = getMaskedContext( - workInProgress, - isLegacyContextConsumer - ))); - unmaskedContext.state = workInProgress.memoizedState; - isLegacyContextConsumer = Component.getDerivedStateFromProps; - "function" === typeof isLegacyContextConsumer && - (applyDerivedStateFromProps( - 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, - isLegacyContextConsumer, - nextProps - ), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ((isLegacyContextConsumer = unmaskedContext.state), - "function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount(), - isLegacyContextConsumer !== unmaskedContext.state && - classComponentUpdater.enqueueReplaceState( - unmaskedContext, - unmaskedContext.state, - null - ), - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ), - suspendIfUpdateReadFromEntangledAsyncAction(), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof unmaskedContext.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current$jscomp$0) { - unmaskedContext = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - isLegacyContextConsumer = resolveClassComponentProps( - Component, - unresolvedOldProps, - workInProgress.type === workInProgress.elementType - ); - unmaskedContext.props = isLegacyContextConsumer; - var oldContext = unmaskedContext.context; - context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) + unresolvedOldProps, + workInProgress.type === workInProgress.elementType + ); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current), - (context = getMaskedContext(workInProgress, context))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - instance = - "function" === typeof getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate; + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - instance || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== context) && + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, - context + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - unmaskedContext.state = oldState; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || @@ -5643,50 +5720,49 @@ function updateClassComponent( nextProps ), (oldContext = workInProgress.memoizedState)), - (isLegacyContextConsumer = + (oldProps = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - isLegacyContextConsumer, + oldProps, nextProps, oldState, oldContext, - context + contextType )) - ? (instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ("function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount()), - "function" === typeof unmaskedContext.componentDidMount && + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof unmaskedContext.componentDidMount && + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = oldContext), - (unmaskedContext.context = context), - (nextProps = isLegacyContextConsumer)) - : ("function" === typeof unmaskedContext.componentDidMount && + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - unmaskedContext = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - isLegacyContextConsumer = workInProgress.memoizedProps; - context = resolveClassComponentProps( + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( Component, - isLegacyContextConsumer, + oldProps, workInProgress.type === workInProgress.elementType ); - unmaskedContext.props = context; - instance = workInProgress.pendingProps; - unresolvedOldProps = unmaskedContext.context; + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; oldContext = Component.contextType; "object" === typeof oldContext && null !== oldContext ? (oldContext = readContext(oldContext)) @@ -5697,31 +5773,30 @@ function updateClassComponent( oldState = Component.getDerivedStateFromProps; (getDerivedStateFromProps = "function" === typeof oldState || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate) || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((isLegacyContextConsumer !== instance || - unresolvedOldProps !== oldContext) && + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, oldContext )); hasForceUpdate = !1; unresolvedOldProps = workInProgress.memoizedState; - unmaskedContext.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - isLegacyContextConsumer !== instance || + oldProps !== hasNewLifecycles || unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && (applyDerivedStateFromProps( workInProgress, @@ -5730,106 +5805,117 @@ function updateClassComponent( nextProps ), (newState = workInProgress.memoizedState)), - (context = + (contextType = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + contextType, nextProps, unresolvedOldProps, newState, oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillUpdate && - "function" !== typeof unmaskedContext.componentWillUpdate) || - ("function" === typeof unmaskedContext.componentWillUpdate && - unmaskedContext.componentWillUpdate( - nextProps, - newState, - oldContext - ), - "function" === - typeof unmaskedContext.UNSAFE_componentWillUpdate && - unmaskedContext.UNSAFE_componentWillUpdate( + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( nextProps, newState, oldContext )), - "function" === typeof unmaskedContext.componentDidUpdate && + "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate && + "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = newState), - (unmaskedContext.context = oldContext), - (nextProps = context)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - unmaskedContext = nextProps; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { markRef(current$jscomp$0, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - unmaskedContext || nextProps - ? ((unmaskedContext = workInProgress.stateNode), - (current = workInProgress), - (isLegacyContextConsumer = - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? null - : unmaskedContext.render()), - (workInProgress.flags |= 1), - null !== current$jscomp$0 && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - isLegacyContextConsumer, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - isLegacyContextConsumer, - renderLanes - ), - (workInProgress.memoizedState = unmaskedContext.state), - hasContext && invalidateContextProvider(workInProgress, Component, !0), - (current$jscomp$0 = workInProgress.child)) - : (hasContext && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( current$jscomp$0, workInProgress, renderLanes - ))); - return current$jscomp$0; + ) + ); + shouldUpdate = workInProgress.stateNode; + current = workInProgress; + var nextChildren = + didCaptureError && "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -5967,18 +6053,18 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = showFallback.updateQueue), - null === renderLanes + (current = showFallback.updateQueue), + null === current ? (showFallback.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -6027,9 +6113,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { : (reuseSuspenseHandlerOnStack(workInProgress), (showFallback = nextProps.fallback), (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - nextInstance + nextInstance, + 0, + null )), (showFallback = createFiberFromFragment( showFallback, @@ -6042,12 +6130,13 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (showFallback.return = workInProgress), (nextProps.sibling = showFallback), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), (nextProps.childLanes = getRemainingWorkInPrimaryTree( @@ -6152,7 +6241,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { )), (nextInstance._reactRetry = workInProgress), (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), (nextHydratableInstance = getNextHydratable( nextInstance.nextSibling )), @@ -6160,12 +6249,12 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (isHydrating = !0), (hydrationErrors = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && ((idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, @@ -6181,12 +6270,20 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextInstance = workInProgress.mode), (JSCompiler_temp$jscomp$0 = current.child), (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + (didSuspend = { mode: "hidden", children: nextProps.children }), + disableLegacyMode || + 0 !== (nextInstance & 1) || + workInProgress.child === JSCompiler_temp$jscomp$0 + ? ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + (workInProgress.deletions = null)), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -6251,27 +6348,32 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps ); pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -6282,26 +6384,30 @@ function mountSuspenseFallbackChildren( fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || 0 !== (mode & 1) || null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); -} function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -6379,57 +6485,68 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) { nextProps &= 1; } push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 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; @@ -6599,11 +6716,12 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: + var elementType = workInProgress.elementType; a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); var props = workInProgress.pendingProps; - current = workInProgress.elementType; - var init = current._init; - current = init(current._payload); + current = elementType._init; + current = current(elementType._payload); workInProgress.type = current; if ("function" === typeof current) shouldConstruct(current) @@ -6629,7 +6747,10 @@ function beginWork(current, workInProgress, renderLanes) { ))); else { if (void 0 !== current && null !== current) - if (((init = current.$$typeof), init === REACT_FORWARD_REF_TYPE)) { + if ( + ((elementType = current.$$typeof), + elementType === REACT_FORWARD_REF_TYPE) + ) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6642,7 +6763,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); break a; - } else if (init === REACT_MEMO_TYPE) { + } else if (elementType === REACT_MEMO_TYPE) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6665,37 +6786,43 @@ function beginWork(current, workInProgress, renderLanes) { case 0: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), updateFunctionComponent( current, workInProgress, props, - init, + elementType, renderLanes ) ); case 1: return ( (props = workInProgress.type), - (init = resolveClassComponentProps( + (elementType = resolveClassComponentProps( props, workInProgress.pendingProps, workInProgress.elementType === props )), - updateClassComponent(current, workInProgress, props, init, renderLanes) + updateClassComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 3: a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - props = init.element; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6704,19 +6831,19 @@ function beginWork(current, workInProgress, renderLanes) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); nextProps = nextState.cache; pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); nextProps = nextState.element; - if (init.isDehydrated) + if (elementType.isDehydrated) if ( - ((init = { + ((elementType = { element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { workInProgress = mountHostRootWithoutHydrating( @@ -6833,7 +6960,7 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = props = nextHydratableInstance)) + if ((elementType = props = nextHydratableInstance)) (props = canHydrateInstance( props, workInProgress.type, @@ -6845,22 +6972,22 @@ function beginWork(current, workInProgress, renderLanes) { (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable(props.firstChild)), (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); + (elementType = !0)) + : (elementType = !1); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); - init = workInProgress.type; + elementType = workInProgress.type; nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; props = nextProps.children; - shouldSetTextContent(init, nextProps) + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && - shouldSetTextContent(init, nextState) && + shouldSetTextContent(elementType, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((elementType = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6868,11 +6995,11 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = init), + (HostTransitionContext._currentValue = elementType), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== elementType && propagateContextChange( workInProgress, HostTransitionContext, @@ -6920,13 +7047,19 @@ function beginWork(current, workInProgress, renderLanes) { case 11: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - updateForwardRef(current, workInProgress, props, init, renderLanes) + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + updateForwardRef( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 7: return ( @@ -6963,14 +7096,14 @@ function beginWork(current, workInProgress, renderLanes) { props = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + elementType = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextState = init.value; + nextState = elementType.value; pushProvider(workInProgress, props, nextState); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextState)) { if ( - nextProps.children === init.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -6981,19 +7114,24 @@ function beginWork(current, workInProgress, renderLanes) { break a; } } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (props = props(init)), + (elementType = readContext(elementType)), + (props = props(elementType)), (workInProgress.flags |= 1), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -7001,14 +7139,20 @@ function beginWork(current, workInProgress, renderLanes) { case 14: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props.type, init)), - updateMemoComponent(current, workInProgress, props, init, renderLanes) + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props.type, elementType)), + updateMemoComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -7018,6 +7162,47 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(props) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, props, elementType); + mountClassInstance(workInProgress, props, elementType, renderLanes); + return finishClassComponent( + null, + workInProgress, + props, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + props, + elementType, + renderLanes + ); case 19: return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: @@ -7036,34 +7221,38 @@ function beginWork(current, workInProgress, renderLanes) { prepareToReadContext(workInProgress, renderLanes), (props = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((elementType = peekCacheFromPool()), + null === elementType && + ((elementType = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (elementType.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: props, cache: init }), + null !== nextProps && + (elementType.pooledCacheLanes |= renderLanes), + (elementType = nextProps)), + (workInProgress.memoizedState = { + parent: props, + cache: elementType + }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, elementType)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (elementType = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== props - ? ((init = { parent: props, cache: props }), - (workInProgress.memoizedState = init), + elementType.parent !== props + ? ((elementType = { parent: props, cache: props }), + (workInProgress.memoizedState = elementType), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), + elementType), pushProvider(workInProgress, CacheContext, props)) : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), - props !== init.cache && + props !== elementType.cache && propagateContextChange( workInProgress, CacheContext, @@ -7598,14 +7787,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$129 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$129 = lastTailNode), + for (var lastTailNode$137 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$137 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$129 + null === lastTailNode$137 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$129.sibling = null); + : (lastTailNode$137.sibling = null); } } function bubbleProperties(completedWork) { @@ -7615,19 +7804,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags & 31457280), - (subtreeFlags |= child$130.flags & 31457280), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (var child$138 = completedWork.child; null !== child$138; ) + (newChildLanes |= child$138.lanes | child$138.childLanes), + (subtreeFlags |= child$138.subtreeFlags & 31457280), + (subtreeFlags |= child$138.flags & 31457280), + (child$138.return = completedWork), + (child$138 = child$138.sibling); else - for (child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags), - (subtreeFlags |= child$130.flags), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (child$138 = completedWork.child; null !== child$138; ) + (newChildLanes |= child$138.lanes | child$138.childLanes), + (subtreeFlags |= child$138.subtreeFlags), + (subtreeFlags |= child$138.flags), + (child$138.return = completedWork), + (child$138 = child$138.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7636,6 +7825,8 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -7648,8 +7839,7 @@ function completeWork(current, workInProgress, renderLanes) { return bubbleProperties(workInProgress), null; case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null ); @@ -7923,11 +8113,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$142 = null; + var cache$150 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$142 = newProps.memoizedState.cachePool.pool); - cache$142 !== type && (newProps.flags |= 2048); + (cache$150 = newProps.memoizedState.cachePool.pool); + cache$150 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7956,13 +8146,18 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor); type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$142 = type.rendering; - if (null === cache$142) + cache$150 = type.rendering; + if (null === cache$150) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7970,11 +8165,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$142 = findFirstSuspended(current); - if (null !== cache$142) { + cache$150 = findFirstSuspended(current); + if (null !== cache$150) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$142.updateQueue; + current = cache$150.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7999,7 +8194,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$142)), null !== current)) { + if (((current = findFirstSuspended(cache$150)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8009,7 +8204,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$142.alternate && + !cache$150.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8022,13 +8217,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$142.sibling = workInProgress.child), - (workInProgress.child = cache$142)) + ? ((cache$150.sibling = workInProgress.child), + (workInProgress.child = cache$150)) : ((current = type.last), null !== current - ? (current.sibling = cache$142) - : (workInProgress.child = cache$142), - (type.last = cache$142)); + ? (current.sibling = cache$150) + : (workInProgress.child = cache$150), + (type.last = cache$150)); } if (null !== type.tail) return ( @@ -8069,14 +8264,14 @@ function completeWork(current, workInProgress, renderLanes) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -8112,6 +8307,8 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error(formatProdErrorMessage(156, workInProgress.tag)); } @@ -8120,8 +8317,7 @@ function unwindWork(current, workInProgress) { switch (workInProgress.tag) { case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) @@ -8201,9 +8397,7 @@ function unwindInterruptedWork(current, interruptedWork) { switch (interruptedWork.tag) { case 1: current = interruptedWork.type.childContextTypes; - null !== current && - void 0 !== current && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)); + null !== current && void 0 !== current && popContext(); break; case 3: popProvider(CacheContext); @@ -8306,8 +8500,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$159) { - captureCommitPhaseError(current, nearestMountedAncestor, error$159); + } catch (error$168) { + captureCommitPhaseError(current, nearestMountedAncestor, error$168); } else ref.current = null; } @@ -8344,7 +8538,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$219) { + } catch (e$228) { JSCompiler_temp = null; break a; } @@ -8476,21 +8670,8 @@ function commitBeforeMutationEffects(root, firstChild) { } break; case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } - } + 0 !== (flags & 1024) && + clearContainer(firstChild.stateNode.containerInfo); break; case 5: case 26: @@ -8625,11 +8806,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$161) { + } catch (error$170) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$161 + error$170 ); } } @@ -8674,25 +8855,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevProps) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -9147,15 +9333,21 @@ function commitDeletionEffectsOnFiber( break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -9167,19 +9359,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$173 = finishedWork.alternate; + var current$182 = finishedWork.alternate; if ( - null !== current$173 && - ((current$173 = current$173.memoizedState), - null !== current$173 && - ((current$173 = current$173.dehydrated), null !== current$173)) + null !== current$182 && + ((current$182 = current$182.memoizedState), + null !== current$182 && + ((current$182 = current$182.dehydrated), null !== current$182)) ) try { - retryIfBlockedOn(current$173); + retryIfBlockedOn(current$182); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$173); + onHydrated && onHydrated(current$182); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9297,8 +9489,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$175) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$175); + } catch (error$184) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$184); } } break; @@ -9471,11 +9663,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$176) { + } catch (error$185) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$176 + error$185 ); } break; @@ -9512,8 +9704,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$177) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$177); + } catch (error$186) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$186); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9523,8 +9715,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + } catch (error$188) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$188); } } flags & 1024 && (needsFormReset = !0); @@ -9539,8 +9731,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$180) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$180); + } catch (error$189) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$189); } } break; @@ -9554,8 +9746,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$181) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$181); + } catch (error$190) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$190); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9587,8 +9779,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); + } catch (error$192) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$192); } flags = finishedWork.updateQueue; null !== flags && @@ -9602,13 +9794,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + disableLegacyMode || finishedWork.mode & 1 + ? ((suspenseCallback = offscreenSubtreeIsHidden), + (retryQueue = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = suspenseCallback || domElement), + (offscreenSubtreeWasHidden = retryQueue || newProps), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = retryQueue), + (offscreenSubtreeIsHidden = suspenseCallback)) + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9624,7 +9818,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null === current || newProps || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -9663,11 +9858,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$164) { + } catch (error$173) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$173 ); } } else if ( @@ -9742,21 +9937,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$165 = JSCompiler_inline_result.stateNode; + var parent$174 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$165, ""), + (setTextContent(parent$174, ""), (JSCompiler_inline_result.flags &= -33)); - var before$166 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$166, parent$165); + var before$175 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$175, parent$174); break; case 3: case 4: - var parent$167 = JSCompiler_inline_result.stateNode.containerInfo, - before$168 = getHostSibling(finishedWork); + var parent$176 = JSCompiler_inline_result.stateNode.containerInfo, + before$177 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$168, - parent$167 + before$177, + parent$176 ); break; default: @@ -9835,7 +10030,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$187 = parentFiber.alternate, + var current$196 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9863,16 +10058,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$187 = finishedWork.updateQueue; - if (null !== current$187) { - var hiddenCallbacks = current$187.shared.hiddenCallbacks; + current$196 = finishedWork.updateQueue; + if (null !== current$196) { + var hiddenCallbacks = current$196.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$187.shared.hiddenCallbacks = null, current$187 = 0; - current$187 < hiddenCallbacks.length; - current$187++ + current$196.shared.hiddenCallbacks = null, current$196 = 0; + current$196 < hiddenCallbacks.length; + current$196++ ) - callCallback(hiddenCallbacks[current$187], finishedRoot); + callCallback(hiddenCallbacks[current$196], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9888,7 +10083,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$187 && + null === current$196 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10126,7 +10321,15 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10224,9 +10427,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$194 = finishedWork.stateNode; + var instance$203 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$194._visibility & 4 + ? instance$203._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10234,11 +10437,20 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) - : ((instance$194._visibility |= 4), + : ((instance$203._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$203._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10251,7 +10463,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$194 + instance$203 ); break; case 24: @@ -10672,14 +10884,16 @@ var legacyErrorBoundariesThatAlreadyFailed = null, pendingPassiveTransitions = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; -function requestUpdateLane() { - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== ReactSharedInternals.T) { - var actionScopeLane = currentEntangledLane; - return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); - } - return resolveUpdatePriority(); +function requestUpdateLane(fiber) { + fiber = fiber.mode; + return disableLegacyMode || 0 !== (fiber & 1) + ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : resolveUpdatePriority() + : 2; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -10704,20 +10918,21 @@ function scheduleUpdateOnFiber(root, fiber, lane) { ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index$11 = 31 - clz32(lane), - transitions = transitionLanesMap[index$11]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index$11] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$11 = 31 - clz32(lane), + transitions = transitionLanesMap[index$11]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$11] = transitions; + } } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -10729,6 +10944,12 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + 0 !== executionContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ((workInProgressRootRenderTargetTime = now() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -10994,7 +11215,7 @@ function performSyncWorkOnRoot(root, lanes) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { + if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -11033,6 +11254,19 @@ function performSyncWorkOnRoot(root, lanes) { ensureRootIsScheduled(root); return null; } +function batchedUpdates$1(fn, a) { + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + 0 === executionContext && + ((workInProgressRootRenderTargetTime = now() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } +} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(!1), !1) @@ -11196,8 +11430,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$205) { - handleThrow(root, thrownValue$205); + } catch (thrownValue$214) { + handleThrow(root, thrownValue$214); } while (1); lanes && root.shellSuspendCounter++; @@ -11306,8 +11540,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$207) { - handleThrow(root, thrownValue$207); + } catch (thrownValue$216) { + handleThrow(root, thrownValue$216); } while (1); resetContextDependencies(); @@ -11532,12 +11766,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$213 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$222 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$213 && + shouldFireAfterActiveInstanceBlur$222 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11570,7 +11804,9 @@ function commitRootImpl( renderPriorityLevel(remainingLanes.value, { componentStack: remainingLanes.stack }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -11607,7 +11843,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$214 = rootWithPendingPassiveEffects, + var root$223 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11622,7 +11858,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$214, remainingLanes); + releaseRootPooledCache(root$223, remainingLanes); } } return !1; @@ -11747,7 +11983,10 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -11922,10 +12161,12 @@ function createFiberFromTypeAndProps( return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -12095,7 +12336,7 @@ function FiberRootNode( onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -12169,10 +12410,12 @@ function createFiberRoot( containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -12247,6 +12490,73 @@ function findHostInstance(component) { component = findCurrentHostFiber(fiber); return null === component ? null : component.stateNode; } +function createHydrationContainer( + initialChildren, + callback, + containerInfo, + tag, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState +) { + initialChildren = createFiberRoot( + containerInfo, + tag, + !0, + initialChildren, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ); + initialChildren.context = getContextForSubtree(null); + containerInfo = initialChildren.current; + tag = requestUpdateLane(containerInfo); + hydrationCallbacks = createUpdate(tag); + hydrationCallbacks.callback = + void 0 !== callback && null !== callback ? callback : null; + enqueueUpdate(containerInfo, hydrationCallbacks, tag); + initialChildren.current.lanes = tag; + markRootUpdated(initialChildren, tag); + ensureRootIsScheduled(initialChildren); + return initialChildren; +} +function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; +} +function updateContainerSync(element, container, parentComponent, callback) { + 0 === container.tag && flushPassiveEffects(); + updateContainerImpl( + container.current, + 2, + element, + container, + parentComponent, + callback + ); + return 2; +} function updateContainerImpl( rootFiber, lane, @@ -12268,6 +12578,17 @@ function updateContainerImpl( (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane)); } +function getPublicRootInstance(container) { + container = container.current; + if (!container.child) return null; + switch (container.child.tag) { + case 27: + case 5: + return container.child.stateNode; + default: + return container.child.stateNode; + } +} function markRetryLaneImpl(fiber, retryLane) { fiber = fiber.memoizedState; if (null !== fiber && null !== fiber.dehydrated) { @@ -12294,7 +12615,7 @@ function batchedUpdates(fn, a, b) { if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; try { - return fn(a); + return batchedUpdates$1(fn, a, b); } finally { if ( ((isInsideEventHandler = !1), @@ -12825,19 +13146,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$369; + var JSCompiler_inline_result$jscomp$385; if (canUseDOM) { - var isSupported$jscomp$inline_1536 = "oninput" in document; - if (!isSupported$jscomp$inline_1536) { - var element$jscomp$inline_1537 = document.createElement("div"); - element$jscomp$inline_1537.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1536 = - "function" === typeof element$jscomp$inline_1537.oninput; + var isSupported$jscomp$inline_1555 = "oninput" in document; + if (!isSupported$jscomp$inline_1555) { + var element$jscomp$inline_1556 = document.createElement("div"); + element$jscomp$inline_1556.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1555 = + "function" === typeof element$jscomp$inline_1556.oninput; } - JSCompiler_inline_result$jscomp$369 = isSupported$jscomp$inline_1536; - } else JSCompiler_inline_result$jscomp$369 = !1; + JSCompiler_inline_result$jscomp$385 = isSupported$jscomp$inline_1555; + } else JSCompiler_inline_result$jscomp$385 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$369 && + JSCompiler_inline_result$jscomp$385 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13246,20 +13567,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1577 = 0; - i$jscomp$inline_1577 < simpleEventPluginEvents.length; - i$jscomp$inline_1577++ + var i$jscomp$inline_1596 = 0; + i$jscomp$inline_1596 < simpleEventPluginEvents.length; + i$jscomp$inline_1596++ ) { - var eventName$jscomp$inline_1578 = - simpleEventPluginEvents[i$jscomp$inline_1577], - domEventName$jscomp$inline_1579 = - eventName$jscomp$inline_1578.toLowerCase(), - capitalizedEvent$jscomp$inline_1580 = - eventName$jscomp$inline_1578[0].toUpperCase() + - eventName$jscomp$inline_1578.slice(1); + var eventName$jscomp$inline_1597 = + simpleEventPluginEvents[i$jscomp$inline_1596], + domEventName$jscomp$inline_1598 = + eventName$jscomp$inline_1597.toLowerCase(), + capitalizedEvent$jscomp$inline_1599 = + eventName$jscomp$inline_1597[0].toUpperCase() + + eventName$jscomp$inline_1597.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1579, - "on" + capitalizedEvent$jscomp$inline_1580 + domEventName$jscomp$inline_1598, + "on" + capitalizedEvent$jscomp$inline_1599 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14742,14 +15063,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$248 in nextProps) { - var propKey = nextProps[propKey$248]; - lastProp = lastProps[propKey$248]; + for (var propKey$257 in nextProps) { + var propKey = nextProps[propKey$257]; + lastProp = lastProps[propKey$257]; if ( - nextProps.hasOwnProperty(propKey$248) && + nextProps.hasOwnProperty(propKey$257) && (null != propKey || null != lastProp) ) - switch (propKey$248) { + switch (propKey$257) { case "type": type = propKey; break; @@ -14778,7 +15099,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$248, + propKey$257, propKey, nextProps, lastProp @@ -14797,7 +15118,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$248 = null; + propKey = value = defaultValue = propKey$257 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14828,7 +15149,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$248 = type; + propKey$257 = type; break; case "defaultValue": defaultValue = type; @@ -14849,15 +15170,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$248 - ? updateOptions(domElement, !!lastProps, propKey$248, !1) + null != propKey$257 + ? updateOptions(domElement, !!lastProps, propKey$257, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$248 = null; + propKey = propKey$257 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14881,7 +15202,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$248 = name; + propKey$257 = name; break; case "defaultValue": propKey = name; @@ -14895,17 +15216,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$248, propKey); + updateTextarea(domElement, propKey$257, propKey); return; case "option": - for (var propKey$264 in lastProps) + for (var propKey$273 in lastProps) if ( - ((propKey$248 = lastProps[propKey$264]), - lastProps.hasOwnProperty(propKey$264) && - null != propKey$248 && - !nextProps.hasOwnProperty(propKey$264)) + ((propKey$257 = lastProps[propKey$273]), + lastProps.hasOwnProperty(propKey$273) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$273)) ) - switch (propKey$264) { + switch (propKey$273) { case "selected": domElement.selected = !1; break; @@ -14913,33 +15234,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$264, + propKey$273, null, nextProps, - propKey$248 + propKey$257 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$248 = nextProps[lastDefaultValue]), + ((propKey$257 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$248 !== propKey && - (null != propKey$248 || null != propKey)) + propKey$257 !== propKey && + (null != propKey$257 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$248 && - "function" !== typeof propKey$248 && - "symbol" !== typeof propKey$248; + propKey$257 && + "function" !== typeof propKey$257 && + "symbol" !== typeof propKey$257; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$248, + propKey$257, nextProps, propKey ); @@ -14960,24 +15281,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$269 in lastProps) - (propKey$248 = lastProps[propKey$269]), - lastProps.hasOwnProperty(propKey$269) && - null != propKey$248 && - !nextProps.hasOwnProperty(propKey$269) && - setProp(domElement, tag, propKey$269, null, nextProps, propKey$248); + for (var propKey$278 in lastProps) + (propKey$257 = lastProps[propKey$278]), + lastProps.hasOwnProperty(propKey$278) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$278) && + setProp(domElement, tag, propKey$278, null, nextProps, propKey$257); for (checked in nextProps) if ( - ((propKey$248 = nextProps[checked]), + ((propKey$257 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$248 !== propKey && - (null != propKey$248 || null != propKey)) + propKey$257 !== propKey && + (null != propKey$257 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$248) + if (null != propKey$257) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14985,7 +15306,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$248, + propKey$257, nextProps, propKey ); @@ -14993,49 +15314,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$274 in lastProps) - (propKey$248 = lastProps[propKey$274]), - lastProps.hasOwnProperty(propKey$274) && - void 0 !== propKey$248 && - !nextProps.hasOwnProperty(propKey$274) && + for (var propKey$283 in lastProps) + (propKey$257 = lastProps[propKey$283]), + lastProps.hasOwnProperty(propKey$283) && + void 0 !== propKey$257 && + !nextProps.hasOwnProperty(propKey$283) && setPropOnCustomElement( domElement, tag, - propKey$274, + propKey$283, void 0, nextProps, - propKey$248 + propKey$257 ); for (defaultChecked in nextProps) - (propKey$248 = nextProps[defaultChecked]), + (propKey$257 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$248 === propKey || - (void 0 === propKey$248 && void 0 === propKey) || + propKey$257 === propKey || + (void 0 === propKey$257 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$248, + propKey$257, nextProps, propKey ); return; } } - for (var propKey$279 in lastProps) - (propKey$248 = lastProps[propKey$279]), - lastProps.hasOwnProperty(propKey$279) && - null != propKey$248 && - !nextProps.hasOwnProperty(propKey$279) && - setProp(domElement, tag, propKey$279, null, nextProps, propKey$248); + for (var propKey$288 in lastProps) + (propKey$257 = lastProps[propKey$288]), + lastProps.hasOwnProperty(propKey$288) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$288) && + setProp(domElement, tag, propKey$288, null, nextProps, propKey$257); for (lastProp in nextProps) - (propKey$248 = nextProps[lastProp]), + (propKey$257 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$248 === propKey || - (null == propKey$248 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$248, nextProps, propKey); + propKey$257 === propKey || + (null == propKey$257 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$257, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15155,6 +15476,20 @@ function clearSuspenseBoundary(parentInstance, suspenseInstance) { } while (node); retryIfBlockedOn(suspenseInstance); } +function clearContainer(container) { + var nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break; + default: + container.textContent = ""; + } +} function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -15323,7 +15658,7 @@ function getHoistableRoot(container) { } var previousDispatcher = Internals.d; Internals.d = { - f: flushSyncWork, + f: disableLegacyMode ? flushSyncWork : previousDispatcher.f, r: requestFormReset, D: prefetchDNS$1, C: preconnect$1, @@ -15334,9 +15669,12 @@ Internals.d = { M: preinitModuleScript }; function flushSyncWork() { - var previousWasRendering = previousDispatcher.f(), - wasRendering = flushSyncWork$1(); - return previousWasRendering || wasRendering; + if (disableLegacyMode) { + var previousWasRendering = previousDispatcher.f(), + wasRendering = flushSyncWork$1(); + return previousWasRendering || wasRendering; + } + throw Error(formatProdErrorMessage(521)); } function requestFormReset(form) { var formInst = getInstanceFromNode(form); @@ -15613,26 +15951,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$287 = getResourcesFromRoot( + var styles$296 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$288 = styles$287.get(type); - resource$288 || + resource$297 = styles$296.get(type); + resource$297 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$288 = { + (resource$297 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$287.set(type, resource$288), - (styles$287 = JSCompiler_inline_result.querySelector( + styles$296.set(type, resource$297), + (styles$296 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$287._p && - ((resource$288.instance = styles$287), - (resource$288.state.loading = 5)), + !styles$296._p && + ((resource$297.instance = styles$296), + (resource$297.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15645,16 +15983,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$287 || + styles$296 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$288.state + resource$297.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$288; + return resource$297; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15751,37 +16089,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$293 = hoistableRoot.querySelector( + var instance$302 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$293) + if (instance$302) return ( (resource.state.loading |= 4), - (resource.instance = instance$293), - markNodeAsHoistable(instance$293), - instance$293 + (resource.instance = instance$302), + markNodeAsHoistable(instance$302), + instance$302 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$293 = ( + instance$302 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$293); - var linkInstance = instance$293; + markNodeAsHoistable(instance$302); + var linkInstance = instance$302; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$293, "link", instance); + setInitialProperties(instance$302, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$293, props.precedence, hoistableRoot); - return (resource.instance = instance$293); + insertStylesheet(instance$302, props.precedence, hoistableRoot); + return (resource.instance = instance$302); case "script": - instance$293 = getScriptKey(props.src); + instance$302 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$293) + getScriptSelectorFromKey(instance$302) )) ) return ( @@ -15790,7 +16128,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$293))) + if ((styleProps = preloadPropsMap.get(instance$302))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16326,7 +16664,7 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(nearestMounted), root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); @@ -16759,6 +17097,16 @@ function isValidContainer(node) { " react-mount-point-unstable " !== node.nodeValue)) ); } +function isValidContainerLegacy(node) { + return !( + !node || + (1 !== node.nodeType && + 9 !== node.nodeType && + 11 !== node.nodeType && + (8 !== node.nodeType || + " react-mount-point-unstable " !== node.nodeValue)) + ); +} function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { if ( 1 !== target.nodeType && @@ -16780,23 +17128,69 @@ function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { listenerSet.add(listenerSetKey)); } else throw Error(formatProdErrorMessage(369)); } +function flushSyncImpl(fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = Internals.p; + try { + if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (Internals.p = previousUpdatePriority), + Internals.d.f(); + } +} +function flushSyncErrorInBuildsThatSupportLegacyMode() { + throw Error( + "Expected this build of React to not support legacy mode but it does. This is a bug in React." + ); +} +var flushSync$1 = disableLegacyMode + ? flushSyncImpl + : flushSyncErrorInBuildsThatSupportLegacyMode; function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1750 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1769 = React.version; if ( - "19.0.0-www-classic-f0e8164410-20240614" !== - isomorphicReactPackageVersion$jscomp$inline_1750 + "19.0.0-www-classic-88959fd54a-20240614" !== + isomorphicReactPackageVersion$jscomp$inline_1769 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1750, - "19.0.0-www-classic-f0e8164410-20240614" + isomorphicReactPackageVersion$jscomp$inline_1769, + "19.0.0-www-classic-88959fd54a-20240614" ) ); +function flushSyncFromReconciler(fn) { + a: { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + 0 !== (executionContext & 6) || + flushPassiveEffects(); + var prevExecutionContext = executionContext; + executionContext |= 1; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + Internals.p = 2; + ReactSharedInternals.T = null; + var JSCompiler_inline_result = fn ? fn() : void 0; + break a; + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + (executionContext = prevExecutionContext), + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); + } + JSCompiler_inline_result = void 0; + } + return JSCompiler_inline_result; +} +var flushSync = disableLegacyMode ? flushSync$1 : flushSyncFromReconciler; Internals.findDOMNode = function (componentOrElement) { return findHostInstance(componentOrElement); }; @@ -16810,17 +17204,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1752 = { +var devToolsConfig$jscomp$inline_1776 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2229 = { - bundleType: devToolsConfig$jscomp$inline_1752.bundleType, - version: devToolsConfig$jscomp$inline_1752.version, - rendererPackageName: devToolsConfig$jscomp$inline_1752.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1752.rendererConfig, +var internals$jscomp$inline_2220 = { + bundleType: devToolsConfig$jscomp$inline_1776.bundleType, + version: devToolsConfig$jscomp$inline_1776.version, + rendererPackageName: devToolsConfig$jscomp$inline_1776.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1776.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16836,26 +17230,26 @@ var internals$jscomp$inline_2229 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1752.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1776.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2230 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2230.isDisabled && - hook$jscomp$inline_2230.supportsFiber + !hook$jscomp$inline_2221.isDisabled && + hook$jscomp$inline_2221.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2230.inject( - internals$jscomp$inline_2229 + (rendererID = hook$jscomp$inline_2221.inject( + internals$jscomp$inline_2220 )), - (injectedHook = hook$jscomp$inline_2230); + (injectedHook = hook$jscomp$inline_2221); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -16865,9 +17259,7 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) { var root = this._internalRoot; if (null === root) throw Error(formatProdErrorMessage(409)); - var current = root.current, - lane = requestUpdateLane(); - updateContainerImpl(current, lane, children, root, null, null); + updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () { @@ -16875,8 +17267,7 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); - updateContainerImpl(root.current, 2, null, root, null, null); + updateContainerSync(null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -16920,6 +17311,105 @@ function wwwOnCaughtError(error, errorInfo) { null != errorInfo.componentStack ? errorInfo.componentStack : "" }) && defaultOnCaughtError(error); } +function noopOnRecoverableError() {} +function legacyCreateRootFromDOMContainer( + container, + initialChildren, + parentComponent, + callback, + isHydrationContainer +) { + if (isHydrationContainer) { + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root$323); + originalCallback.call(instance); + }; + } + var root$323 = createHydrationContainer( + initialChildren, + callback, + container, + 0, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$323; + container[internalContainerInstanceKey] = root$323.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + flushSyncWork$1(); + return root$323; + } + clearContainer(container); + if ("function" === typeof callback) { + var originalCallback$324 = callback; + callback = function () { + var instance = getPublicRootInstance(root$325); + originalCallback$324.call(instance); + }; + } + var root$325 = createFiberRoot( + container, + 0, + !1, + null, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$325; + container[internalContainerInstanceKey] = root$325.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + updateContainerSync(initialChildren, root$325, parentComponent, callback); + flushSyncWork$1(); + return root$325; +} +function legacyRenderSubtreeIntoContainer( + parentComponent, + children, + container, + forceHydrate, + callback +) { + var maybeRoot = container._reactRootContainer; + if (maybeRoot) { + var root = maybeRoot; + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + updateContainer(children, root, parentComponent, callback); + } else + root = legacyCreateRootFromDOMContainer( + container, + children, + parentComponent, + callback, + forceHydrate + ); + return getPublicRootInstance(root); +} assign(Internals, { ReactBrowserEventEmitter: { isEnabled: function () { @@ -16990,17 +17480,7 @@ exports.findDOMNode = function (componentOrElement) { ? componentOrElement : findHostInstance(componentOrElement); }; -exports.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f(); - } -}; +exports.flushSync = flushSync; exports.hydrateRoot = function (container, initialChildren, options) { options = assign( { onUncaughtError: wwwOnUncaughtError, onCaughtError: wwwOnCaughtError }, @@ -17030,11 +17510,11 @@ exports.hydrateRoot = function (container, initialChildren, options) { void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState)); - initialChildren = createFiberRoot( + initialChildren = createHydrationContainer( + initialChildren, + null, container, 1, - !0, - initialChildren, null != options ? options : null, isStrictMode, concurrentUpdatesByDefaultOverride, @@ -17045,15 +17525,6 @@ exports.hydrateRoot = function (container, initialChildren, options) { transitionCallbacks, formState ); - initialChildren.context = getContextForSubtree(null); - options = initialChildren.current; - isStrictMode = requestUpdateLane(); - concurrentUpdatesByDefaultOverride = createUpdate(isStrictMode); - concurrentUpdatesByDefaultOverride.callback = null; - enqueueUpdate(options, concurrentUpdatesByDefaultOverride, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); - ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); @@ -17166,18 +17637,34 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.render = function () { - throw Error(formatProdErrorMessage(509)); +exports.render = function (element, container, callback) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return legacyRenderSubtreeIntoContainer( + null, + element, + container, + !1, + callback + ); }; exports.requestFormReset = function (form) { Internals.d.r(form); }; -exports.unmountComponentAtNode = function () { - throw Error(formatProdErrorMessage(509)); -}; -exports.unstable_batchedUpdates = function (fn, a) { - return fn(a); +exports.unmountComponentAtNode = function (container) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return container._reactRootContainer + ? (updateContainerSync(null, container._reactRootContainer, null, null), + flushSyncWork$1(), + (container._reactRootContainer = null), + (container[internalContainerInstanceKey] = null), + !0) + : !1; }; +exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_createEventHandle = function (type, options) { function eventHandle(target, callback) { if ("function" !== typeof callback) @@ -17214,4 +17701,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 13d0f19648..af45d31924 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -16469,14 +16469,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1740 = React.version; if ( - "19.0.0-www-modern-f0e8164410-20240614" !== + "19.0.0-www-modern-88959fd54a-20240614" !== isomorphicReactPackageVersion$jscomp$inline_1740 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1740, - "19.0.0-www-modern-f0e8164410-20240614" + "19.0.0-www-modern-88959fd54a-20240614" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16495,7 +16495,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1742 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2211 = { @@ -16525,7 +16525,7 @@ var internals$jscomp$inline_2211 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2212 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16896,4 +16896,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 388e49a6c3..ff5bcec373 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -66,6 +66,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -203,6 +204,9 @@ function getComponentNameFromFiber(fiber) { return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -1683,6 +1687,10 @@ function isContextProvider(type) { type = type.childContextTypes; return null !== type && void 0 !== type; } +function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor); +} function pushTopLevelContextObject(fiber, context, didChange) { if (contextStackCursor.current !== emptyContextObject) throw Error(formatProdErrorMessage(168)); @@ -2062,7 +2070,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { do { var didPerformSomeWork = !1; for (var root$29 = firstScheduledRoot; null !== root$29; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root$29.tag)) { var workInProgressRootRenderLanes$31 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$31 = getNextLanes( root$29, @@ -3294,7 +3302,15 @@ function createChildReconciler(shouldTrackSideEffects) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -4376,7 +4392,7 @@ function refreshCache(fiber, seedKey, seedValue) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(); + var lane = requestUpdateLane(provider); fiber = createUpdate(lane); var root$80 = enqueueUpdate(provider, fiber, lane); null !== root$80 && @@ -4394,7 +4410,7 @@ function refreshCache(fiber, seedKey, seedValue) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); + var lane = requestUpdateLane(fiber); action = { lane: lane, revertLane: 0, @@ -4412,7 +4428,7 @@ function dispatchReducerAction(fiber, queue, action) { enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), update = { lane: lane, revertLane: 0, @@ -4902,7 +4918,7 @@ var classComponentUpdater = { }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.payload = payload; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4914,7 +4930,7 @@ var classComponentUpdater = { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -4927,7 +4943,7 @@ var classComponentUpdater = { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 2; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4958,6 +4974,33 @@ function checkShouldComponentUpdate( ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; +} function callComponentWillReceiveProps( workInProgress, instance, @@ -4972,6 +5015,41 @@ 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; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} function resolveClassComponentProps( Component, baseProps, @@ -5107,6 +5185,36 @@ function initializeClassErrorUpdate(update, root, fiber, errorInfo) { }); }); } +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; +} function throwException( root, returnFiber, @@ -5121,71 +5229,100 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = 3); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - throw Error(formatProdErrorMessage(435, sourceFiber.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && ((root = Error(formatProdErrorMessage(422), { cause: value })), queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) @@ -5200,10 +5337,10 @@ function throwException( (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -5211,54 +5348,62 @@ function throwException( (workInProgressRootExitStatus = 2)), !1 ); - var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); - wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wrapperError]) - : workInProgressRootConcurrentErrors.push(wrapperError); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), - (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), - enqueueCapturedUpdate(sourceFiber, root), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (wrapperError = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== wrapperError && - "function" === typeof wrapperError.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5368,10 +5513,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$98 = workInProgress.stateNode; + root$99 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$98.incompleteTransitions.has(transition)) { + if (!root$99.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5379,11 +5524,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$98.incompleteTransitions.set(transition, markerInstance); + root$99.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$98.incompleteTransitions.forEach(function (markerInstance) { + root$99.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5561,28 +5706,36 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -5716,7 +5869,7 @@ function replayFunctionComponent( return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -5727,123 +5880,47 @@ function updateClassComponent( pushContextProvider(workInProgress); } else hasContext = !1; prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = Component.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - var instance = new Component(nextProps, context); - workInProgress.memoizedState = - null !== instance.state && void 0 !== instance.state - ? instance.state - : null; - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - instance._reactInternals = workInProgress; - isLegacyContextConsumer && - ((isLegacyContextConsumer = workInProgress.stateNode), - (isLegacyContextConsumer.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (isLegacyContextConsumer.__reactInternalMemoizedMaskedChildContext = - context)); - unmaskedContext = workInProgress.stateNode; - unmaskedContext.props = nextProps; - unmaskedContext.state = workInProgress.memoizedState; - unmaskedContext.refs = {}; - initializeUpdateQueue(workInProgress); - isLegacyContextConsumer = Component.contextType; - "object" === typeof isLegacyContextConsumer && - null !== isLegacyContextConsumer - ? (unmaskedContext.context = readContext(isLegacyContextConsumer)) - : ((isLegacyContextConsumer = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (unmaskedContext.context = getMaskedContext( - workInProgress, - isLegacyContextConsumer - ))); - unmaskedContext.state = workInProgress.memoizedState; - isLegacyContextConsumer = Component.getDerivedStateFromProps; - "function" === typeof isLegacyContextConsumer && - (applyDerivedStateFromProps( - 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, - isLegacyContextConsumer, - nextProps - ), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ((isLegacyContextConsumer = unmaskedContext.state), - "function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount(), - isLegacyContextConsumer !== unmaskedContext.state && - classComponentUpdater.enqueueReplaceState( - unmaskedContext, - unmaskedContext.state, - null - ), - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ), - suspendIfUpdateReadFromEntangledAsyncAction(), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof unmaskedContext.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current$jscomp$0) { - unmaskedContext = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - isLegacyContextConsumer = resolveClassComponentProps( - Component, - unresolvedOldProps, - workInProgress.type === workInProgress.elementType - ); - unmaskedContext.props = isLegacyContextConsumer; - var oldContext = unmaskedContext.context; - context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) + unresolvedOldProps, + workInProgress.type === workInProgress.elementType + ); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current), - (context = getMaskedContext(workInProgress, context))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - instance = - "function" === typeof getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate; + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - instance || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== context) && + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, - context + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - unmaskedContext.state = oldState; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || @@ -5858,50 +5935,49 @@ function updateClassComponent( nextProps ), (oldContext = workInProgress.memoizedState)), - (isLegacyContextConsumer = + (oldProps = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - isLegacyContextConsumer, + oldProps, nextProps, oldState, oldContext, - context + contextType )) - ? (instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ("function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount()), - "function" === typeof unmaskedContext.componentDidMount && + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof unmaskedContext.componentDidMount && + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = oldContext), - (unmaskedContext.context = context), - (nextProps = isLegacyContextConsumer)) - : ("function" === typeof unmaskedContext.componentDidMount && + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - unmaskedContext = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - isLegacyContextConsumer = workInProgress.memoizedProps; - context = resolveClassComponentProps( + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( Component, - isLegacyContextConsumer, + oldProps, workInProgress.type === workInProgress.elementType ); - unmaskedContext.props = context; - instance = workInProgress.pendingProps; - unresolvedOldProps = unmaskedContext.context; + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; oldContext = Component.contextType; "object" === typeof oldContext && null !== oldContext ? (oldContext = readContext(oldContext)) @@ -5912,31 +5988,30 @@ function updateClassComponent( oldState = Component.getDerivedStateFromProps; (getDerivedStateFromProps = "function" === typeof oldState || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate) || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((isLegacyContextConsumer !== instance || - unresolvedOldProps !== oldContext) && + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, oldContext )); hasForceUpdate = !1; unresolvedOldProps = workInProgress.memoizedState; - unmaskedContext.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - isLegacyContextConsumer !== instance || + oldProps !== hasNewLifecycles || unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && (applyDerivedStateFromProps( workInProgress, @@ -5945,109 +6020,124 @@ function updateClassComponent( nextProps ), (newState = workInProgress.memoizedState)), - (context = + (contextType = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + contextType, nextProps, unresolvedOldProps, newState, oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillUpdate && - "function" !== typeof unmaskedContext.componentWillUpdate) || - ("function" === typeof unmaskedContext.componentWillUpdate && - unmaskedContext.componentWillUpdate( - nextProps, - newState, - oldContext - ), - "function" === - typeof unmaskedContext.UNSAFE_componentWillUpdate && - unmaskedContext.UNSAFE_componentWillUpdate( + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( nextProps, newState, oldContext )), - "function" === typeof unmaskedContext.componentDidUpdate && + "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate && + "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = newState), - (unmaskedContext.context = oldContext), - (nextProps = context)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - unmaskedContext = nextProps; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { markRef(current$jscomp$0, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - unmaskedContext || nextProps - ? ((unmaskedContext = workInProgress.stateNode), - (current = workInProgress), - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? ((isLegacyContextConsumer = null), (profilerStartTime = -1)) - : (enableSchedulingProfiler && - markComponentRenderStarted(workInProgress), - (isLegacyContextConsumer = unmaskedContext.render()), - enableSchedulingProfiler && markComponentRenderStopped()), - (workInProgress.flags |= 1), - null !== current$jscomp$0 && nextProps - ? ((nextProps = isLegacyContextConsumer), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - isLegacyContextConsumer, - renderLanes - ), - (workInProgress.memoizedState = unmaskedContext.state), - hasContext && invalidateContextProvider(workInProgress, Component, !0), - (current$jscomp$0 = workInProgress.child)) - : (hasContext && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( current$jscomp$0, workInProgress, renderLanes - ))); - return current$jscomp$0; + ) + ); + shouldUpdate = workInProgress.stateNode; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else + enableSchedulingProfiler && markComponentRenderStarted(workInProgress), + (nextChildren = shouldUpdate.render()), + enableSchedulingProfiler && markComponentRenderStopped(); + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -6185,18 +6275,18 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = showFallback.updateQueue), - null === renderLanes + (current = showFallback.updateQueue), + null === current ? (showFallback.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -6245,9 +6335,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { : (reuseSuspenseHandlerOnStack(workInProgress), (showFallback = nextProps.fallback), (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - nextInstance + nextInstance, + 0, + null )), (showFallback = createFiberFromFragment( showFallback, @@ -6260,12 +6352,13 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (showFallback.return = workInProgress), (nextProps.sibling = showFallback), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), (nextProps.childLanes = getRemainingWorkInPrimaryTree( @@ -6370,7 +6463,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { )), (nextInstance._reactRetry = workInProgress), (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), (nextHydratableInstance = getNextHydratable( nextInstance.nextSibling )), @@ -6378,12 +6471,12 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (isHydrating = !0), (hydrationErrors = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && ((idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, @@ -6399,12 +6492,27 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextInstance = workInProgress.mode), (JSCompiler_temp$jscomp$0 = current.child), (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + (didSuspend = { mode: "hidden", children: nextProps.children }), + disableLegacyMode || + 0 !== (nextInstance & 1) || + workInProgress.child === JSCompiler_temp$jscomp$0 + ? ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + workInProgress.mode & 2 && + ((nextProps.actualDuration = 0), + (nextProps.actualStartTime = -1), + (nextProps.selfBaseDuration = + JSCompiler_temp$jscomp$0.selfBaseDuration), + (nextProps.treeBaseDuration = + JSCompiler_temp$jscomp$0.treeBaseDuration)), + (workInProgress.deletions = null)), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -6469,27 +6577,32 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps ); pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -6500,26 +6613,35 @@ function mountSuspenseFallbackChildren( fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || 0 !== (mode & 1) || null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = 0), + (progressedPrimaryFragment.actualStartTime = -1), + (progressedPrimaryFragment.selfBaseDuration = 0), + (progressedPrimaryFragment.treeBaseDuration = 0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); -} function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -6597,57 +6719,68 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) { nextProps &= 1; } push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 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; @@ -6825,11 +6958,12 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: + var elementType = workInProgress.elementType; a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); var props = workInProgress.pendingProps; - current = workInProgress.elementType; - var init = current._init; - current = init(current._payload); + current = elementType._init; + current = current(elementType._payload); workInProgress.type = current; if ("function" === typeof current) shouldConstruct(current) @@ -6855,7 +6989,10 @@ function beginWork(current, workInProgress, renderLanes) { ))); else { if (void 0 !== current && null !== current) - if (((init = current.$$typeof), init === REACT_FORWARD_REF_TYPE)) { + if ( + ((elementType = current.$$typeof), + elementType === REACT_FORWARD_REF_TYPE) + ) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6868,7 +7005,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); break a; - } else if (init === REACT_MEMO_TYPE) { + } else if (elementType === REACT_MEMO_TYPE) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6891,37 +7028,43 @@ function beginWork(current, workInProgress, renderLanes) { case 0: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), updateFunctionComponent( current, workInProgress, props, - init, + elementType, renderLanes ) ); case 1: return ( (props = workInProgress.type), - (init = resolveClassComponentProps( + (elementType = resolveClassComponentProps( props, workInProgress.pendingProps, workInProgress.elementType === props )), - updateClassComponent(current, workInProgress, props, init, renderLanes) + updateClassComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 3: a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - props = init.element; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6930,19 +7073,19 @@ function beginWork(current, workInProgress, renderLanes) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); nextProps = nextState.cache; pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); nextProps = nextState.element; - if (init.isDehydrated) + if (elementType.isDehydrated) if ( - ((init = { + ((elementType = { element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { workInProgress = mountHostRootWithoutHydrating( @@ -7059,7 +7202,7 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = props = nextHydratableInstance)) + if ((elementType = props = nextHydratableInstance)) (props = canHydrateInstance( props, workInProgress.type, @@ -7071,22 +7214,22 @@ function beginWork(current, workInProgress, renderLanes) { (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable(props.firstChild)), (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); + (elementType = !0)) + : (elementType = !1); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); - init = workInProgress.type; + elementType = workInProgress.type; nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; props = nextProps.children; - shouldSetTextContent(init, nextProps) + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && - shouldSetTextContent(init, nextState) && + shouldSetTextContent(elementType, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((elementType = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -7094,11 +7237,11 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = init), + (HostTransitionContext._currentValue = elementType), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== elementType && propagateContextChange( workInProgress, HostTransitionContext, @@ -7146,13 +7289,19 @@ function beginWork(current, workInProgress, renderLanes) { case 11: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - updateForwardRef(current, workInProgress, props, init, renderLanes) + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + updateForwardRef( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 7: return ( @@ -7193,14 +7342,14 @@ function beginWork(current, workInProgress, renderLanes) { props = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + elementType = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextState = init.value; + nextState = elementType.value; pushProvider(workInProgress, props, nextState); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextState)) { if ( - nextProps.children === init.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7211,20 +7360,25 @@ function beginWork(current, workInProgress, renderLanes) { break a; } } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), + (elementType = readContext(elementType)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), - (props = props(init)), + (props = props(elementType)), enableSchedulingProfiler && markComponentRenderStopped(), (workInProgress.flags |= 1), reconcileChildren(current, workInProgress, props, renderLanes), @@ -7233,14 +7387,20 @@ function beginWork(current, workInProgress, renderLanes) { case 14: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props.type, init)), - updateMemoComponent(current, workInProgress, props, init, renderLanes) + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props.type, elementType)), + updateMemoComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -7250,6 +7410,47 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(props) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, props, elementType); + mountClassInstance(workInProgress, props, elementType, renderLanes); + return finishClassComponent( + null, + workInProgress, + props, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + props, + elementType, + renderLanes + ); case 19: return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: @@ -7268,34 +7469,38 @@ function beginWork(current, workInProgress, renderLanes) { prepareToReadContext(workInProgress, renderLanes), (props = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((elementType = peekCacheFromPool()), + null === elementType && + ((elementType = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (elementType.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: props, cache: init }), + null !== nextProps && + (elementType.pooledCacheLanes |= renderLanes), + (elementType = nextProps)), + (workInProgress.memoizedState = { + parent: props, + cache: elementType + }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, elementType)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (elementType = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== props - ? ((init = { parent: props, cache: props }), - (workInProgress.memoizedState = init), + elementType.parent !== props + ? ((elementType = { parent: props, cache: props }), + (workInProgress.memoizedState = elementType), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), + elementType), pushProvider(workInProgress, CacheContext, props)) : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), - props !== init.cache && + props !== elementType.cache && propagateContextChange( workInProgress, CacheContext, @@ -7830,14 +8035,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$135 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$135 = lastTailNode), + for (var lastTailNode$143 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$143 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$135 + null === lastTailNode$143 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$135.sibling = null); + : (lastTailNode$143.sibling = null); } } function bubbleProperties(completedWork) { @@ -7849,53 +8054,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$137 = completedWork.selfBaseDuration, - child$138 = completedWork.child; - null !== child$138; + var treeBaseDuration$145 = completedWork.selfBaseDuration, + child$146 = completedWork.child; + null !== child$146; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags & 31457280), - (subtreeFlags |= child$138.flags & 31457280), - (treeBaseDuration$137 += child$138.treeBaseDuration), - (child$138 = child$138.sibling); - completedWork.treeBaseDuration = treeBaseDuration$137; + (newChildLanes |= child$146.lanes | child$146.childLanes), + (subtreeFlags |= child$146.subtreeFlags & 31457280), + (subtreeFlags |= child$146.flags & 31457280), + (treeBaseDuration$145 += child$146.treeBaseDuration), + (child$146 = child$146.sibling); + completedWork.treeBaseDuration = treeBaseDuration$145; } else for ( - treeBaseDuration$137 = completedWork.child; - null !== treeBaseDuration$137; + treeBaseDuration$145 = completedWork.child; + null !== treeBaseDuration$145; ) (newChildLanes |= - treeBaseDuration$137.lanes | treeBaseDuration$137.childLanes), - (subtreeFlags |= treeBaseDuration$137.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$137.flags & 31457280), - (treeBaseDuration$137.return = completedWork), - (treeBaseDuration$137 = treeBaseDuration$137.sibling); + treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), + (subtreeFlags |= treeBaseDuration$145.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$145.flags & 31457280), + (treeBaseDuration$145.return = completedWork), + (treeBaseDuration$145 = treeBaseDuration$145.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$137 = completedWork.actualDuration; - child$138 = completedWork.selfBaseDuration; + treeBaseDuration$145 = completedWork.actualDuration; + child$146 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$137 += child.actualDuration), - (child$138 += child.treeBaseDuration), + (treeBaseDuration$145 += child.actualDuration), + (child$146 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$137; - completedWork.treeBaseDuration = child$138; + completedWork.actualDuration = treeBaseDuration$145; + completedWork.treeBaseDuration = child$146; } else for ( - treeBaseDuration$137 = completedWork.child; - null !== treeBaseDuration$137; + treeBaseDuration$145 = completedWork.child; + null !== treeBaseDuration$145; ) (newChildLanes |= - treeBaseDuration$137.lanes | treeBaseDuration$137.childLanes), - (subtreeFlags |= treeBaseDuration$137.subtreeFlags), - (subtreeFlags |= treeBaseDuration$137.flags), - (treeBaseDuration$137.return = completedWork), - (treeBaseDuration$137 = treeBaseDuration$137.sibling); + treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), + (subtreeFlags |= treeBaseDuration$145.subtreeFlags), + (subtreeFlags |= treeBaseDuration$145.flags), + (treeBaseDuration$145.return = completedWork), + (treeBaseDuration$145 = treeBaseDuration$145.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7904,6 +8109,8 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -7916,8 +8123,7 @@ function completeWork(current, workInProgress, renderLanes) { return bubbleProperties(workInProgress), null; case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null ); @@ -8207,11 +8413,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$153 = null; + var cache$161 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$153 = newProps.memoizedState.cachePool.pool); - cache$153 !== type && (newProps.flags |= 2048); + (cache$161 = newProps.memoizedState.cachePool.pool); + cache$161 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8245,13 +8451,18 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor); type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$153 = type.rendering; - if (null === cache$153) + cache$161 = type.rendering; + if (null === cache$161) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8259,11 +8470,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$153 = findFirstSuspended(current); - if (null !== cache$153) { + cache$161 = findFirstSuspended(current); + if (null !== cache$161) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$153.updateQueue; + current = cache$161.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8288,7 +8499,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$153)), null !== current)) { + if (((current = findFirstSuspended(cache$161)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8298,7 +8509,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$153.alternate && + !cache$161.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8311,13 +8522,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$153.sibling = workInProgress.child), - (workInProgress.child = cache$153)) + ? ((cache$161.sibling = workInProgress.child), + (workInProgress.child = cache$161)) : ((current = type.last), null !== current - ? (current.sibling = cache$153) - : (workInProgress.child = cache$153), - (type.last = cache$153)); + ? (current.sibling = cache$161) + : (workInProgress.child = cache$161), + (type.last = cache$161)); } if (null !== type.tail) return ( @@ -8358,14 +8569,14 @@ function completeWork(current, workInProgress, renderLanes) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -8401,6 +8612,8 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error(formatProdErrorMessage(156, workInProgress.tag)); } @@ -8409,8 +8622,7 @@ function unwindWork(current, workInProgress) { switch (workInProgress.tag) { case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), @@ -8499,9 +8711,7 @@ function unwindInterruptedWork(current, interruptedWork) { switch (interruptedWork.tag) { case 1: current = interruptedWork.type.childContextTypes; - null !== current && - void 0 !== current && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)); + null !== current && void 0 !== current && popContext(); break; case 3: popProvider(CacheContext); @@ -8633,8 +8843,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$170) { - captureCommitPhaseError(current, nearestMountedAncestor, error$170); + } catch (error$179) { + captureCommitPhaseError(current, nearestMountedAncestor, error$179); } else ref.current = null; } @@ -8671,7 +8881,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$240) { + } catch (e$249) { JSCompiler_temp = null; break a; } @@ -8803,21 +9013,8 @@ function commitBeforeMutationEffects(root, firstChild) { } break; case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } - } + 0 !== (flags & 1024) && + clearContainer(firstChild.stateNode.containerInfo); break; case 5: case 26: @@ -8942,11 +9139,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$172 = commitTime, + var commitTime$181 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$172); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$181); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -8973,8 +9170,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$174) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$174); + } catch (error$183) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$183); } } function commitClassCallbacks(finishedWork) { @@ -9073,11 +9270,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$175) { + } catch (error$184) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$175 + error$184 ); } else { @@ -9095,11 +9292,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$176) { + } catch (error$185) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$176 + error$185 ); } recordLayoutEffectDuration(finishedWork); @@ -9110,11 +9307,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$177) { + } catch (error$186) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$177 + error$186 ); } } @@ -9160,25 +9357,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevProps) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -9646,15 +9848,21 @@ function commitDeletionEffectsOnFiber( break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -9666,19 +9874,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$191 = finishedWork.alternate; + var current$200 = finishedWork.alternate; if ( - null !== current$191 && - ((current$191 = current$191.memoizedState), - null !== current$191 && - ((current$191 = current$191.dehydrated), null !== current$191)) + null !== current$200 && + ((current$200 = current$200.memoizedState), + null !== current$200 && + ((current$200 = current$200.dehydrated), null !== current$200)) ) try { - retryIfBlockedOn(current$191); + retryIfBlockedOn(current$200); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$191); + onHydrated && onHydrated(current$200); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9810,22 +10018,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$193) { + } catch (error$202) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$193 + error$202 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$194) { + } catch (error$203) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$194 + error$203 ); } } @@ -9999,11 +10207,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$195) { + } catch (error$204) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$195 + error$204 ); } break; @@ -10040,8 +10248,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$196) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$196); + } catch (error$205) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$205); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -10051,8 +10259,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$198) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$198); + } catch (error$207) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$207); } } flags & 1024 && (needsFormReset = !0); @@ -10067,8 +10275,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$199) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$199); + } catch (error$208) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$208); } } break; @@ -10082,8 +10290,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$200) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$200); + } catch (error$209) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$209); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -10115,8 +10323,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$202) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$202); + } catch (error$211) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$211); } flags = finishedWork.updateQueue; null !== flags && @@ -10130,13 +10338,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + disableLegacyMode || finishedWork.mode & 1 + ? ((suspenseCallback = offscreenSubtreeIsHidden), + (retryQueue = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = suspenseCallback || domElement), + (offscreenSubtreeWasHidden = retryQueue || newProps), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = retryQueue), + (offscreenSubtreeIsHidden = suspenseCallback)) + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -10152,7 +10362,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null === current || newProps || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -10191,11 +10402,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$182) { + } catch (error$191) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$182 + error$191 ); } } else if ( @@ -10270,21 +10481,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$183 = JSCompiler_inline_result.stateNode; + var parent$192 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$183, ""), + (setTextContent(parent$192, ""), (JSCompiler_inline_result.flags &= -33)); - var before$184 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$184, parent$183); + var before$193 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$193, parent$192); break; case 3: case 4: - var parent$185 = JSCompiler_inline_result.stateNode.containerInfo, - before$186 = getHostSibling(finishedWork); + var parent$194 = JSCompiler_inline_result.stateNode.containerInfo, + before$195 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$186, - parent$185 + before$195, + parent$194 ); break; default: @@ -10376,7 +10587,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$206 = parentFiber.alternate, + var current$215 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10404,16 +10615,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$206 = finishedWork.updateQueue; - if (null !== current$206) { - var hiddenCallbacks = current$206.shared.hiddenCallbacks; + current$215 = finishedWork.updateQueue; + if (null !== current$215) { + var hiddenCallbacks = current$215.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$206.shared.hiddenCallbacks = null, current$206 = 0; - current$206 < hiddenCallbacks.length; - current$206++ + current$215.shared.hiddenCallbacks = null, current$215 = 0; + current$215 < hiddenCallbacks.length; + current$215++ ) - callCallback(hiddenCallbacks[current$206], finishedRoot); + callCallback(hiddenCallbacks[current$215], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10429,7 +10640,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$206 && + null === current$215 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10442,7 +10653,7 @@ function recursivelyTraverseReappearLayoutEffects( ); includeWorkInProgressEffects && flags & 4 && - commitProfilerUpdate(finishedWork, current$206); + commitProfilerUpdate(finishedWork, current$215); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -10485,8 +10696,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$207) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$207); + } catch (error$216) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$216); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -10679,7 +10890,15 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10777,9 +10996,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$214 = finishedWork.stateNode; + var instance$223 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$214._visibility & 4 + ? instance$223._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10787,11 +11006,20 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) - : ((instance$214._visibility |= 4), + : ((instance$223._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$223._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10804,7 +11032,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$214 + instance$223 ); break; case 24: @@ -11245,14 +11473,16 @@ var legacyErrorBoundariesThatAlreadyFailed = null, pendingPassiveTransitions = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; -function requestUpdateLane() { - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== ReactSharedInternals.T) { - var actionScopeLane = currentEntangledLane; - return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); - } - return resolveUpdatePriority(); +function requestUpdateLane(fiber) { + fiber = fiber.mode; + return disableLegacyMode || 0 !== (fiber & 1) + ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : resolveUpdatePriority() + : 2; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -11278,20 +11508,21 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { isDevToolsPresent && addFiberToLanesMap(root, fiber, lane); - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now$1()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index$14 = 31 - clz32(lane), - transitions = transitionLanesMap[index$14]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index$14] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now$1()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$14 = 31 - clz32(lane), + transitions = transitionLanesMap[index$14]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$14] = transitions; + } } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -11303,6 +11534,12 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + 0 !== executionContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ((workInProgressRootRenderTargetTime = now$1() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -11571,7 +11808,7 @@ function performSyncWorkOnRoot(root, lanes) { currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { + if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -11610,6 +11847,19 @@ function performSyncWorkOnRoot(root, lanes) { ensureRootIsScheduled(root); return null; } +function batchedUpdates$1(fn, a) { + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + 0 === executionContext && + ((workInProgressRootRenderTargetTime = now$1() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } +} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(!1), !1) @@ -11812,8 +12062,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$225) { - handleThrow(root, thrownValue$225); + } catch (thrownValue$234) { + handleThrow(root, thrownValue$234); } while (1); lanes && root.shellSuspendCounter++; @@ -11933,8 +12183,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$227) { - handleThrow(root, thrownValue$227); + } catch (thrownValue$236) { + handleThrow(root, thrownValue$236); } while (1); resetContextDependencies(); @@ -12109,23 +12359,23 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - var current$231 = completedWork.alternate; + var current$240 = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) - ? (current$231 = completeWork( - current$231, + ? (current$240 = completeWork( + current$240, completedWork, entangledRenderLanes )) : (startProfilerTimer(completedWork), - (current$231 = completeWork( - current$231, + (current$240 = completeWork( + current$240, completedWork, entangledRenderLanes )), stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); - if (null !== current$231) { - workInProgress = current$231; + if (null !== current$240) { + workInProgress = current$240; return; } completedWork = completedWork.sibling; @@ -12214,13 +12464,13 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$233 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$242 = commitBeforeMutationEffects( root, finishedWork ); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$233 && + shouldFireAfterActiveInstanceBlur$242 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -12264,7 +12514,9 @@ function commitRootImpl( renderPriorityLevel(remainingLanes.value, { componentStack: remainingLanes.stack }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -12303,7 +12555,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$234 = rootWithPendingPassiveEffects, + var root$243 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12318,7 +12570,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$234, remainingLanes); + releaseRootPooledCache(root$243, remainingLanes); } } return !1; @@ -12470,7 +12722,10 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -12662,10 +12917,12 @@ function createFiberFromTypeAndProps( return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -12836,7 +13093,7 @@ function FiberRootNode( onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -12914,11 +13171,13 @@ function createFiberRoot( containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isDevToolsPresent && (hydrationCallbacks |= 2); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isDevToolsPresent && (tag |= 2); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -12993,6 +13252,73 @@ function findHostInstance(component) { component = findCurrentHostFiber(fiber); return null === component ? null : component.stateNode; } +function createHydrationContainer( + initialChildren, + callback, + containerInfo, + tag, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState +) { + initialChildren = createFiberRoot( + containerInfo, + tag, + !0, + initialChildren, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ); + initialChildren.context = getContextForSubtree(null); + containerInfo = initialChildren.current; + tag = requestUpdateLane(containerInfo); + hydrationCallbacks = createUpdate(tag); + hydrationCallbacks.callback = + void 0 !== callback && null !== callback ? callback : null; + enqueueUpdate(containerInfo, hydrationCallbacks, tag); + initialChildren.current.lanes = tag; + markRootUpdated(initialChildren, tag); + ensureRootIsScheduled(initialChildren); + return initialChildren; +} +function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; +} +function updateContainerSync(element, container, parentComponent, callback) { + 0 === container.tag && flushPassiveEffects(); + updateContainerImpl( + container.current, + 2, + element, + container, + parentComponent, + callback + ); + return 2; +} function updateContainerImpl( rootFiber, lane, @@ -13019,6 +13345,17 @@ function updateContainerImpl( (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane)); } +function getPublicRootInstance(container) { + container = container.current; + if (!container.child) return null; + switch (container.child.tag) { + case 27: + case 5: + return container.child.stateNode; + default: + return container.child.stateNode; + } +} function markRetryLaneImpl(fiber, retryLane) { fiber = fiber.memoizedState; if (null !== fiber && null !== fiber.dehydrated) { @@ -13045,7 +13382,7 @@ function batchedUpdates(fn, a, b) { if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; try { - return fn(a); + return batchedUpdates$1(fn, a, b); } finally { if ( ((isInsideEventHandler = !1), @@ -13576,19 +13913,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$390; + var JSCompiler_inline_result$jscomp$406; if (canUseDOM) { - var isSupported$jscomp$inline_1623 = "oninput" in document; - if (!isSupported$jscomp$inline_1623) { - var element$jscomp$inline_1624 = document.createElement("div"); - element$jscomp$inline_1624.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1623 = - "function" === typeof element$jscomp$inline_1624.oninput; + var isSupported$jscomp$inline_1642 = "oninput" in document; + if (!isSupported$jscomp$inline_1642) { + var element$jscomp$inline_1643 = document.createElement("div"); + element$jscomp$inline_1643.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1642 = + "function" === typeof element$jscomp$inline_1643.oninput; } - JSCompiler_inline_result$jscomp$390 = isSupported$jscomp$inline_1623; - } else JSCompiler_inline_result$jscomp$390 = !1; + JSCompiler_inline_result$jscomp$406 = isSupported$jscomp$inline_1642; + } else JSCompiler_inline_result$jscomp$406 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$390 && + JSCompiler_inline_result$jscomp$406 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13997,20 +14334,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1664 = 0; - i$jscomp$inline_1664 < simpleEventPluginEvents.length; - i$jscomp$inline_1664++ + var i$jscomp$inline_1683 = 0; + i$jscomp$inline_1683 < simpleEventPluginEvents.length; + i$jscomp$inline_1683++ ) { - var eventName$jscomp$inline_1665 = - simpleEventPluginEvents[i$jscomp$inline_1664], - domEventName$jscomp$inline_1666 = - eventName$jscomp$inline_1665.toLowerCase(), - capitalizedEvent$jscomp$inline_1667 = - eventName$jscomp$inline_1665[0].toUpperCase() + - eventName$jscomp$inline_1665.slice(1); + var eventName$jscomp$inline_1684 = + simpleEventPluginEvents[i$jscomp$inline_1683], + domEventName$jscomp$inline_1685 = + eventName$jscomp$inline_1684.toLowerCase(), + capitalizedEvent$jscomp$inline_1686 = + eventName$jscomp$inline_1684[0].toUpperCase() + + eventName$jscomp$inline_1684.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1666, - "on" + capitalizedEvent$jscomp$inline_1667 + domEventName$jscomp$inline_1685, + "on" + capitalizedEvent$jscomp$inline_1686 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15493,14 +15830,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$269 in nextProps) { - var propKey = nextProps[propKey$269]; - lastProp = lastProps[propKey$269]; + for (var propKey$278 in nextProps) { + var propKey = nextProps[propKey$278]; + lastProp = lastProps[propKey$278]; if ( - nextProps.hasOwnProperty(propKey$269) && + nextProps.hasOwnProperty(propKey$278) && (null != propKey || null != lastProp) ) - switch (propKey$269) { + switch (propKey$278) { case "type": type = propKey; break; @@ -15529,7 +15866,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$269, + propKey$278, propKey, nextProps, lastProp @@ -15548,7 +15885,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$269 = null; + propKey = value = defaultValue = propKey$278 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15579,7 +15916,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$269 = type; + propKey$278 = type; break; case "defaultValue": defaultValue = type; @@ -15600,15 +15937,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$269 - ? updateOptions(domElement, !!lastProps, propKey$269, !1) + null != propKey$278 + ? updateOptions(domElement, !!lastProps, propKey$278, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$269 = null; + propKey = propKey$278 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15632,7 +15969,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$269 = name; + propKey$278 = name; break; case "defaultValue": propKey = name; @@ -15646,17 +15983,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$269, propKey); + updateTextarea(domElement, propKey$278, propKey); return; case "option": - for (var propKey$285 in lastProps) + for (var propKey$294 in lastProps) if ( - ((propKey$269 = lastProps[propKey$285]), - lastProps.hasOwnProperty(propKey$285) && - null != propKey$269 && - !nextProps.hasOwnProperty(propKey$285)) + ((propKey$278 = lastProps[propKey$294]), + lastProps.hasOwnProperty(propKey$294) && + null != propKey$278 && + !nextProps.hasOwnProperty(propKey$294)) ) - switch (propKey$285) { + switch (propKey$294) { case "selected": domElement.selected = !1; break; @@ -15664,33 +16001,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$285, + propKey$294, null, nextProps, - propKey$269 + propKey$278 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$269 = nextProps[lastDefaultValue]), + ((propKey$278 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$269 !== propKey && - (null != propKey$269 || null != propKey)) + propKey$278 !== propKey && + (null != propKey$278 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$269 && - "function" !== typeof propKey$269 && - "symbol" !== typeof propKey$269; + propKey$278 && + "function" !== typeof propKey$278 && + "symbol" !== typeof propKey$278; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$269, + propKey$278, nextProps, propKey ); @@ -15711,24 +16048,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$290 in lastProps) - (propKey$269 = lastProps[propKey$290]), - lastProps.hasOwnProperty(propKey$290) && - null != propKey$269 && - !nextProps.hasOwnProperty(propKey$290) && - setProp(domElement, tag, propKey$290, null, nextProps, propKey$269); + for (var propKey$299 in lastProps) + (propKey$278 = lastProps[propKey$299]), + lastProps.hasOwnProperty(propKey$299) && + null != propKey$278 && + !nextProps.hasOwnProperty(propKey$299) && + setProp(domElement, tag, propKey$299, null, nextProps, propKey$278); for (checked in nextProps) if ( - ((propKey$269 = nextProps[checked]), + ((propKey$278 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$269 !== propKey && - (null != propKey$269 || null != propKey)) + propKey$278 !== propKey && + (null != propKey$278 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$269) + if (null != propKey$278) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15736,7 +16073,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$269, + propKey$278, nextProps, propKey ); @@ -15744,49 +16081,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$295 in lastProps) - (propKey$269 = lastProps[propKey$295]), - lastProps.hasOwnProperty(propKey$295) && - void 0 !== propKey$269 && - !nextProps.hasOwnProperty(propKey$295) && + for (var propKey$304 in lastProps) + (propKey$278 = lastProps[propKey$304]), + lastProps.hasOwnProperty(propKey$304) && + void 0 !== propKey$278 && + !nextProps.hasOwnProperty(propKey$304) && setPropOnCustomElement( domElement, tag, - propKey$295, + propKey$304, void 0, nextProps, - propKey$269 + propKey$278 ); for (defaultChecked in nextProps) - (propKey$269 = nextProps[defaultChecked]), + (propKey$278 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$269 === propKey || - (void 0 === propKey$269 && void 0 === propKey) || + propKey$278 === propKey || + (void 0 === propKey$278 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$269, + propKey$278, nextProps, propKey ); return; } } - for (var propKey$300 in lastProps) - (propKey$269 = lastProps[propKey$300]), - lastProps.hasOwnProperty(propKey$300) && - null != propKey$269 && - !nextProps.hasOwnProperty(propKey$300) && - setProp(domElement, tag, propKey$300, null, nextProps, propKey$269); + for (var propKey$309 in lastProps) + (propKey$278 = lastProps[propKey$309]), + lastProps.hasOwnProperty(propKey$309) && + null != propKey$278 && + !nextProps.hasOwnProperty(propKey$309) && + setProp(domElement, tag, propKey$309, null, nextProps, propKey$278); for (lastProp in nextProps) - (propKey$269 = nextProps[lastProp]), + (propKey$278 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$269 === propKey || - (null == propKey$269 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$269, nextProps, propKey); + propKey$278 === propKey || + (null == propKey$278 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$278, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15906,6 +16243,20 @@ function clearSuspenseBoundary(parentInstance, suspenseInstance) { } while (node); retryIfBlockedOn(suspenseInstance); } +function clearContainer(container) { + var nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break; + default: + container.textContent = ""; + } +} function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -16074,7 +16425,7 @@ function getHoistableRoot(container) { } var previousDispatcher = Internals.d; Internals.d = { - f: flushSyncWork, + f: disableLegacyMode ? flushSyncWork : previousDispatcher.f, r: requestFormReset, D: prefetchDNS$1, C: preconnect$1, @@ -16085,9 +16436,12 @@ Internals.d = { M: preinitModuleScript }; function flushSyncWork() { - var previousWasRendering = previousDispatcher.f(), - wasRendering = flushSyncWork$1(); - return previousWasRendering || wasRendering; + if (disableLegacyMode) { + var previousWasRendering = previousDispatcher.f(), + wasRendering = flushSyncWork$1(); + return previousWasRendering || wasRendering; + } + throw Error(formatProdErrorMessage(521)); } function requestFormReset(form) { var formInst = getInstanceFromNode(form); @@ -16364,26 +16718,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$308 = getResourcesFromRoot( + var styles$317 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$309 = styles$308.get(type); - resource$309 || + resource$318 = styles$317.get(type); + resource$318 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$309 = { + (resource$318 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$308.set(type, resource$309), - (styles$308 = JSCompiler_inline_result.querySelector( + styles$317.set(type, resource$318), + (styles$317 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$308._p && - ((resource$309.instance = styles$308), - (resource$309.state.loading = 5)), + !styles$317._p && + ((resource$318.instance = styles$317), + (resource$318.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16396,16 +16750,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$308 || + styles$317 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$309.state + resource$318.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$309; + return resource$318; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16502,37 +16856,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$314 = hoistableRoot.querySelector( + var instance$323 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$314) + if (instance$323) return ( (resource.state.loading |= 4), - (resource.instance = instance$314), - markNodeAsHoistable(instance$314), - instance$314 + (resource.instance = instance$323), + markNodeAsHoistable(instance$323), + instance$323 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$314 = ( + instance$323 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$314); - var linkInstance = instance$314; + markNodeAsHoistable(instance$323); + var linkInstance = instance$323; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$314, "link", instance); + setInitialProperties(instance$323, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$314, props.precedence, hoistableRoot); - return (resource.instance = instance$314); + insertStylesheet(instance$323, props.precedence, hoistableRoot); + return (resource.instance = instance$323); case "script": - instance$314 = getScriptKey(props.src); + instance$323 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$314) + getScriptSelectorFromKey(instance$323) )) ) return ( @@ -16541,7 +16895,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$314))) + if ((styleProps = preloadPropsMap.get(instance$323))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17077,7 +17431,7 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(nearestMounted), root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); @@ -17510,6 +17864,16 @@ function isValidContainer(node) { " react-mount-point-unstable " !== node.nodeValue)) ); } +function isValidContainerLegacy(node) { + return !( + !node || + (1 !== node.nodeType && + 9 !== node.nodeType && + 11 !== node.nodeType && + (8 !== node.nodeType || + " react-mount-point-unstable " !== node.nodeValue)) + ); +} function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { if ( 1 !== target.nodeType && @@ -17531,23 +17895,69 @@ function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { listenerSet.add(listenerSetKey)); } else throw Error(formatProdErrorMessage(369)); } +function flushSyncImpl(fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = Internals.p; + try { + if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (Internals.p = previousUpdatePriority), + Internals.d.f(); + } +} +function flushSyncErrorInBuildsThatSupportLegacyMode() { + throw Error( + "Expected this build of React to not support legacy mode but it does. This is a bug in React." + ); +} +var flushSync$1 = disableLegacyMode + ? flushSyncImpl + : flushSyncErrorInBuildsThatSupportLegacyMode; function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1837 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1856 = React.version; if ( - "19.0.0-www-classic-f0e8164410-20240614" !== - isomorphicReactPackageVersion$jscomp$inline_1837 + "19.0.0-www-classic-88959fd54a-20240614" !== + isomorphicReactPackageVersion$jscomp$inline_1856 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1837, - "19.0.0-www-classic-f0e8164410-20240614" + isomorphicReactPackageVersion$jscomp$inline_1856, + "19.0.0-www-classic-88959fd54a-20240614" ) ); +function flushSyncFromReconciler(fn) { + a: { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + 0 !== (executionContext & 6) || + flushPassiveEffects(); + var prevExecutionContext = executionContext; + executionContext |= 1; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + Internals.p = 2; + ReactSharedInternals.T = null; + var JSCompiler_inline_result = fn ? fn() : void 0; + break a; + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + (executionContext = prevExecutionContext), + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); + } + JSCompiler_inline_result = void 0; + } + return JSCompiler_inline_result; +} +var flushSync = disableLegacyMode ? flushSync$1 : flushSyncFromReconciler; Internals.findDOMNode = function (componentOrElement) { return findHostInstance(componentOrElement); }; @@ -17561,10 +17971,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1839 = { +var devToolsConfig$jscomp$inline_1863 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-dom" }; (function (internals) { @@ -17582,10 +17992,10 @@ var devToolsConfig$jscomp$inline_1839 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1839.bundleType, - version: devToolsConfig$jscomp$inline_1839.version, - rendererPackageName: devToolsConfig$jscomp$inline_1839.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1839.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1863.bundleType, + version: devToolsConfig$jscomp$inline_1863.version, + rendererPackageName: devToolsConfig$jscomp$inline_1863.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1863.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17601,14 +18011,14 @@ var devToolsConfig$jscomp$inline_1839 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1839.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1863.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; @@ -17617,9 +18027,7 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) { var root = this._internalRoot; if (null === root) throw Error(formatProdErrorMessage(409)); - var current = root.current, - lane = requestUpdateLane(); - updateContainerImpl(current, lane, children, root, null, null); + updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () { @@ -17627,8 +18035,7 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); - updateContainerImpl(root.current, 2, null, root, null, null); + updateContainerSync(null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -17672,6 +18079,105 @@ function wwwOnCaughtError(error, errorInfo) { null != errorInfo.componentStack ? errorInfo.componentStack : "" }) && defaultOnCaughtError(error); } +function noopOnRecoverableError() {} +function legacyCreateRootFromDOMContainer( + container, + initialChildren, + parentComponent, + callback, + isHydrationContainer +) { + if (isHydrationContainer) { + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root$344); + originalCallback.call(instance); + }; + } + var root$344 = createHydrationContainer( + initialChildren, + callback, + container, + 0, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$344; + container[internalContainerInstanceKey] = root$344.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + flushSyncWork$1(); + return root$344; + } + clearContainer(container); + if ("function" === typeof callback) { + var originalCallback$345 = callback; + callback = function () { + var instance = getPublicRootInstance(root$346); + originalCallback$345.call(instance); + }; + } + var root$346 = createFiberRoot( + container, + 0, + !1, + null, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$346; + container[internalContainerInstanceKey] = root$346.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + updateContainerSync(initialChildren, root$346, parentComponent, callback); + flushSyncWork$1(); + return root$346; +} +function legacyRenderSubtreeIntoContainer( + parentComponent, + children, + container, + forceHydrate, + callback +) { + var maybeRoot = container._reactRootContainer; + if (maybeRoot) { + var root = maybeRoot; + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + updateContainer(children, root, parentComponent, callback); + } else + root = legacyCreateRootFromDOMContainer( + container, + children, + parentComponent, + callback, + forceHydrate + ); + return getPublicRootInstance(root); +} assign(Internals, { ReactBrowserEventEmitter: { isEnabled: function () { @@ -17742,17 +18248,7 @@ exports.findDOMNode = function (componentOrElement) { ? componentOrElement : findHostInstance(componentOrElement); }; -exports.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f(); - } -}; +exports.flushSync = flushSync; exports.hydrateRoot = function (container, initialChildren, options) { options = assign( { onUncaughtError: wwwOnUncaughtError, onCaughtError: wwwOnCaughtError }, @@ -17782,11 +18278,11 @@ exports.hydrateRoot = function (container, initialChildren, options) { void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState)); - initialChildren = createFiberRoot( + initialChildren = createHydrationContainer( + initialChildren, + null, container, 1, - !0, - initialChildren, null != options ? options : null, isStrictMode, concurrentUpdatesByDefaultOverride, @@ -17797,15 +18293,6 @@ exports.hydrateRoot = function (container, initialChildren, options) { transitionCallbacks, formState ); - initialChildren.context = getContextForSubtree(null); - options = initialChildren.current; - isStrictMode = requestUpdateLane(); - concurrentUpdatesByDefaultOverride = createUpdate(isStrictMode); - concurrentUpdatesByDefaultOverride.callback = null; - enqueueUpdate(options, concurrentUpdatesByDefaultOverride, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); - ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); @@ -17918,18 +18405,34 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.render = function () { - throw Error(formatProdErrorMessage(509)); +exports.render = function (element, container, callback) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return legacyRenderSubtreeIntoContainer( + null, + element, + container, + !1, + callback + ); }; exports.requestFormReset = function (form) { Internals.d.r(form); }; -exports.unmountComponentAtNode = function () { - throw Error(formatProdErrorMessage(509)); -}; -exports.unstable_batchedUpdates = function (fn, a) { - return fn(a); +exports.unmountComponentAtNode = function (container) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return container._reactRootContainer + ? (updateContainerSync(null, container._reactRootContainer, null, null), + flushSyncWork$1(), + (container._reactRootContainer = null), + (container[internalContainerInstanceKey] = null), + !0) + : !1; }; +exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_createEventHandle = function (type, options) { function eventHandle(target, callback) { if ("function" !== typeof callback) @@ -17966,7 +18469,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 643277bbd7..70ae3976ab 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -17219,14 +17219,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1827 = React.version; if ( - "19.0.0-www-modern-f0e8164410-20240614" !== + "19.0.0-www-modern-88959fd54a-20240614" !== isomorphicReactPackageVersion$jscomp$inline_1827 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1827, - "19.0.0-www-modern-f0e8164410-20240614" + "19.0.0-www-modern-88959fd54a-20240614" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17245,7 +17245,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1829 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-dom" }; (function (internals) { @@ -17289,7 +17289,7 @@ var devToolsConfig$jscomp$inline_1829 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; @@ -17647,7 +17647,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index d48ffeaecd..7858144a83 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -8771,5 +8771,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-classic-f0e8164410-20240614"; + exports.version = "19.0.0-www-classic-88959fd54a-20240614"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 7301556ede..7826ee49d5 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -8727,5 +8727,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-modern-f0e8164410-20240614"; + exports.version = "19.0.0-www-modern-88959fd54a-20240614"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 64fb9f1a72..a10f005e38 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5761,4 +5761,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 58879ae88b..a4ae701db4 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5739,4 +5739,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 4a564aa2c2..bb4a89f566 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -295,6 +295,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -745,6 +748,19 @@ __DEV__ && } return null; } + function findCurrentHostFiberWithNoPortalsImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + if ( + 4 !== node.tag && + ((tag = findCurrentHostFiberWithNoPortalsImpl(node)), null !== tag) + ) + return tag; + node = node.sibling; + } + return null; + } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -3828,6 +3844,10 @@ __DEV__ && scheduleImmediateTask(processRootScheduleInMicrotask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); + !disableLegacyMode && + ReactSharedInternals.isBatchingLegacy && + 0 === root.tag && + (ReactSharedInternals.didScheduleLegacyUpdate = !0); } function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -3835,7 +3855,7 @@ __DEV__ && do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( @@ -5490,7 +5510,15 @@ __DEV__ && thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -5773,8 +5801,9 @@ __DEV__ && currentlyRenderingFiber$1 = null; hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + null === current || + (current.flags & 31457280) === (workInProgress.flags & 31457280) || + (!disableLegacyMode && 0 === (current.mode & 1)) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -7316,7 +7345,7 @@ __DEV__ && for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function warnOnInvalidCallback(callback) { + function warnOnInvalidCallback$1(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); didWarnOnInvalidCallback.has(key) || @@ -7398,6 +7427,124 @@ __DEV__ && ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum + ); + } + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + addendum = new ctor(props, context); + } finally { + setIsStrictModeForDevtools(!1); + } + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), + error$jscomp$0( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; + } function callComponentWillReceiveProps( workInProgress, instance, @@ -7424,6 +7571,192 @@ __DEV__ && null )); } + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name + ); + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name + ); + instance.propTypes && + error$jscomp$0( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + name + ); + instance.contextType && + error$jscomp$0( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name + ); + instance.contextTypes && + error$jscomp$0( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name + ); + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name + ); + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" + ); + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name + ); + "function" === typeof instance.componentDidReceiveProps && + error$jscomp$0( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name + ); + "function" === typeof instance.componentWillRecieveProps && + error$jscomp$0( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name + ); + "function" === typeof instance.UNSAFE_componentWillRecieveProps && + error$jscomp$0( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name + ); + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && + error$jscomp$0( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name + ); + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & 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 && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + } function resolveClassComponentProps( Component, baseProps, @@ -7580,6 +7913,36 @@ __DEV__ && )); }); } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(SyncLane)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, SyncLane)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= SyncLane)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } function throwException( root, returnFiber, @@ -7594,81 +7957,115 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - isHydrating && (didSuspendOrErrorDEV = !0); + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 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))); + isHydrating && + (disableLegacyMode || sourceFiber.mode & 1) && + (didSuspendOrErrorDEV = !0); enableDebugTracing && sourceFiber.mode & 4 && - ((sourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(sourceFiber, value)); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ((currentSourceFiber = + getComponentNameFromFiber(sourceFiber) || "Unknown"), + logComponentSuspended(currentSourceFiber, value)); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = RootSuspended); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } throw Error( "Unexpected Suspense handler tag (" + - sourceFiber.tag + + currentSourceFiber.tag + "). This is a bug in React." ); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( (didSuspendOrErrorDEV = !0), - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && queueHydrationError( createCapturedValueAtFiber( @@ -7693,10 +8090,10 @@ __DEV__ && (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -7704,7 +8101,7 @@ __DEV__ && (workInProgressRootExitStatus = RootErrored)), !1 ); - var error = createCapturedValueAtFiber( + 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 } @@ -7712,56 +8109,58 @@ __DEV__ && sourceFiber ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [error]) - : workInProgressRootConcurrentErrors.push(error); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), + (returnFiber.lanes |= root), (root = createRootErrorUpdate( - sourceFiber.stateNode, - value, + returnFiber.stateNode, + sourceFiber, root )), - enqueueCapturedUpdate(sourceFiber, root), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (error = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== error && - "function" === typeof error.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(error))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks( @@ -8094,30 +8493,37 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & OffscreenLane)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = OffscreenLane), - deferHiddenOffscreenComponent( - current, - workInProgress, + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & OffscreenLane)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = + OffscreenLane), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + else + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -8279,7 +8685,7 @@ __DEV__ && return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8318,570 +8724,214 @@ __DEV__ && ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - lane = !1; - state = emptyContextObject; - var context = Component.contextType; - if ( - "contextType" in Component && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) - ) { - didWarnAboutInvalidateContextType.add(Component); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((state = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (lane = Component.contextTypes), - (context = (lane = null !== lane && void 0 !== lane) - ? getMaskedContext(workInProgress, state) - : emptyContextObject)); - addendum = new Component(nextProps, context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - addendum = new Component(nextProps, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - var state$jscomp$0 = (workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null); - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state$jscomp$0 && - ((state$jscomp$0 = - getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state$jscomp$0) || - (didWarnAboutUninitializedState.add(state$jscomp$0), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state$jscomp$0, - null === addendum.state ? "null" : "undefined", - state$jscomp$0 - ))); - if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (state$jscomp$0 = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (state$jscomp$0 = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (state$jscomp$0 = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== state$jscomp$0 || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - addendum = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(addendum) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(addendum), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - addendum, - newApiName, - null !== state$jscomp$0 ? "\n " + state$jscomp$0 : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); - } - } - lane && - ((lane = workInProgress.stateNode), - (lane.__reactInternalMemoizedUnmaskedChildContext = state), - (lane.__reactInternalMemoizedMaskedChildContext = context)); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { state = workInProgress.stateNode; - lane = getComponentNameFromType(Component) || "Component"; - state.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - lane - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - lane - )); - !state.getInitialState || - state.getInitialState.isReactClassApproved || - state.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - lane - ); - state.getDefaultProps && - !state.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - lane - ); - state.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - lane - ); - state.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - lane - ); - state.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - lane - ); - Component.contextType && - Component.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(Component) && - (didWarnAboutContextTypeAndContextTypes.add(Component), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - lane - )); - "function" === typeof state.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - lane - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof state.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof state.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - lane - ); - "function" === typeof state.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - lane - ); - "function" === typeof state.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - lane - ); - "function" === typeof state.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - lane - ); - context = state.props !== nextProps; - void 0 !== state.props && - context && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - lane - ); - state.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - lane, - lane - ); - "function" !== typeof state.getSnapshotBeforeUpdate || - "function" === typeof state.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof state.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof state.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - lane - ); - (context = state.state) && - ("object" !== typeof context || isArrayImpl(context)) && - error$jscomp$0("%s.state: must be set to an object or null", lane); - "function" === typeof state.getChildContext && - "object" !== typeof Component.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - lane - ); - state = workInProgress.stateNode; - state.props = nextProps; - state.state = workInProgress.memoizedState; - state.refs = {}; - initializeUpdateQueue(workInProgress); - lane = Component.contextType; - "object" === typeof lane && null !== lane - ? (state.context = readContext(lane)) - : ((lane = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (state.context = getMaskedContext(workInProgress, lane))); - state.state === nextProps && - ((lane = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(lane) || - (didWarnAboutDirectlyAssigningPropsToState.add(lane), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - lane - ))); - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - state - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - state - ); - state.state = workInProgress.memoizedState; - lane = Component.getDerivedStateFromProps; - "function" === typeof lane && - (applyDerivedStateFromProps( - workInProgress, - Component, - lane, - nextProps - ), - (state.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ((lane = state.state), - "function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount(), - lane !== state.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - state, - state.state, - null - )), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state.state = workInProgress.memoizedState)); - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); - state = !0; - } else if (null === current$jscomp$0) - (state = workInProgress.stateNode), - (foundWillUpdateName = workInProgress.memoizedProps), - (lane = resolveClassComponentProps( - Component, - foundWillUpdateName, - workInProgress.type === workInProgress.elementType - )), - (state.props = lane), - (state$jscomp$0 = state.context), - (context = Component.contextType), - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (context = getMaskedContext(workInProgress, context))), - (foundWillReceivePropsName = Component.getDerivedStateFromProps), - (addendum = - "function" === typeof foundWillReceivePropsName || - "function" === typeof state.getSnapshotBeforeUpdate), - (foundWillUpdateName = - workInProgress.pendingProps !== foundWillUpdateName), - addendum || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((foundWillUpdateName || state$jscomp$0 !== context) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - context - )), - (hasForceUpdate = !1), - (newApiName = workInProgress.memoizedState), - (state.state = newApiName), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state$jscomp$0 = workInProgress.memoizedState), - foundWillUpdateName || - newApiName !== state$jscomp$0 || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof foundWillReceivePropsName && - (applyDerivedStateFromProps( - workInProgress, - Component, - foundWillReceivePropsName, - nextProps - ), - (state$jscomp$0 = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - newApiName, - state$jscomp$0, - context - )) - ? (addendum || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = state$jscomp$0)), - (state.props = nextProps), - (state.state = state$jscomp$0), - (state.context = context), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (state = !1)); - else { - state = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - lane = workInProgress.memoizedProps; - context = resolveClassComponentProps( + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps( Component, - lane, + unresolvedOldProps, workInProgress.type === workInProgress.elementType ); - state.props = context; - addendum = workInProgress.pendingProps; - foundWillUpdateName = state.context; - state$jscomp$0 = Component.contextType; - "object" === typeof state$jscomp$0 && null !== state$jscomp$0 - ? (state$jscomp$0 = readContext(state$jscomp$0)) - : ((state$jscomp$0 = isContextProvider(Component) + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current), - (state$jscomp$0 = getMaskedContext( - workInProgress, - state$jscomp$0 - ))); - newApiName = Component.getDerivedStateFromProps; - (foundWillReceivePropsName = - "function" === typeof newApiName || - "function" === typeof state.getSnapshotBeforeUpdate) || + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || ("function" !== typeof state.UNSAFE_componentWillReceiveProps && "function" !== typeof state.componentWillReceiveProps) || - ((lane !== addendum || foundWillUpdateName !== state$jscomp$0) && + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, state, nextProps, - state$jscomp$0 + contextType )); hasForceUpdate = !1; - foundWillUpdateName = workInProgress.memoizedState; - state.state = foundWillUpdateName; + var oldState = workInProgress.memoizedState; + state.state = oldState; processUpdateQueue(workInProgress, nextProps, state, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== addendum || - foundWillUpdateName !== newState || + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || didPerformWorkStackCursor.current || - hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof newApiName && + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps( workInProgress, Component, - newApiName, + getDerivedStateFromProps, nextProps ), - (newState = workInProgress.memoizedState)), - (context = + (oldContext = workInProgress.memoizedState)), + (lane = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + lane, nextProps, - foundWillUpdateName, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( + Component, + lane, + workInProgress.type === workInProgress.elementType + ); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (enableLazyContextPropagation && + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, newState, - state$jscomp$0 + oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (foundWillReceivePropsName || + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || ("function" !== typeof state.UNSAFE_componentWillUpdate && "function" !== typeof state.componentWillUpdate) || ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate( - nextProps, - newState, - state$jscomp$0 - ), + state.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof state.UNSAFE_componentWillUpdate && state.UNSAFE_componentWillUpdate( nextProps, newState, - state$jscomp$0 + oldContext )), "function" === typeof state.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof state.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), (state.props = nextProps), (state.state = newState), - (state.context = state$jscomp$0), - (state = context)) + (state.context = oldContext), + (state = contextType)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (state = !1)); } - context = state; - markRef(current$jscomp$0, workInProgress); - lane = 0 !== (workInProgress.flags & 128); - if (context || lane) { - context = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (lane && "function" !== typeof Component.getDerivedStateFromError) - (addendum = null), (profilerStartTime = -1); - else { - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - addendum = callRenderInDEV(context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - enableSchedulingProfiler && markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && lane - ? ((lane = addendum), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lane, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - addendum, - renderLanes - ); - workInProgress.memoizedState = context.state; - _instance && invalidateContextProvider(workInProgress, Component, !0); - current$jscomp$0 = workInProgress.child; - } else - _instance && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - )); + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); Component = workInProgress.stateNode; state && Component.props !== nextProps && @@ -8891,7 +8941,76 @@ __DEV__ && getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + enableSchedulingProfiler && markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -8964,32 +9083,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2494; - var JSCompiler_object_inline_stack_2495 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2467; + var JSCompiler_object_inline_stack_2468 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2496 = !1; + var JSCompiler_object_inline_componentStack_2469 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2494 = didSuspend) || - (JSCompiler_object_inline_digest_2494 = + (JSCompiler_object_inline_digest_2467 = didSuspend) || + (JSCompiler_object_inline_digest_2467 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2494 && - ((JSCompiler_object_inline_componentStack_2496 = !0), + JSCompiler_object_inline_digest_2467 && + ((JSCompiler_object_inline_componentStack_2469 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2494 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2467 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2496 + JSCompiler_object_inline_componentStack_2469 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2493 = nextHydratableInstance; + var JSCompiler_object_inline_message_2466 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2493)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2466)) { c: { - var instance = JSCompiler_object_inline_message_2493; + var instance = JSCompiler_object_inline_message_2466; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9030,19 +9149,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2493 + JSCompiler_object_inline_message_2466 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2493 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2466 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2493 && - ((JSCompiler_object_inline_message_2493 = - JSCompiler_object_inline_message_2493.dehydrated), - null !== JSCompiler_object_inline_message_2493) + null !== JSCompiler_object_inline_message_2466 && + ((JSCompiler_object_inline_message_2466 = + JSCompiler_object_inline_message_2466.dehydrated), + null !== JSCompiler_object_inline_message_2466) ) return ( - JSCompiler_object_inline_message_2493.data === + JSCompiler_object_inline_message_2466.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = DefaultHydrationLane) : (workInProgress.lanes = OffscreenLane), @@ -9050,27 +9169,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2493 = - JSCompiler_object_inline_stack_2495.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2495.fallback; - if (JSCompiler_object_inline_componentStack_2496) + JSCompiler_object_inline_message_2466 = + JSCompiler_object_inline_stack_2468.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2468.fallback; + if (JSCompiler_object_inline_componentStack_2469) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2495 = + (JSCompiler_object_inline_stack_2468 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2493, + JSCompiler_object_inline_message_2466, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2496 = + (JSCompiler_object_inline_componentStack_2469 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2496.memoizedState = + (JSCompiler_object_inline_componentStack_2469.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2496.childLanes = + (JSCompiler_object_inline_componentStack_2469.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2494, + JSCompiler_object_inline_digest_2467, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9079,60 +9198,60 @@ __DEV__ && ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = - JSCompiler_object_inline_componentStack_2496.updateQueue), - null === renderLanes - ? (JSCompiler_object_inline_componentStack_2496.updateQueue = + (current = + JSCompiler_object_inline_componentStack_2469.updateQueue), + null === current + ? (JSCompiler_object_inline_componentStack_2469.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2495 + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), + JSCompiler_object_inline_stack_2468 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2495.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2468.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2495 = + (JSCompiler_object_inline_stack_2468 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2493, + JSCompiler_object_inline_message_2466, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2496 = + (JSCompiler_object_inline_componentStack_2469 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2496.memoizedState = + (JSCompiler_object_inline_componentStack_2469.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2496.childLanes = + (JSCompiler_object_inline_componentStack_2469.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2494, + JSCompiler_object_inline_digest_2467, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2495 + JSCompiler_object_inline_stack_2468 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2493 + JSCompiler_object_inline_message_2466 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2493 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2493) + ((JSCompiler_object_inline_message_2466 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2466) ) { if (didSuspend) workInProgress.flags & 256 @@ -9149,93 +9268,95 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2496 = - JSCompiler_object_inline_stack_2495.fallback), - (JSCompiler_object_inline_message_2493 = workInProgress.mode), - (JSCompiler_object_inline_stack_2495 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2495.children - }, - JSCompiler_object_inline_message_2493 - )), - (JSCompiler_object_inline_componentStack_2496 = + (JSCompiler_object_inline_componentStack_2469 = + JSCompiler_object_inline_stack_2468.fallback), + (JSCompiler_object_inline_message_2466 = workInProgress.mode), + (JSCompiler_object_inline_stack_2468 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2468.children + }, + JSCompiler_object_inline_message_2466, + 0, + null + )), + (JSCompiler_object_inline_componentStack_2469 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2496, - JSCompiler_object_inline_message_2493, + JSCompiler_object_inline_componentStack_2469, + JSCompiler_object_inline_message_2466, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2496.flags |= 2), - (JSCompiler_object_inline_stack_2495.return = workInProgress), - (JSCompiler_object_inline_componentStack_2496.return = + (JSCompiler_object_inline_componentStack_2469.flags |= 2), + (JSCompiler_object_inline_stack_2468.return = workInProgress), + (JSCompiler_object_inline_componentStack_2469.return = workInProgress), - (JSCompiler_object_inline_stack_2495.sibling = - JSCompiler_object_inline_componentStack_2496), - (workInProgress.child = JSCompiler_object_inline_stack_2495), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2495 = workInProgress.child), - (JSCompiler_object_inline_stack_2495.memoizedState = + (JSCompiler_object_inline_stack_2468.sibling = + JSCompiler_object_inline_componentStack_2469), + (workInProgress.child = JSCompiler_object_inline_stack_2468), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2468 = workInProgress.child), + (JSCompiler_object_inline_stack_2468.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2495.childLanes = + (JSCompiler_object_inline_stack_2468.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2494, + JSCompiler_object_inline_digest_2467, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_componentStack_2496)); + (workInProgress = JSCompiler_object_inline_componentStack_2469)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2493.data === + JSCompiler_object_inline_message_2466.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2494 = - JSCompiler_object_inline_message_2493.nextSibling && - JSCompiler_object_inline_message_2493.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2494) { - JSCompiler_temp = JSCompiler_object_inline_digest_2494.dgst; - var message = JSCompiler_object_inline_digest_2494.msg; - instance = JSCompiler_object_inline_digest_2494.stck; - var componentStack = JSCompiler_object_inline_digest_2494.cstck; + JSCompiler_object_inline_digest_2467 = + JSCompiler_object_inline_message_2466.nextSibling && + JSCompiler_object_inline_message_2466.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2467) { + JSCompiler_temp = JSCompiler_object_inline_digest_2467.dgst; + var message = JSCompiler_object_inline_digest_2467.msg; + instance = JSCompiler_object_inline_digest_2467.stck; + var componentStack = JSCompiler_object_inline_digest_2467.cstck; } - JSCompiler_object_inline_message_2493 = message; - JSCompiler_object_inline_digest_2494 = JSCompiler_temp; - JSCompiler_object_inline_stack_2495 = instance; - JSCompiler_object_inline_componentStack_2496 = componentStack; - JSCompiler_object_inline_message_2493 = - JSCompiler_object_inline_message_2493 - ? Error(JSCompiler_object_inline_message_2493) + JSCompiler_object_inline_message_2466 = message; + JSCompiler_object_inline_digest_2467 = JSCompiler_temp; + JSCompiler_object_inline_stack_2468 = instance; + JSCompiler_object_inline_componentStack_2469 = componentStack; + JSCompiler_object_inline_message_2466 = + JSCompiler_object_inline_message_2466 + ? Error(JSCompiler_object_inline_message_2466) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2493.stack = - JSCompiler_object_inline_stack_2495 || ""; - JSCompiler_object_inline_message_2493.digest = - JSCompiler_object_inline_digest_2494; - JSCompiler_object_inline_digest_2494 = - void 0 === JSCompiler_object_inline_componentStack_2496 + JSCompiler_object_inline_message_2466.stack = + JSCompiler_object_inline_stack_2468 || ""; + JSCompiler_object_inline_message_2466.digest = + JSCompiler_object_inline_digest_2467; + JSCompiler_object_inline_digest_2467 = + void 0 === JSCompiler_object_inline_componentStack_2469 ? null - : JSCompiler_object_inline_componentStack_2496; - "string" === typeof JSCompiler_object_inline_digest_2494 && + : JSCompiler_object_inline_componentStack_2469; + "string" === typeof JSCompiler_object_inline_digest_2467 && CapturedStacks.set( - JSCompiler_object_inline_message_2493, - JSCompiler_object_inline_digest_2494 + JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_digest_2467 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2493, + value: JSCompiler_object_inline_message_2466, source: null, - stack: JSCompiler_object_inline_digest_2494 + stack: JSCompiler_object_inline_digest_2467 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9251,29 +9372,29 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2494 = + (JSCompiler_object_inline_digest_2467 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2494) + didReceiveUpdate || JSCompiler_object_inline_digest_2467) ) { - JSCompiler_object_inline_digest_2494 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2494) { - JSCompiler_object_inline_stack_2495 = renderLanes & -renderLanes; + JSCompiler_object_inline_digest_2467 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2467) { + JSCompiler_object_inline_stack_2468 = renderLanes & -renderLanes; if ( enableUnifiedSyncLane && - 0 !== (JSCompiler_object_inline_stack_2495 & SyncUpdateLanes) + 0 !== (JSCompiler_object_inline_stack_2468 & SyncUpdateLanes) ) - JSCompiler_object_inline_stack_2495 = SyncHydrationLane; + JSCompiler_object_inline_stack_2468 = SyncHydrationLane; else - switch (JSCompiler_object_inline_stack_2495) { + switch (JSCompiler_object_inline_stack_2468) { case SyncLane: - JSCompiler_object_inline_stack_2495 = SyncHydrationLane; + JSCompiler_object_inline_stack_2468 = SyncHydrationLane; break; case InputContinuousLane: - JSCompiler_object_inline_stack_2495 = + JSCompiler_object_inline_stack_2468 = InputContinuousHydrationLane; break; case DefaultLane: - JSCompiler_object_inline_stack_2495 = DefaultHydrationLane; + JSCompiler_object_inline_stack_2468 = DefaultHydrationLane; break; case 128: case 256: @@ -9294,40 +9415,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2495 = TransitionHydrationLane; + JSCompiler_object_inline_stack_2468 = TransitionHydrationLane; break; case IdleLane: - JSCompiler_object_inline_stack_2495 = IdleHydrationLane; + JSCompiler_object_inline_stack_2468 = IdleHydrationLane; break; default: - JSCompiler_object_inline_stack_2495 = 0; + JSCompiler_object_inline_stack_2468 = 0; } - JSCompiler_object_inline_stack_2495 = + JSCompiler_object_inline_stack_2468 = 0 !== - (JSCompiler_object_inline_stack_2495 & - (JSCompiler_object_inline_digest_2494.suspendedLanes | + (JSCompiler_object_inline_stack_2468 & + (JSCompiler_object_inline_digest_2467.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2495; + : JSCompiler_object_inline_stack_2468; if ( - 0 !== JSCompiler_object_inline_stack_2495 && - JSCompiler_object_inline_stack_2495 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2468 && + JSCompiler_object_inline_stack_2468 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2495), + ((prevState.retryLane = JSCompiler_object_inline_stack_2468), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2495 + JSCompiler_object_inline_stack_2468 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2494, + JSCompiler_object_inline_digest_2467, current, - JSCompiler_object_inline_stack_2495 + JSCompiler_object_inline_stack_2468 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2493.data === + JSCompiler_object_inline_message_2466.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9335,7 +9456,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2493.data === + JSCompiler_object_inline_message_2466.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9343,12 +9464,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2493._reactRetry = + (JSCompiler_object_inline_message_2466._reactRetry = workInProgress), (workInProgress = null)) - : ((current = prevState.treeContext), + : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2493.nextSibling + JSCompiler_object_inline_message_2466.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9356,67 +9477,83 @@ __DEV__ && (didSuspendOrErrorDEV = !1), (hydrationDiffRootDEV = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && (warnIfNotHydrating(), (idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2495.children + JSCompiler_object_inline_stack_2468.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2496) + if (JSCompiler_object_inline_componentStack_2469) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2496 = - JSCompiler_object_inline_stack_2495.fallback), - (JSCompiler_object_inline_message_2493 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2469 = + JSCompiler_object_inline_stack_2468.fallback), + (JSCompiler_object_inline_message_2466 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2495 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2495.children - } - )), - (JSCompiler_object_inline_stack_2495.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (componentStack = { + mode: "hidden", + children: JSCompiler_object_inline_stack_2468.children + }), + disableLegacyMode || + 0 !== (JSCompiler_object_inline_message_2466 & 1) || + workInProgress.child === JSCompiler_temp + ? ((JSCompiler_object_inline_stack_2468 = createWorkInProgress( + JSCompiler_temp, + componentStack + )), + (JSCompiler_object_inline_stack_2468.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280)) + : ((JSCompiler_object_inline_stack_2468 = workInProgress.child), + (JSCompiler_object_inline_stack_2468.childLanes = 0), + (JSCompiler_object_inline_stack_2468.pendingProps = + componentStack), + workInProgress.mode & 2 && + ((JSCompiler_object_inline_stack_2468.actualDuration = 0), + (JSCompiler_object_inline_stack_2468.actualStartTime = -1), + (JSCompiler_object_inline_stack_2468.selfBaseDuration = + JSCompiler_temp.selfBaseDuration), + (JSCompiler_object_inline_stack_2468.treeBaseDuration = + JSCompiler_temp.treeBaseDuration)), + (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2496 = + ? (JSCompiler_object_inline_componentStack_2469 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2496 + JSCompiler_object_inline_componentStack_2469 )) - : ((JSCompiler_object_inline_componentStack_2496 = + : ((JSCompiler_object_inline_componentStack_2469 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2496, - JSCompiler_object_inline_message_2493, + JSCompiler_object_inline_componentStack_2469, + JSCompiler_object_inline_message_2466, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2496.flags |= 2)), - (JSCompiler_object_inline_componentStack_2496.return = + (JSCompiler_object_inline_componentStack_2469.flags |= 2)), + (JSCompiler_object_inline_componentStack_2469.return = workInProgress), - (JSCompiler_object_inline_stack_2495.return = workInProgress), - (JSCompiler_object_inline_stack_2495.sibling = - JSCompiler_object_inline_componentStack_2496), - (workInProgress.child = JSCompiler_object_inline_stack_2495), - (JSCompiler_object_inline_stack_2495 = - JSCompiler_object_inline_componentStack_2496), - (JSCompiler_object_inline_componentStack_2496 = workInProgress.child), - (JSCompiler_object_inline_message_2493 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2493 - ? (JSCompiler_object_inline_message_2493 = + (JSCompiler_object_inline_stack_2468.return = workInProgress), + (JSCompiler_object_inline_stack_2468.sibling = + JSCompiler_object_inline_componentStack_2469), + (workInProgress.child = JSCompiler_object_inline_stack_2468), + (JSCompiler_object_inline_stack_2468 = + JSCompiler_object_inline_componentStack_2469), + (JSCompiler_object_inline_componentStack_2469 = workInProgress.child), + (JSCompiler_object_inline_message_2466 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2466 + ? (JSCompiler_object_inline_message_2466 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2493.cachePool), + JSCompiler_object_inline_message_2466.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9424,72 +9561,80 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2493 = { + (JSCompiler_object_inline_message_2466 = { baseLanes: - JSCompiler_object_inline_message_2493.baseLanes | renderLanes, + JSCompiler_object_inline_message_2466.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2496.memoizedState = - JSCompiler_object_inline_message_2493), + (JSCompiler_object_inline_componentStack_2469.memoizedState = + JSCompiler_object_inline_message_2466), enableTransitionTracing && - ((JSCompiler_object_inline_message_2493 = enableTransitionTracing + ((JSCompiler_object_inline_message_2466 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2493 && + null !== JSCompiler_object_inline_message_2466 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2496.updateQueue), + JSCompiler_object_inline_componentStack_2469.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2496.updateQueue = { - transitions: JSCompiler_object_inline_message_2493, + ? (JSCompiler_object_inline_componentStack_2469.updateQueue = { + transitions: JSCompiler_object_inline_message_2466, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2496.updateQueue = { - transitions: JSCompiler_object_inline_message_2493, + ? (JSCompiler_object_inline_componentStack_2469.updateQueue = { + transitions: JSCompiler_object_inline_message_2466, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack ? componentStack.retryQueue : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2493), + JSCompiler_object_inline_message_2466), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2496.childLanes = + (JSCompiler_object_inline_componentStack_2469.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2494, + JSCompiler_object_inline_digest_2467, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2495 + JSCompiler_object_inline_stack_2468 ); pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2495.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + JSCompiler_object_inline_digest_2467 = current.child; + current = JSCompiler_object_inline_digest_2467.sibling; + JSCompiler_object_inline_digest_2467 = createWorkInProgress( + JSCompiler_object_inline_digest_2467, + { + mode: "visible", + children: JSCompiler_object_inline_stack_2468.children + } + ); + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_object_inline_digest_2467.lanes = renderLanes); + JSCompiler_object_inline_digest_2467.return = workInProgress; + JSCompiler_object_inline_digest_2467.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2494 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2494 + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2494.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_object_inline_digest_2467; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_object_inline_digest_2467; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -9500,26 +9645,37 @@ __DEV__ && fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || + 0 !== (mode & 1) || + null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = 0), + (progressedPrimaryFragment.actualStartTime = -1), + (progressedPrimaryFragment.selfBaseDuration = 0), + (progressedPrimaryFragment.treeBaseDuration = 0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); - } function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9698,59 +9854,69 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + null === current || + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } function bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -9924,7 +10090,7 @@ __DEV__ && } function beginWork(current, workInProgress, renderLanes) { if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( + var copiedFiber = createFiberFromTypeAndProps( workInProgress.type, workInProgress.key, workInProgress.pendingProps, @@ -9936,13 +10102,13 @@ __DEV__ && 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; + copiedFiber.index = workInProgress.index; + copiedFiber.sibling = workInProgress.sibling; + copiedFiber.return = workInProgress.return; + copiedFiber.ref = workInProgress.ref; + copiedFiber._debugInfo = workInProgress._debugInfo; if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; + returnFiber.child = copiedFiber; else { var prevSibling = returnFiber.child; if (null === prevSibling) @@ -9950,14 +10116,14 @@ __DEV__ && for (; prevSibling.sibling !== workInProgress; ) if (((prevSibling = prevSibling.sibling), null === prevSibling)) throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; + prevSibling.sibling = copiedFiber; } - workInProgress = returnFiber.deletions; - null === workInProgress + var deletions = returnFiber.deletions; + null === deletions ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + : deletions.push(current); + copiedFiber.flags |= 2; + return copiedFiber; } if (null !== current) if ( @@ -9983,150 +10149,142 @@ __DEV__ && } else { didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) + var JSCompiler_temp; + if ((JSCompiler_temp = isHydrating)) warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + (JSCompiler_temp = 0 !== (workInProgress.flags & 1048576)); + if (JSCompiler_temp) { + var slotIndex = workInProgress.index; + warnIfNotHydrating(); + pushTreeId(workInProgress, treeForkCount, slotIndex); + } } workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber, + a: { + var elementType = workInProgress.elementType; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + var props = workInProgress.pendingProps; + var Component = callLazyInitInDEV(elementType); + workInProgress.type = Component; + if ("function" === typeof Component) + if (shouldConstruct(Component)) { + var resolvedProps = resolveClassComponentProps( + Component, + props, !1 - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( + ); + workInProgress.tag = 1; + workInProgress.type = Component = + resolveFunctionForHotReloading(Component); + var JSCompiler_inline_result = updateClassComponent( null, workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - )), - (workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - ); - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, + Component, + resolvedProps, renderLanes ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - returnFiber = disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current, - returnFiber - ); - workInProgress.tag = 14; - workInProgress = updateMemoComponent( + } else { + var _resolvedProps = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 0; + validateFunctionComponentInDev(workInProgress, Component); + workInProgress.type = Component = + resolveFunctionForHotReloading(Component); + JSCompiler_inline_result = updateFunctionComponent( null, workInProgress, - current, - disableDefaultPropsExceptForClasses - ? returnFiber - : resolveDefaultPropsOnNonClassComponent( - current.type, - returnFiber - ), + Component, + _resolvedProps, 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?"); - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); + else { + if (void 0 !== Component && null !== Component) { + var $$typeof = Component.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) { + var _resolvedProps2 = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 11; + workInProgress.type = Component = + resolveForwardRefForHotReloading(Component); + JSCompiler_inline_result = updateForwardRef( + null, + workInProgress, + Component, + _resolvedProps2, + renderLanes + ); + break a; + } else if ($$typeof === REACT_MEMO_TYPE) { + var _resolvedProps3 = disableDefaultPropsExceptForClasses + ? props + : resolveDefaultPropsOnNonClassComponent(Component, props); + workInProgress.tag = 14; + JSCompiler_inline_result = updateMemoComponent( + null, + workInProgress, + Component, + disableDefaultPropsExceptForClasses + ? _resolvedProps3 + : resolveDefaultPropsOnNonClassComponent( + Component.type, + _resolvedProps3 + ), + renderLanes + ); + break a; + } + } + var hint = ""; + null !== Component && + "object" === typeof Component && + Component.$$typeof === REACT_LAZY_TYPE && + (hint = + " Did you wrap a component in React.lazy() more than once?"); + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + + hint + ); + } } - return workInProgress; + return JSCompiler_inline_result; case 0: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = + var Component$jscomp$0 = workInProgress.type, + unresolvedProps = workInProgress.pendingProps, + resolvedProps$jscomp$0 = disableDefaultPropsExceptForClasses || - workInProgress.elementType === returnFiber - ? prevSibling + workInProgress.elementType === Component$jscomp$0 + ? unresolvedProps : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - updateFunctionComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + Component$jscomp$0, + unresolvedProps + ); + return updateFunctionComponent( + current, + workInProgress, + Component$jscomp$0, + resolvedProps$jscomp$0, + renderLanes ); case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, + var _Component = workInProgress.type, + _resolvedProps4 = resolveClassComponentProps( + _Component, workInProgress.pendingProps, - workInProgress.elementType === returnFiber - )), - updateClassComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + workInProgress.elementType === _Component + ); + return updateClassComponent( + current, + workInProgress, + _Component, + _resolvedProps4, + renderLanes ); case 3: a: { @@ -10135,330 +10293,325 @@ __DEV__ && throw Error( "Should have a current fiber. This is a bug in React." ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; + var nextProps = workInProgress.pendingProps, + prevState = workInProgress.memoizedState, + prevChildren = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions, workInProgress); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && + var nextCache = nextState.cache; + pushProvider(workInProgress, CacheContext, nextCache); + nextCache !== prevState.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); + var nextChildren = nextState.element; + if (prevState.isDehydrated) { + var overrideState = { + element: nextChildren, + isDehydrated: !1, + cache: nextState.cache + }; + workInProgress.updateQueue.baseState = overrideState; + workInProgress.memoizedState = overrideState; + if (workInProgress.flags & 256) { + var JSCompiler_inline_result$jscomp$0 = + mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ); break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( + } else if (nextChildren !== prevChildren) { + var recoverableError = createCapturedValueAtFiber( Error( "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." ), workInProgress ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); + queueHydrationError(recoverableError); + JSCompiler_inline_result$jscomp$0 = + mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ); break a; - } else + } else { + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ); + hydrationParentFiber = workInProgress; + isHydrating = !0; + hydrationErrors = null; + didSuspendOrErrorDEV = !1; + hydrationDiffRootDEV = null; + rootOrSingletonContext = !0; for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( + var child = mountChildFibers( workInProgress, null, - nextProps, + nextChildren, renderLanes ), - workInProgress.child = renderLanes; - renderLanes; + node = (workInProgress.child = child); + node; ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { + (node.flags = (node.flags & -3) | 4096), + (node = node.sibling); + } + } else { resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + if (nextChildren === prevChildren) { + JSCompiler_inline_result$jscomp$0 = + bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } reconcileChildren( current, workInProgress, - nextProps, + nextChildren, renderLanes ); } - workInProgress = workInProgress.child; + JSCompiler_inline_result$jscomp$0 = workInProgress.child; } - return workInProgress; + return JSCompiler_inline_result$jscomp$0; case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(renderLanes)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = current), - setInitialProperties(returnFiber, renderLanes, current), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); + markRef(current, workInProgress); + if (null === current) { + var resource = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + ); + if (resource) workInProgress.memoizedState = resource; + else if (!isHydrating) { + var type = workInProgress.type, + props$jscomp$0 = workInProgress.pendingProps, + rootContainerInstance = requiredContext( + rootInstanceStackCursor.current + ), + domElement = getOwnerDocumentFromRootContainer( + rootContainerInstance + ).createElement(type); + domElement[internalInstanceKey] = workInProgress; + domElement[internalPropsKey] = props$jscomp$0; + setInitialProperties(domElement, type, props$jscomp$0); + markNodeAsHoistable(domElement); + workInProgress.stateNode = domElement; + } + } else + workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + ); + return null; case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( + pushHostContext(workInProgress); + if (null === current && isHydrating) { + var currentRootContainer = requiredContext( + rootInstanceStackCursor.current + ), + currentHostContext = getHostContext(), + instance = (workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( + workInProgress.pendingProps, + currentRootContainer, + currentHostContext, + !1 + )); + if (!didSuspendOrErrorDEV) { + var differences = diffHydratedProperties( + instance, + workInProgress.type, + workInProgress.pendingProps, + currentHostContext + ); + null !== differences && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + differences); + } + hydrationParentFiber = workInProgress; + rootOrSingletonContext = !0; + nextHydratableInstance = getNextHydratable(instance.firstChild); + } + var nextChildren$jscomp$0 = workInProgress.pendingProps.children; + null !== current || isHydrating + ? reconcileChildren( current, workInProgress, - TransitionAwareHostComponent, - null, - null, + nextChildren$jscomp$0, renderLanes - )), - (HostTransitionContext._currentValue = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), - markRef(current, workInProgress), - reconcileChildren( + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren$jscomp$0, + renderLanes + )); + markRef(current, workInProgress); + return workInProgress.child; + case 5: + if (null === current && isHydrating) { + var currentHostContext$jscomp$0 = getHostContext(), + shouldKeepWarning = validateDOMNesting( + workInProgress.type, + currentHostContext$jscomp$0.ancestorInfo + ), + nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if (!(JSCompiler_temp$jscomp$0 = !nextInstance)) { + var instance$jscomp$0 = canHydrateInstance( + nextInstance, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + ); + if (null !== instance$jscomp$0) { + workInProgress.stateNode = instance$jscomp$0; + if (!didSuspendOrErrorDEV) { + var differences$jscomp$0 = diffHydratedProperties( + instance$jscomp$0, + workInProgress.type, + workInProgress.pendingProps, + currentHostContext$jscomp$0 + ); + null !== differences$jscomp$0 && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + differences$jscomp$0); + } + hydrationParentFiber = workInProgress; + nextHydratableInstance = getNextHydratable( + instance$jscomp$0.firstChild + ); + rootOrSingletonContext = !1; + var JSCompiler_inline_result$jscomp$1 = !0; + } else JSCompiler_inline_result$jscomp$1 = !1; + JSCompiler_temp$jscomp$0 = !JSCompiler_inline_result$jscomp$1; + } + JSCompiler_temp$jscomp$0 && + (shouldKeepWarning && + warnNonHydratedInstance(workInProgress, nextInstance), + throwOnHydrationMismatch(workInProgress)); + } + pushHostContext(workInProgress); + var type$jscomp$0 = workInProgress.type, + nextProps$jscomp$0 = workInProgress.pendingProps, + prevProps = null !== current ? current.memoizedProps : null, + nextChildren$jscomp$1 = nextProps$jscomp$0.children; + shouldSetTextContent(type$jscomp$0, nextProps$jscomp$0) + ? (nextChildren$jscomp$1 = null) + : null !== prevProps && + shouldSetTextContent(type$jscomp$0, prevProps) && + (workInProgress.flags |= 32); + if (null !== workInProgress.memoizedState) { + var newState = renderWithHooks( current, workInProgress, - returnFiber, + TransitionAwareHostComponent, + null, + null, renderLanes - ), - workInProgress.child + ); + HostTransitionContext._currentValue = newState; + enableLazyContextPropagation || + (didReceiveUpdate && + null !== current && + current.memoizedState.memoizedState !== newState && + propagateContextChange( + workInProgress, + HostTransitionContext, + renderLanes + )); + } + markRef(current, workInProgress); + reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$1, + renderLanes ); + return workInProgress.child; case 6: - return ( - null === current && - isHydrating && - ((renderLanes = workInProgress.pendingProps), - (current = getHostContext().ancestorInfo.current), - (renderLanes = - null != current - ? validateTextNesting(renderLanes, current.tag) - : !0), - (current = nextHydratableInstance), - (returnFiber = !current) || - ((returnFiber = canHydrateTextInstance( - current, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (renderLanes && - warnNonHydratedInstance(workInProgress, current), - throwOnHydrationMismatch(workInProgress))), - null - ); + if (null === current && isHydrating) { + var text = workInProgress.pendingProps, + ancestor = getHostContext().ancestorInfo.current; + var shouldKeepWarning$jscomp$0 = + null != ancestor ? validateTextNesting(text, ancestor.tag) : !0; + var nextInstance$jscomp$0 = nextHydratableInstance, + JSCompiler_temp$jscomp$1; + if (!(JSCompiler_temp$jscomp$1 = !nextInstance$jscomp$0)) { + var textInstance = canHydrateTextInstance( + nextInstance$jscomp$0, + workInProgress.pendingProps, + rootOrSingletonContext + ); + if (null !== textInstance) { + workInProgress.stateNode = textInstance; + hydrationParentFiber = workInProgress; + nextHydratableInstance = null; + var JSCompiler_inline_result$jscomp$2 = !0; + } else JSCompiler_inline_result$jscomp$2 = !1; + JSCompiler_temp$jscomp$1 = !JSCompiler_inline_result$jscomp$2; + } + JSCompiler_temp$jscomp$1 && + (shouldKeepWarning$jscomp$0 && + warnNonHydratedInstance(workInProgress, nextInstance$jscomp$0), + throwOnHydrationMismatch(workInProgress)); + } + 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 + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo ); + var nextChildren$jscomp$2 = workInProgress.pendingProps; + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren$jscomp$2, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$2, + renderLanes + ); + return workInProgress.child; case 11: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = + var type$jscomp$1 = workInProgress.type, + _unresolvedProps2 = workInProgress.pendingProps, + _resolvedProps5 = disableDefaultPropsExceptForClasses || - workInProgress.elementType === returnFiber - ? prevSibling + workInProgress.elementType === type$jscomp$1 + ? _unresolvedProps2 : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - updateForwardRef( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + type$jscomp$1, + _unresolvedProps2 + ); + return updateForwardRef( + current, + workInProgress, + type$jscomp$1, + _resolvedProps5, + renderLanes ); case 7: return ( @@ -10481,116 +10634,103 @@ __DEV__ && workInProgress.child ); case 12: - return ( - (workInProgress.flags |= 4), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = 0), - (returnFiber.passiveEffectDuration = 0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + workInProgress.flags |= 4; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ); + return workInProgress.child; case 10: a: { - returnFiber = enableRenderableContext + var context = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextState = prevSibling.value; - "value" in prevSibling || + var newProps = workInProgress.pendingProps, + oldProps = workInProgress.memoizedProps, + newValue = newProps.value; + "value" in newProps || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" )); - pushProvider(workInProgress, returnFiber, nextState); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextState)) { + pushProvider(workInProgress, context, newValue); + if (!enableLazyContextPropagation && null !== oldProps) + if (objectIs(oldProps.value, newValue)) { if ( - nextProps.children === prevSibling.children && + oldProps.children === newProps.children && !didPerformWorkStackCursor.current ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + var JSCompiler_inline_result$jscomp$3 = + bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + propagateContextChange(workInProgress, context, renderLanes); reconcileChildren( current, workInProgress, - prevSibling.children, + newProps.children, renderLanes ); - workInProgress = workInProgress.child; + JSCompiler_inline_result$jscomp$3 = workInProgress.child; } - return workInProgress; + return JSCompiler_inline_result$jscomp$3; case 9: - return ( - enableRenderableContext - ? (prevSibling = workInProgress.type._context) - : ((prevSibling = workInProgress.type), - void 0 !== prevSibling._context && - (prevSibling = prevSibling._context)), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress, renderLanes), - (prevSibling = readContext(prevSibling)), - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - enableSchedulingProfiler && markComponentRenderStopped(), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + if (enableRenderableContext) + var context$jscomp$0 = workInProgress.type._context; + else + (context$jscomp$0 = workInProgress.type), + void 0 !== context$jscomp$0._context && + (context$jscomp$0 = context$jscomp$0._context); + var render = workInProgress.pendingProps.children; + "function" !== typeof render && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ); + prepareToReadContext(workInProgress, renderLanes); + var newValue$jscomp$0 = readContext(context$jscomp$0); + enableSchedulingProfiler && + markComponentRenderStarted(workInProgress); + var newChildren = callComponentInDEV( + render, + newValue$jscomp$0, + void 0 ); + enableSchedulingProfiler && markComponentRenderStopped(); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; case 14: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (prevSibling = disableDefaultPropsExceptForClasses - ? prevSibling + var _type = workInProgress.type, + _unresolvedProps3 = workInProgress.pendingProps, + _resolvedProps6 = disableDefaultPropsExceptForClasses + ? _unresolvedProps3 : resolveDefaultPropsOnNonClassComponent( - returnFiber, - prevSibling - )), - (prevSibling = disableDefaultPropsExceptForClasses - ? prevSibling - : resolveDefaultPropsOnNonClassComponent( - returnFiber.type, - prevSibling - )), - updateMemoComponent( - current, - workInProgress, - returnFiber, - prevSibling, - renderLanes - ) + _type, + _unresolvedProps3 + ); + _resolvedProps6 = disableDefaultPropsExceptForClasses + ? _resolvedProps6 + : resolveDefaultPropsOnNonClassComponent( + _type.type, + _resolvedProps6 + ); + return updateMemoComponent( + current, + workInProgress, + _type, + _resolvedProps6, + renderLanes ); case 15: return updateSimpleMemoComponent( @@ -10600,6 +10740,53 @@ __DEV__ && workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + var _Component2 = workInProgress.type, + _resolvedProps7 = resolveClassComponentProps( + _Component2, + workInProgress.pendingProps, + workInProgress.elementType === _Component2 + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + if (isContextProvider(_Component2)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, _Component2, _resolvedProps7); + mountClassInstance( + workInProgress, + _Component2, + _resolvedProps7, + renderLanes + ); + return finishClassComponent( + null, + workInProgress, + _Component2, + !0, + hasContext, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + var _Component3 = workInProgress.type, + _resolvedProps8 = resolveClassComponentProps( + _Component3, + workInProgress.pendingProps, + workInProgress.elementType === _Component3 + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + _Component3, + _resolvedProps8, + renderLanes + ); case 19: return updateSuspenseListComponent( current, @@ -10607,17 +10794,15 @@ __DEV__ && renderLanes ); case 21: - return ( - (returnFiber = workInProgress.pendingProps.children), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + var nextChildren$jscomp$3 = workInProgress.pendingProps.children; + markRef(current, workInProgress); + reconcileChildren( + current, + workInProgress, + nextChildren$jscomp$3, + renderLanes ); + return workInProgress.child; case 22: return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: @@ -10627,94 +10812,96 @@ __DEV__ && renderLanes ); case 24: - return ( - prepareToReadContext(workInProgress, renderLanes), - (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 && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + prepareToReadContext(workInProgress, renderLanes); + var parentCache = readContext(CacheContext); + if (null === current) { + var cacheFromPool = peekCacheFromPool(); + if (null !== cacheFromPool) var freshCache = cacheFromPool; + else { + var root = workInProgressRoot, + freshCache$jscomp$0 = createCache(); + root.pooledCache = freshCache$jscomp$0; + retainCache(freshCache$jscomp$0); + null !== freshCache$jscomp$0 && + (root.pooledCacheLanes |= renderLanes); + freshCache = freshCache$jscomp$0; + } + workInProgress.memoizedState = { + parent: parentCache, + cache: freshCache + }; + initializeUpdateQueue(workInProgress); + pushProvider(workInProgress, CacheContext, freshCache); + } else { + 0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()); + var prevState$jscomp$0 = current.memoizedState, + nextState$jscomp$0 = workInProgress.memoizedState; + if (prevState$jscomp$0.parent !== parentCache) { + var derivedState = { parent: parentCache, cache: parentCache }; + workInProgress.memoizedState = derivedState; + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + derivedState); + pushProvider(workInProgress, CacheContext, parentCache); + } else { + var nextCache$jscomp$0 = nextState$jscomp$0.cache; + pushProvider(workInProgress, CacheContext, nextCache$jscomp$0); + nextCache$jscomp$0 !== prevState$jscomp$0.cache && + propagateContextChange( + workInProgress, + CacheContext, + renderLanes + ); + } + } + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes ); + return workInProgress.child; case 25: - if (enableTransitionTracing) - return ( - enableTransitionTracing - ? (null === current - ? ((returnFiber = enableTransitionTracing - ? transitionStack.current - : null), - null !== returnFiber && - ((returnFiber = { - tag: TransitionTracingMarker, - transitions: new Set(returnFiber), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }), - (workInProgress.stateNode = returnFiber), - (workInProgress.flags |= 2048))) - : current.memoizedProps.name !== - workInProgress.pendingProps.name && - error$jscomp$0( - "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." - ), - (returnFiber = workInProgress.stateNode), - null !== returnFiber && - pushMarkerInstance(workInProgress, returnFiber), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - (workInProgress = workInProgress.child)) - : (workInProgress = null), - workInProgress - ); + if (enableTransitionTracing) { + if (enableTransitionTracing) { + if (null === current) { + var currentTransitions = enableTransitionTracing + ? transitionStack.current + : null; + if (null !== currentTransitions) { + var markerInstance = { + tag: TransitionTracingMarker, + transitions: new Set(currentTransitions), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }; + workInProgress.stateNode = markerInstance; + workInProgress.flags |= 2048; + } + } else + current.memoizedProps.name !== + workInProgress.pendingProps.name && + error$jscomp$0( + "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." + ); + var instance$jscomp$1 = workInProgress.stateNode; + null !== instance$jscomp$1 && + pushMarkerInstance(workInProgress, instance$jscomp$1); + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ); + var JSCompiler_inline_result$jscomp$4 = workInProgress.child; + } else JSCompiler_inline_result$jscomp$4 = null; + return JSCompiler_inline_result$jscomp$4; + } break; case 29: throw workInProgress.pendingProps; @@ -11322,6 +11509,8 @@ __DEV__ && var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -11752,6 +11941,11 @@ __DEV__ && bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(workInProgress); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor, workInProgress); _type = workInProgress.memoizedState; @@ -11874,14 +12068,14 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & OffscreenLane) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & OffscreenLane) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (newProps = workInProgress.updateQueue), null !== newProps && scheduleRetryEffect(workInProgress, newProps.retryQueue), @@ -11917,6 +12111,8 @@ __DEV__ && bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error( "Unknown unit of work tag (" + @@ -12077,20 +12273,30 @@ __DEV__ && (executionContext & CommitContext) !== NoContext ); } - function callComponentWillUnmountWithTimer(current, instance) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + try { + if ( + ((instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + )), + (instance.state = current.memoizedState), + shouldProfile(current)) + ) + try { + startLayoutEffectTimer(), instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + else instance.componentWillUnmount(); + } catch (error$7) { + captureCommitPhaseError(current, nearestMountedAncestor, error$7); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -12193,7 +12399,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$45) { + } catch (e$50) { JSCompiler_temp = null; break a; } @@ -12377,23 +12583,8 @@ __DEV__ && (current.__reactInternalSnapshotBeforeUpdate = flags)); break; case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - current === DOCUMENT_NODE) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } + 0 !== (flags & 1024) && + clearContainer(finishedWork.stateNode.containerInfo); break; case 5: case 26: @@ -12843,30 +13034,40 @@ __DEV__ && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevState = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevState) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevState; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else + recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -13329,21 +13530,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -13360,15 +13555,21 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -13962,13 +14163,15 @@ __DEV__ && safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + disableLegacyMode || finishedWork.mode & 1 + ? ((suspenseCallback = offscreenSubtreeIsHidden), + (retryQueue = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = suspenseCallback || domElement), + (offscreenSubtreeWasHidden = retryQueue || newProps), + recursivelyTraverseMutationEffects(root, finishedWork, lanes), + (offscreenSubtreeWasHidden = retryQueue), + (offscreenSubtreeIsHidden = suspenseCallback)) + : recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -13984,7 +14187,8 @@ __DEV__ && null === current || newProps || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -14205,18 +14409,12 @@ __DEV__ && case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -14595,12 +14793,20 @@ __DEV__ && committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -14723,12 +14929,21 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -15128,6 +15343,76 @@ __DEV__ && ))); } } + function invokeLayoutEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Layout | HasEffect, fiber); + } catch (error$40) { + captureCommitPhaseError(fiber, fiber.return, error$40); + } + break; + case 1: + var instance = fiber.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error$41) { + captureCommitPhaseError(fiber, fiber.return, error$41); + } + } + } + function invokePassiveEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Passive | HasEffect, fiber); + } catch (error$42) { + captureCommitPhaseError(fiber, fiber.return, error$42); + } + } + } + function invokeLayoutEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Layout | HasEffect, + fiber, + fiber.return + ); + } catch (error$43) { + captureCommitPhaseError(fiber, fiber.return, error$43); + } + break; + case 1: + var instance = fiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount(fiber, fiber.return, instance); + } + } + function invokePassiveEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Passive | HasEffect, + fiber, + fiber.return + ); + } catch (error$44) { + captureCommitPhaseError(fiber, fiber.return, error$44); + } + } + } function findFiberRootForHostRoot(hostRoot) { var maybeFiber = getClosestInstanceFromNode(hostRoot) || null; if (null != maybeFiber) { @@ -15315,6 +15600,13 @@ __DEV__ && return commitHook(); }); } + function isLegacyActEnvironment() { + var isReactActEnvironmentGlobal = + "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT + ? IS_REACT_ACT_ENVIRONMENT + : void 0; + return "undefined" !== typeof jest && !1 !== isReactActEnvironmentGlobal; + } function isConcurrentActEnvironment() { var isReactActEnvironmentGlobal = "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT @@ -15402,15 +15694,17 @@ __DEV__ && )); } function requestUpdateLane(fiber) { + var mode = fiber.mode; + if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; 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), + mode = ReactSharedInternals.T; + return null !== mode + ? (mode._updatedFibers || (mode._updatedFibers = new Set()), + mode._updatedFibers.add(fiber), (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane()) : resolveUpdatePriority(); @@ -15455,10 +15749,10 @@ __DEV__ && "Unknown"; didWarnAboutUpdateInRenderForAnotherComponent.has(root) || (didWarnAboutUpdateInRenderForAnotherComponent.add(root), - (lane = getComponentNameFromFiber(fiber) || "Unknown"), + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), error$jscomp$0( "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", - lane, + fiber, root, root )); @@ -15473,20 +15767,21 @@ __DEV__ && } else { isDevToolsPresent && addFiberToLanesMap(root, fiber, lane); warnIfUpdatesNotWrappedWithActDEV(fiber); - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now$1()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index = 31 - clz32(lane), - transitions = transitionLanesMap[index]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now$1()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index = 31 - clz32(lane), + transitions = transitionLanesMap[index]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index] = transitions; + } } root === workInProgressRoot && ((executionContext & RenderContext) === NoContext && @@ -15498,6 +15793,13 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); + lane !== SyncLane || + executionContext !== NoContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ReactSharedInternals.isBatchingLegacy || + ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -15730,7 +16032,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$40) { + } catch (error$45) { return !1; } } @@ -15786,7 +16088,7 @@ __DEV__ && currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { + if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -15825,6 +16127,20 @@ __DEV__ && ensureRootIsScheduled(root); return null; } + function batchedUpdates$1(fn, a) { + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + executionContext !== NoContext || + ReactSharedInternals.isBatchingLegacy || + ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } + } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(!1), !1) @@ -16039,8 +16355,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$41) { - handleThrow(root, thrownValue$41); + } catch (thrownValue$46) { + handleThrow(root, thrownValue$46); } while (1); lanes && root.shellSuspendCounter++; @@ -16182,8 +16498,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$42) { - handleThrow(root, thrownValue$42); + } catch (thrownValue$47) { + handleThrow(root, thrownValue$47); } while (1); resetContextDependencies(); @@ -16327,9 +16643,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$43) { + } catch (error$48) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$43); + throw ((workInProgress = returnFiber), error$48); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -16557,7 +16873,7 @@ __DEV__ && (rootWithPassiveNestedUpdates = null)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); + transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); @@ -16576,7 +16892,8 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) && + 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && @@ -16703,7 +17020,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); - commitDoubleInvokeEffectsInDEV(root); + commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(!1); if (enableTransitionTracing) { @@ -16841,7 +17158,8 @@ __DEV__ && : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); - isConcurrentActEnvironment() && + (disableLegacyMode || 0 !== root.tag) && + isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && error$jscomp$0( "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" @@ -16859,7 +17177,12 @@ __DEV__ && ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) + ? claimNextRetryLane() + : SyncLane)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -16970,17 +17293,52 @@ __DEV__ && reconnectPassiveEffects(root, fiber, 0, null, !1); setIsStrictModeForDevtools(!1); } - function commitDoubleInvokeEffectsInDEV(root) { - var doubleInvokeEffects = !0; - root.current.mode & 24 || (doubleInvokeEffects = !1); - recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root, - root.current, - doubleInvokeEffects - ); + function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { + disableLegacyMode || 0 !== root.tag + ? ((hasPassiveEffects = !0), + (!disableLegacyMode && 1 !== root.tag) || + root.current.mode & 24 || + (hasPassiveEffects = !1), + recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + root.current, + hasPassiveEffects + )) + : runWithFiberInDEV( + root.current, + legacyCommitDoubleInvokeEffectsInDEV, + root.current, + hasPassiveEffects + ); + } + function legacyCommitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectUnmountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, invokePassiveEffectUnmountInDEV); + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectMountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, 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))); + } } function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { - if ((executionContext & RenderContext) === NoContext) { + if ( + (executionContext & RenderContext) === NoContext && + (disableLegacyMode || fiber.mode & 1) + ) { var tag = fiber.tag; if ( 3 === tag || @@ -17016,8 +17374,15 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - isConcurrentActEnvironment() && - null === ReactSharedInternals.actQueue && + if (disableLegacyMode || fiber.mode & 1) { + if (!isConcurrentActEnvironment()) return; + } else if ( + !isLegacyActEnvironment() || + executionContext !== NoContext || + (0 !== fiber.tag && 11 !== fiber.tag && 15 !== fiber.tag) + ) + return; + null === ReactSharedInternals.actQueue && runWithFiberInDEV(fiber, function () { error$jscomp$0( "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", @@ -17390,10 +17755,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -17611,7 +17978,7 @@ __DEV__ && onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -17651,16 +18018,30 @@ __DEV__ && for ( this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], - tag = 0; - tag < TotalLanes; - tag++ + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; tag < TotalLanes; tag++) containerInfo.push(new Set()); - this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + for ( + identifierPrefix = 0; + identifierPrefix < TotalLanes; + identifierPrefix++ + ) + containerInfo.push(new Set()); + if (disableLegacyMode) + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + else + switch (tag) { + case 1: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case 0: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + } } function createFiberRoot( containerInfo, @@ -17690,11 +18071,13 @@ __DEV__ && containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isDevToolsPresent && (hydrationCallbacks |= 2); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isDevToolsPresent && (tag |= 2); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -17798,6 +18181,61 @@ __DEV__ && } return component.stateNode; } + function createHydrationContainer( + initialChildren, + callback, + containerInfo, + tag, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ) { + initialChildren = createFiberRoot( + containerInfo, + tag, + !0, + initialChildren, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ); + initialChildren.context = getContextForSubtree(null); + containerInfo = initialChildren.current; + tag = requestUpdateLane(containerInfo); + hydrationCallbacks = createUpdate(tag); + hydrationCallbacks.callback = + void 0 !== callback && null !== callback ? callback : null; + enqueueUpdate(containerInfo, hydrationCallbacks, tag); + initialChildren.current.lanes = tag; + markRootUpdated(initialChildren, tag); + ensureRootIsScheduled(initialChildren); + return initialChildren; + } + function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; + } function updateContainerSync( element, container, @@ -17869,6 +18307,17 @@ __DEV__ && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane)); } + function getPublicRootInstance(container) { + container = container.current; + if (!container.child) return null; + switch (container.child.tag) { + case 27: + case 5: + return container.child.stateNode; + default: + return container.child.stateNode; + } + } function markRetryLaneImpl(fiber, retryLane) { fiber = fiber.memoizedState; if (null !== fiber && null !== fiber.dehydrated) { @@ -17902,7 +18351,7 @@ __DEV__ && if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; try { - return fn(a); + return batchedUpdates$1(fn, a, b); } finally { if ( ((isInsideEventHandler = !1), @@ -18593,8 +19042,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$46) { - reportGlobalError(error$46); + } catch (error$51) { + reportGlobalError(error$51); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18615,8 +19064,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$46) { - reportGlobalError(error$46); + } catch (error$51) { + reportGlobalError(error$51); } previousInstance.currentTarget = null; previousInstance = instance; @@ -21644,6 +22093,20 @@ __DEV__ && } while (node); retryIfBlockedOn(suspenseInstance); } + function clearContainer(container) { + var nodeType = container.nodeType; + if (nodeType === DOCUMENT_NODE) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break; + default: + container.textContent = ""; + } + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -21959,6 +22422,16 @@ __DEV__ && ? container.getRootNode() : container.ownerDocument; } + function flushSyncWork() { + if (disableLegacyMode) { + var previousWasRendering = previousDispatcher.f(), + wasRendering = flushSyncWork$1(); + return previousWasRendering || wasRendering; + } + throw Error( + "flushSyncWork should not be called from builds that support legacy mode. This is a bug in React." + ); + } function preconnectAs(rel, href, crossOrigin) { var ownerDocument = globalDocument; if (ownerDocument && "string" === typeof href && href) { @@ -23326,6 +23799,16 @@ __DEV__ && " react-mount-point-unstable " !== node.nodeValue)) ); } + function isValidContainerLegacy(node) { + return !( + !node || + (1 !== node.nodeType && + node.nodeType !== DOCUMENT_NODE && + node.nodeType !== DOCUMENT_FRAGMENT_NODE && + (node.nodeType !== COMMENT_NODE || + " react-mount-point-unstable " !== node.nodeValue)) + ); + } function registerReactDOMEvent( target, domEventName, @@ -23356,6 +23839,30 @@ __DEV__ && "ReactDOM.createEventHandle: setter called on an invalid target. Provide a valid EventTarget or an element managed by React." ); } + function flushSyncImpl(fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = Internals.p; + try { + if ( + ((ReactSharedInternals.T = null), + (Internals.p = DiscreteEventPriority), + fn) + ) + return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (Internals.p = previousUpdatePriority), + Internals.d.f() && + error$jscomp$0( + "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." + ); + } + } + function flushSyncErrorInBuildsThatSupportLegacyMode() { + throw Error( + "Expected this build of React to not support legacy mode but it does. This is a bug in React." + ); + } function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) @@ -23383,6 +23890,37 @@ __DEV__ && ? "`" + thing + "`" : 'something with type "' + typeof thing + '"'; } + function flushSyncFromReconciler(fn) { + (executionContext & (RenderContext | CommitContext)) !== NoContext && + error$jscomp$0( + "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." + ); + a: { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + (executionContext & (RenderContext | CommitContext)) !== NoContext || + flushPassiveEffects(); + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + var JSCompiler_inline_result = fn ? fn() : void 0; + break a; + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + (executionContext = prevExecutionContext), + (executionContext & (RenderContext | CommitContext)) === + NoContext && flushSyncWorkAcrossRoots_impl(!1); + } + JSCompiler_inline_result = void 0; + } + return JSCompiler_inline_result; + } function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; } @@ -23417,6 +23955,122 @@ __DEV__ && null != errorInfo.componentStack ? errorInfo.componentStack : "" }) && defaultOnCaughtError(error, errorInfo); } + function getReactRootElementInContainer(container) { + return container + ? container.nodeType === DOCUMENT_NODE + ? container.documentElement + : container.firstChild + : null; + } + function noopOnRecoverableError() {} + function legacyCreateRootFromDOMContainer( + container, + initialChildren, + parentComponent, + callback, + isHydrationContainer + ) { + if (isHydrationContainer) { + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + var root = createHydrationContainer( + initialChildren, + callback, + container, + 0, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root; + container[internalContainerInstanceKey] = root.current; + listenToAllSupportedEvents( + container.nodeType === COMMENT_NODE ? container.parentNode : container + ); + flushSyncWork$1(); + return root; + } + clearContainer(container); + if ("function" === typeof callback) { + var _originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(_root); + _originalCallback.call(instance); + }; + } + var _root = createFiberRoot( + container, + 0, + !1, + null, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = _root; + container[internalContainerInstanceKey] = _root.current; + listenToAllSupportedEvents( + container.nodeType === COMMENT_NODE ? container.parentNode : container + ); + updateContainerSync(initialChildren, _root, parentComponent, callback); + flushSyncWork$1(); + return _root; + } + function warnOnInvalidCallback(callback) { + null !== callback && + "function" !== typeof callback && + error$jscomp$0( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + ); + } + function legacyRenderSubtreeIntoContainer( + parentComponent, + children, + container, + forceHydrate, + callback + ) { + topLevelUpdateWarnings(container); + warnOnInvalidCallback(void 0 === callback ? null : callback); + var maybeRoot = container._reactRootContainer; + if (maybeRoot) { + var root = maybeRoot; + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + updateContainer(children, root, parentComponent, callback); + } else + root = legacyCreateRootFromDOMContainer( + container, + children, + parentComponent, + callback, + forceHydrate + ); + return getPublicRootInstance(root); + } var Scheduler = require("scheduler"), React = require("react"), assign = Object.assign, @@ -23453,6 +24107,7 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -25981,7 +26636,7 @@ __DEV__ && update.payload = payload; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -26000,7 +26655,7 @@ __DEV__ && update.payload = payload; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -26018,7 +26673,7 @@ __DEV__ && update.tag = ForceUpdate; void 0 !== callback && null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); + (warnOnInvalidCallback$1(callback), (update.callback = callback)); callback = enqueueUpdate(inst, update, lane); null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), @@ -26188,6 +26843,7 @@ __DEV__ && callbacks = [], PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, NoContext = 0, + BatchedContext = 1, RenderContext = 2, CommitContext = 4, RootInProgress = 0, @@ -26345,7 +27001,7 @@ __DEV__ && }); window.addEventListener("test", options$jscomp$0, options$jscomp$0); window.removeEventListener("test", options$jscomp$0, options$jscomp$0); - } catch (e$44) { + } catch (e$49) { passiveBrowserEventsSupported = !1; } var EventListenerWWW = require("EventListener"), @@ -26782,11 +27438,7 @@ __DEV__ && preconnectsSet = new Set(), previousDispatcher = Internals.d; Internals.d = { - f: function () { - var previousWasRendering = previousDispatcher.f(), - wasRendering = flushSyncWork$1(); - return previousWasRendering || wasRendering; - }, + f: disableLegacyMode ? flushSyncWork : previousDispatcher.f, r: function (form) { var formInst = getInstanceFromNode(form); null !== formInst && 5 === formInst.tag && "form" === formInst.type @@ -27049,14 +27701,17 @@ __DEV__ && ), lastScheduledReplayQueue = null, _enabled = !0, - return_targetInst = null; + return_targetInst = null, + flushSync$1 = disableLegacyMode + ? flushSyncImpl + : flushSyncErrorInBuildsThatSupportLegacyMode; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-f0e8164410-20240614" !== isomorphicReactPackageVersion) + if ("19.0.0-www-classic-88959fd54a-20240614" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-classic-f0e8164410-20240614\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-classic-88959fd54a-20240614\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27069,6 +27724,7 @@ __DEV__ && error$jscomp$0( "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills" ); + var flushSync = disableLegacyMode ? flushSync$1 : flushSyncFromReconciler; Internals.findDOMNode = function (componentOrElement) { var fiber = componentOrElement._reactInternals; if (void 0 === fiber) { @@ -27121,12 +27777,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); })({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-dom" }) && canUseDOM && @@ -27161,16 +27817,7 @@ __DEV__ && error$jscomp$0( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function (JSCompiler_OptimizeArgumentsArray_p3) { @@ -27218,6 +27865,33 @@ __DEV__ && throw Error( "Expected ReactFiberErrorDialog.showErrorDialog to be a function." ); + var topLevelUpdateWarnings = function (container) { + if ( + container._reactRootContainer && + container.nodeType !== COMMENT_NODE + ) { + var hostInstance = findCurrentFiberUsingSlowPath( + container._reactRootContainer.current + ); + hostInstance = + null !== hostInstance + ? findCurrentHostFiberWithNoPortalsImpl(hostInstance) + : null; + hostInstance = null === hostInstance ? null : hostInstance.stateNode; + hostInstance && + hostInstance.parentNode !== container && + error$jscomp$0( + "It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container." + ); + } + hostInstance = !!container._reactRootContainer; + (container = getReactRootElementInContainer(container)) && + getInstanceFromNode(container) && + !hostInstance && + error$jscomp$0( + "Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render." + ); + }; assign(Internals, { ReactBrowserEventEmitter: { isEnabled: function () { @@ -27396,25 +28070,7 @@ __DEV__ && ? componentOrElement : findHostInstanceWithWarning(componentOrElement, "findDOMNode"); }; - exports.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if ( - ((ReactSharedInternals.T = null), - (Internals.p = DiscreteEventPriority), - fn) - ) - return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f() && - error$jscomp$0( - "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.flushSync = flushSync; exports.focusWithin = function (hostRoot, selectors) { hostRoot = findFiberRootForHostRoot(hostRoot); selectors = findPaths(hostRoot, selectors); @@ -27510,11 +28166,11 @@ __DEV__ && void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState)); - initialChildren = createFiberRoot( + initialChildren = createHydrationContainer( + initialChildren, + null, container, 1, - !0, - initialChildren, null != options ? options : null, isStrictMode, concurrentUpdatesByDefaultOverride, @@ -27525,15 +28181,6 @@ __DEV__ && transitionCallbacks, formState ); - initialChildren.context = getContextForSubtree(null); - options = initialChildren.current; - isStrictMode = requestUpdateLane(options); - concurrentUpdatesByDefaultOverride = createUpdate(isStrictMode); - concurrentUpdatesByDefaultOverride.callback = null; - enqueueUpdate(options, concurrentUpdatesByDefaultOverride, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); - ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); @@ -27828,24 +28475,80 @@ __DEV__ && })) : Internals.d.m(href)); }; - exports.render = function () { + exports.render = function (element, container, callback) { + if (disableLegacyMode) + throw ( + (error$jscomp$0( + "ReactDOM.render was removed in React 19. Use createRoot instead." + ), + Error("ReactDOM: Unsupported Legacy Mode API.")) + ); error$jscomp$0( - "ReactDOM.render was removed in React 19. Use createRoot instead." + "ReactDOM.render has not been supported since React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot" + ); + if (!isValidContainerLegacy(container)) + throw Error("Target container is not a DOM element."); + container[internalContainerInstanceKey] && + void 0 === container._reactRootContainer && + error$jscomp$0( + "You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?" + ); + return legacyRenderSubtreeIntoContainer( + null, + element, + container, + !1, + callback ); - throw Error("ReactDOM: Unsupported Legacy Mode API."); }; exports.requestFormReset = function (form) { Internals.d.r(form); }; - exports.unmountComponentAtNode = function () { - error$jscomp$0( - "unmountComponentAtNode was removed in React 19. Use root.unmount() instead." - ); - throw Error("ReactDOM: Unsupported Legacy Mode API."); - }; - exports.unstable_batchedUpdates = function (fn, a) { - return fn(a); + exports.unmountComponentAtNode = function (container) { + if (disableLegacyMode) + throw ( + (error$jscomp$0( + "unmountComponentAtNode was removed in React 19. Use root.unmount() instead." + ), + Error("ReactDOM: Unsupported Legacy Mode API.")) + ); + if (!isValidContainerLegacy(container)) + throw Error("Target container is not a DOM element."); + container[internalContainerInstanceKey] && + void 0 === container._reactRootContainer && + error$jscomp$0( + "You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?" + ); + if (container._reactRootContainer) { + var root = container._reactRootContainer, + rootEl = getReactRootElementInContainer(container); + rootEl && + !getInstanceFromNode(rootEl) && + error$jscomp$0( + "unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React." + ); + updateContainerSync(null, root, null, null); + flushSyncWork$1(); + container._reactRootContainer = null; + container[internalContainerInstanceKey] = null; + return !0; + } + root = getReactRootElementInContainer(container); + root = !(!root || !getInstanceFromNode(root)); + container = + 1 === container.nodeType && + isValidContainerLegacy(container.parentNode) && + !!container.parentNode._reactRootContainer; + root && + error$jscomp$0( + "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", + container + ? "You may have accidentally passed in a React root node instead of its container." + : "Instead, have the parent component update its state and rerender in order to remove this component." + ); + return !1; }; + exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_createEventHandle = function (type, options) { function eventHandle(target, callback) { if ("function" !== typeof callback) @@ -27888,5 +28591,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-f0e8164410-20240614"; + exports.version = "19.0.0-www-classic-88959fd54a-20240614"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 9da7deec3b..112bf06e7b 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -26854,11 +26854,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-f0e8164410-20240614" !== isomorphicReactPackageVersion) + if ("19.0.0-www-modern-88959fd54a-20240614" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-modern-f0e8164410-20240614\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-modern-88959fd54a-20240614\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26923,12 +26923,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); })({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-dom" }) && canUseDOM && @@ -27690,5 +27690,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-f0e8164410-20240614"; + exports.version = "19.0.0-www-modern-88959fd54a-20240614"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 69ae1f0b96..412bf91fc8 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -61,6 +61,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -198,6 +199,9 @@ function getComponentNameFromFiber(fiber) { return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -1633,6 +1637,10 @@ function isContextProvider(type) { type = type.childContextTypes; return null !== type && void 0 !== type; } +function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor); +} function pushTopLevelContextObject(fiber, context, didChange) { if (contextStackCursor.current !== emptyContextObject) throw Error(formatProdErrorMessage(168)); @@ -2012,7 +2020,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { do { var didPerformSomeWork = !1; for (var root$26 = firstScheduledRoot; null !== root$26; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root$26.tag)) { var workInProgressRootRenderLanes$28 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$28 = getNextLanes( root$26, @@ -3244,7 +3252,15 @@ function createChildReconciler(shouldTrackSideEffects) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -4326,7 +4342,7 @@ function refreshCache(fiber, seedKey, seedValue) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(); + var lane = requestUpdateLane(provider); fiber = createUpdate(lane); var root$77 = enqueueUpdate(provider, fiber, lane); null !== root$77 && @@ -4344,7 +4360,7 @@ function refreshCache(fiber, seedKey, seedValue) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); + var lane = requestUpdateLane(fiber); action = { lane: lane, revertLane: 0, @@ -4361,7 +4377,7 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), update = { lane: lane, revertLane: 0, @@ -4787,7 +4803,7 @@ var classComponentUpdater = { }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.payload = payload; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4798,7 +4814,7 @@ var classComponentUpdater = { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -4810,7 +4826,7 @@ var classComponentUpdater = { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 2; void 0 !== callback && null !== callback && (update.callback = callback); @@ -4836,6 +4852,33 @@ function checkShouldComponentUpdate( ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; +} function callComponentWillReceiveProps( workInProgress, instance, @@ -4850,6 +4893,41 @@ 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; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); +} function resolveClassComponentProps( Component, baseProps, @@ -4985,6 +5063,36 @@ function initializeClassErrorUpdate(update, root, fiber, errorInfo) { }); }); } +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; +} function throwException( root, returnFiber, @@ -4998,71 +5106,100 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = 3); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - throw Error(formatProdErrorMessage(435, sourceFiber.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && ((root = Error(formatProdErrorMessage(422), { cause: value })), queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) @@ -5077,10 +5214,10 @@ function throwException( (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -5088,54 +5225,62 @@ function throwException( (workInProgressRootExitStatus = 2)), !1 ); - var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); - wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wrapperError]) - : workInProgressRootConcurrentErrors.push(wrapperError); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), - (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), - enqueueCapturedUpdate(sourceFiber, root), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (wrapperError = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== wrapperError && - "function" === typeof wrapperError.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5245,10 +5390,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$93 = workInProgress.stateNode; + root$94 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$93.incompleteTransitions.has(transition)) { + if (!root$94.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5256,11 +5401,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$93.incompleteTransitions.set(transition, markerInstance); + root$94.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$93.incompleteTransitions.forEach(function (markerInstance) { + root$94.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5436,28 +5581,36 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) { renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -5587,7 +5740,7 @@ function replayFunctionComponent( return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -5598,123 +5751,47 @@ function updateClassComponent( pushContextProvider(workInProgress); } else hasContext = !1; prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (isLegacyContextConsumer = Component.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - var instance = new Component(nextProps, context); - workInProgress.memoizedState = - null !== instance.state && void 0 !== instance.state - ? instance.state - : null; - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - instance._reactInternals = workInProgress; - isLegacyContextConsumer && - ((isLegacyContextConsumer = workInProgress.stateNode), - (isLegacyContextConsumer.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (isLegacyContextConsumer.__reactInternalMemoizedMaskedChildContext = - context)); - unmaskedContext = workInProgress.stateNode; - unmaskedContext.props = nextProps; - unmaskedContext.state = workInProgress.memoizedState; - unmaskedContext.refs = {}; - initializeUpdateQueue(workInProgress); - isLegacyContextConsumer = Component.contextType; - "object" === typeof isLegacyContextConsumer && - null !== isLegacyContextConsumer - ? (unmaskedContext.context = readContext(isLegacyContextConsumer)) - : ((isLegacyContextConsumer = isContextProvider(Component) - ? previousContext - : contextStackCursor.current), - (unmaskedContext.context = getMaskedContext( - workInProgress, - isLegacyContextConsumer - ))); - unmaskedContext.state = workInProgress.memoizedState; - isLegacyContextConsumer = Component.getDerivedStateFromProps; - "function" === typeof isLegacyContextConsumer && - (applyDerivedStateFromProps( - 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, - isLegacyContextConsumer, - nextProps - ), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ((isLegacyContextConsumer = unmaskedContext.state), - "function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount(), - isLegacyContextConsumer !== unmaskedContext.state && - classComponentUpdater.enqueueReplaceState( - unmaskedContext, - unmaskedContext.state, - null - ), - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ), - suspendIfUpdateReadFromEntangledAsyncAction(), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof unmaskedContext.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current$jscomp$0) { - unmaskedContext = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - isLegacyContextConsumer = resolveClassComponentProps( - Component, - unresolvedOldProps, - workInProgress.type === workInProgress.elementType - ); - unmaskedContext.props = isLegacyContextConsumer; - var oldContext = unmaskedContext.context; - context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) + unresolvedOldProps, + workInProgress.type === workInProgress.elementType + ); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current), - (context = getMaskedContext(workInProgress, context))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - instance = - "function" === typeof getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate; + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - instance || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== context) && + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, - context + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - unmaskedContext.state = oldState; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || @@ -5729,50 +5806,49 @@ function updateClassComponent( nextProps ), (oldContext = workInProgress.memoizedState)), - (isLegacyContextConsumer = + (oldProps = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - isLegacyContextConsumer, + oldProps, nextProps, oldState, oldContext, - context + contextType )) - ? (instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ("function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount()), - "function" === typeof unmaskedContext.componentDidMount && + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof unmaskedContext.componentDidMount && + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = oldContext), - (unmaskedContext.context = context), - (nextProps = isLegacyContextConsumer)) - : ("function" === typeof unmaskedContext.componentDidMount && + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - unmaskedContext = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - isLegacyContextConsumer = workInProgress.memoizedProps; - context = resolveClassComponentProps( + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( Component, - isLegacyContextConsumer, + oldProps, workInProgress.type === workInProgress.elementType ); - unmaskedContext.props = context; - instance = workInProgress.pendingProps; - unresolvedOldProps = unmaskedContext.context; + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; oldContext = Component.contextType; "object" === typeof oldContext && null !== oldContext ? (oldContext = readContext(oldContext)) @@ -5783,31 +5859,30 @@ function updateClassComponent( oldState = Component.getDerivedStateFromProps; (getDerivedStateFromProps = "function" === typeof oldState || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate) || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((isLegacyContextConsumer !== instance || - unresolvedOldProps !== oldContext) && + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, oldContext )); hasForceUpdate = !1; unresolvedOldProps = workInProgress.memoizedState; - unmaskedContext.state = unresolvedOldProps; - processUpdateQueue(workInProgress, nextProps, unmaskedContext, renderLanes); + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - isLegacyContextConsumer !== instance || + oldProps !== hasNewLifecycles || unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && (applyDerivedStateFromProps( workInProgress, @@ -5816,106 +5891,117 @@ function updateClassComponent( nextProps ), (newState = workInProgress.memoizedState)), - (context = + (contextType = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + contextType, nextProps, unresolvedOldProps, newState, oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillUpdate && - "function" !== typeof unmaskedContext.componentWillUpdate) || - ("function" === typeof unmaskedContext.componentWillUpdate && - unmaskedContext.componentWillUpdate( - nextProps, - newState, - oldContext - ), - "function" === - typeof unmaskedContext.UNSAFE_componentWillUpdate && - unmaskedContext.UNSAFE_componentWillUpdate( + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( nextProps, newState, oldContext )), - "function" === typeof unmaskedContext.componentDidUpdate && + "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate && + "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = newState), - (unmaskedContext.context = oldContext), - (nextProps = context)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - unmaskedContext = nextProps; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); +} +function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes +) { markRef(current$jscomp$0, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - unmaskedContext || nextProps - ? ((unmaskedContext = workInProgress.stateNode), - (current = workInProgress), - (isLegacyContextConsumer = - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? null - : unmaskedContext.render()), - (workInProgress.flags |= 1), - null !== current$jscomp$0 && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - isLegacyContextConsumer, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - isLegacyContextConsumer, - renderLanes - ), - (workInProgress.memoizedState = unmaskedContext.state), - hasContext && invalidateContextProvider(workInProgress, Component, !0), - (current$jscomp$0 = workInProgress.child)) - : (hasContext && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( current$jscomp$0, workInProgress, renderLanes - ))); - return current$jscomp$0; + ) + ); + shouldUpdate = workInProgress.stateNode; + current = workInProgress; + var nextChildren = + didCaptureError && "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -6053,18 +6139,18 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = showFallback.updateQueue), - null === renderLanes + (current = showFallback.updateQueue), + null === current ? (showFallback.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -6113,9 +6199,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { : (reuseSuspenseHandlerOnStack(workInProgress), (showFallback = nextProps.fallback), (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - nextInstance + nextInstance, + 0, + null )), (showFallback = createFiberFromFragment( showFallback, @@ -6128,12 +6216,13 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (showFallback.return = workInProgress), (nextProps.sibling = showFallback), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), (nextProps.childLanes = getRemainingWorkInPrimaryTree( @@ -6238,7 +6327,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { )), (nextInstance._reactRetry = workInProgress), (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), (nextHydratableInstance = getNextHydratable( nextInstance.nextSibling )), @@ -6246,12 +6335,12 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (isHydrating = !0), (hydrationErrors = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && ((idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, @@ -6267,12 +6356,20 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextInstance = workInProgress.mode), (JSCompiler_temp$jscomp$0 = current.child), (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + (didSuspend = { mode: "hidden", children: nextProps.children }), + disableLegacyMode || + 0 !== (nextInstance & 1) || + workInProgress.child === JSCompiler_temp$jscomp$0 + ? ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + didSuspend + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = didSuspend), + (workInProgress.deletions = null)), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -6337,27 +6434,32 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps ); pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -6368,26 +6470,30 @@ function mountSuspenseFallbackChildren( fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || 0 !== (mode & 1) || null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); -} function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -6465,57 +6571,68 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) { nextProps &= 1; } push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } +function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 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; @@ -6685,11 +6802,12 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: + var elementType = workInProgress.elementType; a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); var props = workInProgress.pendingProps; - current = workInProgress.elementType; - var init = current._init; - current = init(current._payload); + current = elementType._init; + current = current(elementType._payload); workInProgress.type = current; if ("function" === typeof current) shouldConstruct(current) @@ -6715,7 +6833,10 @@ function beginWork(current, workInProgress, renderLanes) { ))); else { if (void 0 !== current && null !== current) - if (((init = current.$$typeof), init === REACT_FORWARD_REF_TYPE)) { + if ( + ((elementType = current.$$typeof), + elementType === REACT_FORWARD_REF_TYPE) + ) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6728,7 +6849,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ); break a; - } else if (init === REACT_MEMO_TYPE) { + } else if (elementType === REACT_MEMO_TYPE) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -6751,37 +6872,43 @@ function beginWork(current, workInProgress, renderLanes) { case 0: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), updateFunctionComponent( current, workInProgress, props, - init, + elementType, renderLanes ) ); case 1: return ( (props = workInProgress.type), - (init = resolveClassComponentProps( + (elementType = resolveClassComponentProps( props, workInProgress.pendingProps, workInProgress.elementType === props )), - updateClassComponent(current, workInProgress, props, init, renderLanes) + updateClassComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 3: a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - props = init.element; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6790,19 +6917,19 @@ function beginWork(current, workInProgress, renderLanes) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); nextProps = nextState.cache; pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); nextProps = nextState.element; - if (init.isDehydrated) + if (elementType.isDehydrated) if ( - ((init = { + ((elementType = { element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { workInProgress = mountHostRootWithoutHydrating( @@ -6919,7 +7046,7 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = props = nextHydratableInstance)) + if ((elementType = props = nextHydratableInstance)) (props = canHydrateInstance( props, workInProgress.type, @@ -6931,22 +7058,22 @@ function beginWork(current, workInProgress, renderLanes) { (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable(props.firstChild)), (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); + (elementType = !0)) + : (elementType = !1); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); - init = workInProgress.type; + elementType = workInProgress.type; nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; props = nextProps.children; - shouldSetTextContent(init, nextProps) + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && - shouldSetTextContent(init, nextState) && + shouldSetTextContent(elementType, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((elementType = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6954,11 +7081,11 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = init), + (HostTransitionContext._currentValue = elementType), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== elementType && propagateContextChange( workInProgress, HostTransitionContext, @@ -7006,13 +7133,19 @@ function beginWork(current, workInProgress, renderLanes) { case 11: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - updateForwardRef(current, workInProgress, props, init, renderLanes) + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + updateForwardRef( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 7: return ( @@ -7049,14 +7182,14 @@ function beginWork(current, workInProgress, renderLanes) { props = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + elementType = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextState = init.value; + nextState = elementType.value; pushProvider(workInProgress, props, nextState); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextState)) { if ( - nextProps.children === init.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7067,19 +7200,24 @@ function beginWork(current, workInProgress, renderLanes) { break a; } } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + reconcileChildren( + current, + workInProgress, + elementType.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (props = props(init)), + (elementType = readContext(elementType)), + (props = props(elementType)), (workInProgress.flags |= 1), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -7087,14 +7225,20 @@ function beginWork(current, workInProgress, renderLanes) { case 14: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props.type, init)), - updateMemoComponent(current, workInProgress, props, init, renderLanes) + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props.type, elementType)), + updateMemoComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -7104,6 +7248,47 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(props) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, props, elementType); + mountClassInstance(workInProgress, props, elementType, renderLanes); + return finishClassComponent( + null, + workInProgress, + props, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + props, + elementType, + renderLanes + ); case 19: return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: @@ -7122,34 +7307,38 @@ function beginWork(current, workInProgress, renderLanes) { prepareToReadContext(workInProgress, renderLanes), (props = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((elementType = peekCacheFromPool()), + null === elementType && + ((elementType = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (elementType.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: props, cache: init }), + null !== nextProps && + (elementType.pooledCacheLanes |= renderLanes), + (elementType = nextProps)), + (workInProgress.memoizedState = { + parent: props, + cache: elementType + }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, elementType)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (elementType = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== props - ? ((init = { parent: props, cache: props }), - (workInProgress.memoizedState = init), + elementType.parent !== props + ? ((elementType = { parent: props, cache: props }), + (workInProgress.memoizedState = elementType), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), + elementType), pushProvider(workInProgress, CacheContext, props)) : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), - props !== init.cache && + props !== elementType.cache && propagateContextChange( workInProgress, CacheContext, @@ -7684,14 +7873,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$129 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$129 = lastTailNode), + for (var lastTailNode$137 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$137 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$129 + null === lastTailNode$137 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$129.sibling = null); + : (lastTailNode$137.sibling = null); } } function bubbleProperties(completedWork) { @@ -7701,19 +7890,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags & 31457280), - (subtreeFlags |= child$130.flags & 31457280), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (var child$138 = completedWork.child; null !== child$138; ) + (newChildLanes |= child$138.lanes | child$138.childLanes), + (subtreeFlags |= child$138.subtreeFlags & 31457280), + (subtreeFlags |= child$138.flags & 31457280), + (child$138.return = completedWork), + (child$138 = child$138.sibling); else - for (child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags), - (subtreeFlags |= child$130.flags), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (child$138 = completedWork.child; null !== child$138; ) + (newChildLanes |= child$138.lanes | child$138.childLanes), + (subtreeFlags |= child$138.subtreeFlags), + (subtreeFlags |= child$138.flags), + (child$138.return = completedWork), + (child$138 = child$138.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7722,6 +7911,8 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -7734,8 +7925,7 @@ function completeWork(current, workInProgress, renderLanes) { return bubbleProperties(workInProgress), null; case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null ); @@ -8009,11 +8199,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$142 = null; + var cache$150 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$142 = newProps.memoizedState.cachePool.pool); - cache$142 !== type && (newProps.flags |= 2048); + (cache$150 = newProps.memoizedState.cachePool.pool); + cache$150 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8042,13 +8232,18 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor); type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$142 = type.rendering; - if (null === cache$142) + cache$150 = type.rendering; + if (null === cache$150) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8056,11 +8251,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$142 = findFirstSuspended(current); - if (null !== cache$142) { + cache$150 = findFirstSuspended(current); + if (null !== cache$150) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$142.updateQueue; + current = cache$150.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8085,7 +8280,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$142)), null !== current)) { + if (((current = findFirstSuspended(cache$150)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8095,7 +8290,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$142.alternate && + !cache$150.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8108,13 +8303,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$142.sibling = workInProgress.child), - (workInProgress.child = cache$142)) + ? ((cache$150.sibling = workInProgress.child), + (workInProgress.child = cache$150)) : ((current = type.last), null !== current - ? (current.sibling = cache$142) - : (workInProgress.child = cache$142), - (type.last = cache$142)); + ? (current.sibling = cache$150) + : (workInProgress.child = cache$150), + (type.last = cache$150)); } if (null !== type.tail) return ( @@ -8155,14 +8350,14 @@ function completeWork(current, workInProgress, renderLanes) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -8198,6 +8393,8 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error(formatProdErrorMessage(156, workInProgress.tag)); } @@ -8206,8 +8403,7 @@ function unwindWork(current, workInProgress) { switch (workInProgress.tag) { case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)), + isContextProvider(workInProgress.type) && popContext(), (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) @@ -8287,9 +8483,7 @@ function unwindInterruptedWork(current, interruptedWork) { switch (interruptedWork.tag) { case 1: current = interruptedWork.type.childContextTypes; - null !== current && - void 0 !== current && - (pop(didPerformWorkStackCursor), pop(contextStackCursor)); + null !== current && void 0 !== current && popContext(); break; case 3: popProvider(CacheContext); @@ -8392,8 +8586,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$159) { - captureCommitPhaseError(current, nearestMountedAncestor, error$159); + } catch (error$168) { + captureCommitPhaseError(current, nearestMountedAncestor, error$168); } else ref.current = null; } @@ -8430,7 +8624,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$220) { + } catch (e$229) { JSCompiler_temp = null; break a; } @@ -8562,21 +8756,8 @@ function commitBeforeMutationEffects(root, firstChild) { } break; case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } - } + 0 !== (flags & 1024) && + clearContainer(firstChild.stateNode.containerInfo); break; case 5: case 26: @@ -8711,11 +8892,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$161) { + } catch (error$170) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$161 + error$170 ); } } @@ -8760,25 +8941,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevProps) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -9233,15 +9419,21 @@ function commitDeletionEffectsOnFiber( break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -9253,19 +9445,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$173 = finishedWork.alternate; + var current$182 = finishedWork.alternate; if ( - null !== current$173 && - ((current$173 = current$173.memoizedState), - null !== current$173 && - ((current$173 = current$173.dehydrated), null !== current$173)) + null !== current$182 && + ((current$182 = current$182.memoizedState), + null !== current$182 && + ((current$182 = current$182.dehydrated), null !== current$182)) ) try { - retryIfBlockedOn(current$173); + retryIfBlockedOn(current$182); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$173); + onHydrated && onHydrated(current$182); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9383,8 +9575,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$175) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$175); + } catch (error$184) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$184); } } break; @@ -9557,11 +9749,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$176) { + } catch (error$185) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$176 + error$185 ); } break; @@ -9598,8 +9790,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$177) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$177); + } catch (error$186) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$186); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9609,8 +9801,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + } catch (error$188) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$188); } } flags & 1024 && (needsFormReset = !0); @@ -9625,8 +9817,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$180) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$180); + } catch (error$189) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$189); } } break; @@ -9640,8 +9832,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$181) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$181); + } catch (error$190) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$190); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9673,8 +9865,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); + } catch (error$192) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$192); } flags = finishedWork.updateQueue; null !== flags && @@ -9688,13 +9880,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + disableLegacyMode || finishedWork.mode & 1 + ? ((suspenseCallback = offscreenSubtreeIsHidden), + (retryQueue = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = suspenseCallback || domElement), + (offscreenSubtreeWasHidden = retryQueue || newProps), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = retryQueue), + (offscreenSubtreeIsHidden = suspenseCallback)) + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9710,7 +9904,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null === current || newProps || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) ) @@ -9749,11 +9944,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$164) { + } catch (error$173) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$173 ); } } else if ( @@ -9828,21 +10023,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$165 = JSCompiler_inline_result.stateNode; + var parent$174 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$165, ""), + (setTextContent(parent$174, ""), (JSCompiler_inline_result.flags &= -33)); - var before$166 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$166, parent$165); + var before$175 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$175, parent$174); break; case 3: case 4: - var parent$167 = JSCompiler_inline_result.stateNode.containerInfo, - before$168 = getHostSibling(finishedWork); + var parent$176 = JSCompiler_inline_result.stateNode.containerInfo, + before$177 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$168, - parent$167 + before$177, + parent$176 ); break; default: @@ -9921,7 +10116,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$187 = parentFiber.alternate, + var current$196 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9949,16 +10144,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$187 = finishedWork.updateQueue; - if (null !== current$187) { - var hiddenCallbacks = current$187.shared.hiddenCallbacks; + current$196 = finishedWork.updateQueue; + if (null !== current$196) { + var hiddenCallbacks = current$196.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$187.shared.hiddenCallbacks = null, current$187 = 0; - current$187 < hiddenCallbacks.length; - current$187++ + current$196.shared.hiddenCallbacks = null, current$196 = 0; + current$196 < hiddenCallbacks.length; + current$196++ ) - callCallback(hiddenCallbacks[current$187], finishedRoot); + callCallback(hiddenCallbacks[current$196], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9974,7 +10169,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$187 && + null === current$196 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10212,7 +10407,15 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10310,9 +10513,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$194 = finishedWork.stateNode; + var instance$203 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$194._visibility & 4 + ? instance$203._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10320,11 +10523,20 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) - : ((instance$194._visibility |= 4), + : ((instance$203._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$203._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10337,7 +10549,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$194 + instance$203 ); break; case 24: @@ -10677,12 +10889,12 @@ function findFiberRootForHostRoot(hostRoot) { a: { hostRoot = [hostRoot]; for (maybeFiber = 0; maybeFiber < hostRoot.length; ) { - var current$287 = hostRoot[maybeFiber++]; - if (current$287[internalContainerInstanceKey]) { - hostRoot = getInstanceFromNode(current$287); + var current$296 = hostRoot[maybeFiber++]; + if (current$296[internalContainerInstanceKey]) { + hostRoot = getInstanceFromNode(current$296); break a; } - hostRoot.push.apply(hostRoot, current$287.children); + hostRoot.push.apply(hostRoot, current$296.children); } hostRoot = null; } @@ -10944,14 +11156,16 @@ var legacyErrorBoundariesThatAlreadyFailed = null, pendingPassiveTransitions = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; -function requestUpdateLane() { - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== ReactSharedInternals.T) { - var actionScopeLane = currentEntangledLane; - return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); - } - return resolveUpdatePriority(); +function requestUpdateLane(fiber) { + fiber = fiber.mode; + return disableLegacyMode || 0 !== (fiber & 1) + ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : resolveUpdatePriority() + : 2; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -10976,20 +11190,21 @@ function scheduleUpdateOnFiber(root, fiber, lane) { ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index$11 = 31 - clz32(lane), - transitions = transitionLanesMap[index$11]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index$11] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$11 = 31 - clz32(lane), + transitions = transitionLanesMap[index$11]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$11] = transitions; + } } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -11001,6 +11216,12 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + 0 !== executionContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ((workInProgressRootRenderTargetTime = now() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -11266,7 +11487,7 @@ function performSyncWorkOnRoot(root, lanes) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { + if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -11305,6 +11526,19 @@ function performSyncWorkOnRoot(root, lanes) { ensureRootIsScheduled(root); return null; } +function batchedUpdates$1(fn, a) { + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + 0 === executionContext && + ((workInProgressRootRenderTargetTime = now() + 500), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } +} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(!1), !1) @@ -11468,8 +11702,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$206) { - handleThrow(root, thrownValue$206); + } catch (thrownValue$215) { + handleThrow(root, thrownValue$215); } while (1); lanes && root.shellSuspendCounter++; @@ -11578,8 +11812,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$208) { - handleThrow(root, thrownValue$208); + } catch (thrownValue$217) { + handleThrow(root, thrownValue$217); } while (1); resetContextDependencies(); @@ -11804,12 +12038,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$214 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$223 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$214 && + shouldFireAfterActiveInstanceBlur$223 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11842,7 +12076,9 @@ function commitRootImpl( renderPriorityLevel(remainingLanes.value, { componentStack: remainingLanes.stack }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -11879,7 +12115,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$215 = rootWithPendingPassiveEffects, + var root$224 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11894,7 +12130,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$215, remainingLanes); + releaseRootPooledCache(root$224, remainingLanes); } } return !1; @@ -12019,7 +12255,10 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -12194,10 +12433,12 @@ function createFiberFromTypeAndProps( return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -12367,7 +12608,7 @@ function FiberRootNode( onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -12441,10 +12682,12 @@ function createFiberRoot( containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -12519,6 +12762,73 @@ function findHostInstance(component) { component = findCurrentHostFiber(fiber); return null === component ? null : component.stateNode; } +function createHydrationContainer( + initialChildren, + callback, + containerInfo, + tag, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState +) { + initialChildren = createFiberRoot( + containerInfo, + tag, + !0, + initialChildren, + hydrationCallbacks, + isStrictMode, + concurrentUpdatesByDefaultOverride, + identifierPrefix, + onUncaughtError, + onCaughtError, + onRecoverableError, + transitionCallbacks, + formState + ); + initialChildren.context = getContextForSubtree(null); + containerInfo = initialChildren.current; + tag = requestUpdateLane(containerInfo); + hydrationCallbacks = createUpdate(tag); + hydrationCallbacks.callback = + void 0 !== callback && null !== callback ? callback : null; + enqueueUpdate(containerInfo, hydrationCallbacks, tag); + initialChildren.current.lanes = tag; + markRootUpdated(initialChildren, tag); + ensureRootIsScheduled(initialChildren); + return initialChildren; +} +function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + lane = requestUpdateLane(current); + updateContainerImpl( + current, + lane, + element, + container, + parentComponent, + callback + ); + return lane; +} +function updateContainerSync(element, container, parentComponent, callback) { + 0 === container.tag && flushPassiveEffects(); + updateContainerImpl( + container.current, + 2, + element, + container, + parentComponent, + callback + ); + return 2; +} function updateContainerImpl( rootFiber, lane, @@ -12540,6 +12850,17 @@ function updateContainerImpl( (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane)); } +function getPublicRootInstance(container) { + container = container.current; + if (!container.child) return null; + switch (container.child.tag) { + case 27: + case 5: + return container.child.stateNode; + default: + return container.child.stateNode; + } +} function markRetryLaneImpl(fiber, retryLane) { fiber = fiber.memoizedState; if (null !== fiber && null !== fiber.dehydrated) { @@ -12566,7 +12887,7 @@ function batchedUpdates(fn, a, b) { if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; try { - return fn(a); + return batchedUpdates$1(fn, a, b); } finally { if ( ((isInsideEventHandler = !1), @@ -13097,19 +13418,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$372; + var JSCompiler_inline_result$jscomp$388; if (canUseDOM) { - var isSupported$jscomp$inline_1566 = "oninput" in document; - if (!isSupported$jscomp$inline_1566) { - var element$jscomp$inline_1567 = document.createElement("div"); - element$jscomp$inline_1567.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1566 = - "function" === typeof element$jscomp$inline_1567.oninput; + var isSupported$jscomp$inline_1585 = "oninput" in document; + if (!isSupported$jscomp$inline_1585) { + var element$jscomp$inline_1586 = document.createElement("div"); + element$jscomp$inline_1586.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1585 = + "function" === typeof element$jscomp$inline_1586.oninput; } - JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1566; - } else JSCompiler_inline_result$jscomp$372 = !1; + JSCompiler_inline_result$jscomp$388 = isSupported$jscomp$inline_1585; + } else JSCompiler_inline_result$jscomp$388 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$372 && + JSCompiler_inline_result$jscomp$388 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13518,20 +13839,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1607 = 0; - i$jscomp$inline_1607 < simpleEventPluginEvents.length; - i$jscomp$inline_1607++ + var i$jscomp$inline_1626 = 0; + i$jscomp$inline_1626 < simpleEventPluginEvents.length; + i$jscomp$inline_1626++ ) { - var eventName$jscomp$inline_1608 = - simpleEventPluginEvents[i$jscomp$inline_1607], - domEventName$jscomp$inline_1609 = - eventName$jscomp$inline_1608.toLowerCase(), - capitalizedEvent$jscomp$inline_1610 = - eventName$jscomp$inline_1608[0].toUpperCase() + - eventName$jscomp$inline_1608.slice(1); + var eventName$jscomp$inline_1627 = + simpleEventPluginEvents[i$jscomp$inline_1626], + domEventName$jscomp$inline_1628 = + eventName$jscomp$inline_1627.toLowerCase(), + capitalizedEvent$jscomp$inline_1629 = + eventName$jscomp$inline_1627[0].toUpperCase() + + eventName$jscomp$inline_1627.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1609, - "on" + capitalizedEvent$jscomp$inline_1610 + domEventName$jscomp$inline_1628, + "on" + capitalizedEvent$jscomp$inline_1629 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15014,14 +15335,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$249 in nextProps) { - var propKey = nextProps[propKey$249]; - lastProp = lastProps[propKey$249]; + for (var propKey$258 in nextProps) { + var propKey = nextProps[propKey$258]; + lastProp = lastProps[propKey$258]; if ( - nextProps.hasOwnProperty(propKey$249) && + nextProps.hasOwnProperty(propKey$258) && (null != propKey || null != lastProp) ) - switch (propKey$249) { + switch (propKey$258) { case "type": type = propKey; break; @@ -15050,7 +15371,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$249, + propKey$258, propKey, nextProps, lastProp @@ -15069,7 +15390,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$249 = null; + propKey = value = defaultValue = propKey$258 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15100,7 +15421,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$249 = type; + propKey$258 = type; break; case "defaultValue": defaultValue = type; @@ -15121,15 +15442,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$249 - ? updateOptions(domElement, !!lastProps, propKey$249, !1) + null != propKey$258 + ? updateOptions(domElement, !!lastProps, propKey$258, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$249 = null; + propKey = propKey$258 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15153,7 +15474,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$249 = name; + propKey$258 = name; break; case "defaultValue": propKey = name; @@ -15167,17 +15488,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$249, propKey); + updateTextarea(domElement, propKey$258, propKey); return; case "option": - for (var propKey$265 in lastProps) + for (var propKey$274 in lastProps) if ( - ((propKey$249 = lastProps[propKey$265]), - lastProps.hasOwnProperty(propKey$265) && - null != propKey$249 && - !nextProps.hasOwnProperty(propKey$265)) + ((propKey$258 = lastProps[propKey$274]), + lastProps.hasOwnProperty(propKey$274) && + null != propKey$258 && + !nextProps.hasOwnProperty(propKey$274)) ) - switch (propKey$265) { + switch (propKey$274) { case "selected": domElement.selected = !1; break; @@ -15185,33 +15506,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$265, + propKey$274, null, nextProps, - propKey$249 + propKey$258 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$249 = nextProps[lastDefaultValue]), + ((propKey$258 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$249 !== propKey && - (null != propKey$249 || null != propKey)) + propKey$258 !== propKey && + (null != propKey$258 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$249 && - "function" !== typeof propKey$249 && - "symbol" !== typeof propKey$249; + propKey$258 && + "function" !== typeof propKey$258 && + "symbol" !== typeof propKey$258; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$249, + propKey$258, nextProps, propKey ); @@ -15232,24 +15553,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$270 in lastProps) - (propKey$249 = lastProps[propKey$270]), - lastProps.hasOwnProperty(propKey$270) && - null != propKey$249 && - !nextProps.hasOwnProperty(propKey$270) && - setProp(domElement, tag, propKey$270, null, nextProps, propKey$249); + for (var propKey$279 in lastProps) + (propKey$258 = lastProps[propKey$279]), + lastProps.hasOwnProperty(propKey$279) && + null != propKey$258 && + !nextProps.hasOwnProperty(propKey$279) && + setProp(domElement, tag, propKey$279, null, nextProps, propKey$258); for (checked in nextProps) if ( - ((propKey$249 = nextProps[checked]), + ((propKey$258 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$249 !== propKey && - (null != propKey$249 || null != propKey)) + propKey$258 !== propKey && + (null != propKey$258 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$249) + if (null != propKey$258) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15257,7 +15578,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$249, + propKey$258, nextProps, propKey ); @@ -15265,49 +15586,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$275 in lastProps) - (propKey$249 = lastProps[propKey$275]), - lastProps.hasOwnProperty(propKey$275) && - void 0 !== propKey$249 && - !nextProps.hasOwnProperty(propKey$275) && + for (var propKey$284 in lastProps) + (propKey$258 = lastProps[propKey$284]), + lastProps.hasOwnProperty(propKey$284) && + void 0 !== propKey$258 && + !nextProps.hasOwnProperty(propKey$284) && setPropOnCustomElement( domElement, tag, - propKey$275, + propKey$284, void 0, nextProps, - propKey$249 + propKey$258 ); for (defaultChecked in nextProps) - (propKey$249 = nextProps[defaultChecked]), + (propKey$258 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$249 === propKey || - (void 0 === propKey$249 && void 0 === propKey) || + propKey$258 === propKey || + (void 0 === propKey$258 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$249, + propKey$258, nextProps, propKey ); return; } } - for (var propKey$280 in lastProps) - (propKey$249 = lastProps[propKey$280]), - lastProps.hasOwnProperty(propKey$280) && - null != propKey$249 && - !nextProps.hasOwnProperty(propKey$280) && - setProp(domElement, tag, propKey$280, null, nextProps, propKey$249); + for (var propKey$289 in lastProps) + (propKey$258 = lastProps[propKey$289]), + lastProps.hasOwnProperty(propKey$289) && + null != propKey$258 && + !nextProps.hasOwnProperty(propKey$289) && + setProp(domElement, tag, propKey$289, null, nextProps, propKey$258); for (lastProp in nextProps) - (propKey$249 = nextProps[lastProp]), + (propKey$258 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$249 === propKey || - (null == propKey$249 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$249, nextProps, propKey); + propKey$258 === propKey || + (null == propKey$258 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$258, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15427,6 +15748,20 @@ function clearSuspenseBoundary(parentInstance, suspenseInstance) { } while (node); retryIfBlockedOn(suspenseInstance); } +function clearContainer(container) { + var nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break; + default: + container.textContent = ""; + } +} function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -15652,7 +15987,7 @@ function getHoistableRoot(container) { } var previousDispatcher = Internals.d; Internals.d = { - f: flushSyncWork, + f: disableLegacyMode ? flushSyncWork : previousDispatcher.f, r: requestFormReset, D: prefetchDNS$1, C: preconnect$1, @@ -15663,9 +15998,12 @@ Internals.d = { M: preinitModuleScript }; function flushSyncWork() { - var previousWasRendering = previousDispatcher.f(), - wasRendering = flushSyncWork$1(); - return previousWasRendering || wasRendering; + if (disableLegacyMode) { + var previousWasRendering = previousDispatcher.f(), + wasRendering = flushSyncWork$1(); + return previousWasRendering || wasRendering; + } + throw Error(formatProdErrorMessage(521)); } function requestFormReset(form) { var formInst = getInstanceFromNode(form); @@ -15942,26 +16280,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$289 = getResourcesFromRoot( + var styles$298 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$290 = styles$289.get(type); - resource$290 || + resource$299 = styles$298.get(type); + resource$299 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$290 = { + (resource$299 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$289.set(type, resource$290), - (styles$289 = JSCompiler_inline_result.querySelector( + styles$298.set(type, resource$299), + (styles$298 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$289._p && - ((resource$290.instance = styles$289), - (resource$290.state.loading = 5)), + !styles$298._p && + ((resource$299.instance = styles$298), + (resource$299.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15974,16 +16312,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$289 || + styles$298 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$290.state + resource$299.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$290; + return resource$299; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16080,37 +16418,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$295 = hoistableRoot.querySelector( + var instance$304 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$295) + if (instance$304) return ( (resource.state.loading |= 4), - (resource.instance = instance$295), - markNodeAsHoistable(instance$295), - instance$295 + (resource.instance = instance$304), + markNodeAsHoistable(instance$304), + instance$304 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$295 = ( + instance$304 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$295); - var linkInstance = instance$295; + markNodeAsHoistable(instance$304); + var linkInstance = instance$304; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$295, "link", instance); + setInitialProperties(instance$304, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$295, props.precedence, hoistableRoot); - return (resource.instance = instance$295); + insertStylesheet(instance$304, props.precedence, hoistableRoot); + return (resource.instance = instance$304); case "script": - instance$295 = getScriptKey(props.src); + instance$304 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$295) + getScriptSelectorFromKey(instance$304) )) ) return ( @@ -16119,7 +16457,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$295))) + if ((styleProps = preloadPropsMap.get(instance$304))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16655,7 +16993,7 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(nearestMounted), root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); @@ -17088,6 +17426,16 @@ function isValidContainer(node) { " react-mount-point-unstable " !== node.nodeValue)) ); } +function isValidContainerLegacy(node) { + return !( + !node || + (1 !== node.nodeType && + 9 !== node.nodeType && + 11 !== node.nodeType && + (8 !== node.nodeType || + " react-mount-point-unstable " !== node.nodeValue)) + ); +} function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { if ( 1 !== target.nodeType && @@ -17109,23 +17457,69 @@ function registerReactDOMEvent(target, domEventName, isCapturePhaseListener) { listenerSet.add(listenerSetKey)); } else throw Error(formatProdErrorMessage(369)); } +function flushSyncImpl(fn) { + var previousTransition = ReactSharedInternals.T, + previousUpdatePriority = Internals.p; + try { + if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); + } finally { + (ReactSharedInternals.T = previousTransition), + (Internals.p = previousUpdatePriority), + Internals.d.f(); + } +} +function flushSyncErrorInBuildsThatSupportLegacyMode() { + throw Error( + "Expected this build of React to not support legacy mode but it does. This is a bug in React." + ); +} +var flushSync$1 = disableLegacyMode + ? flushSyncImpl + : flushSyncErrorInBuildsThatSupportLegacyMode; function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1780 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1799 = React.version; if ( - "19.0.0-www-classic-f0e8164410-20240614" !== - isomorphicReactPackageVersion$jscomp$inline_1780 + "19.0.0-www-classic-88959fd54a-20240614" !== + isomorphicReactPackageVersion$jscomp$inline_1799 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1780, - "19.0.0-www-classic-f0e8164410-20240614" + isomorphicReactPackageVersion$jscomp$inline_1799, + "19.0.0-www-classic-88959fd54a-20240614" ) ); +function flushSyncFromReconciler(fn) { + a: { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + 0 !== (executionContext & 6) || + flushPassiveEffects(); + var prevExecutionContext = executionContext; + executionContext |= 1; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + Internals.p = 2; + ReactSharedInternals.T = null; + var JSCompiler_inline_result = fn ? fn() : void 0; + break a; + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + (executionContext = prevExecutionContext), + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); + } + JSCompiler_inline_result = void 0; + } + return JSCompiler_inline_result; +} +var flushSync = disableLegacyMode ? flushSync$1 : flushSyncFromReconciler; Internals.findDOMNode = function (componentOrElement) { return findHostInstance(componentOrElement); }; @@ -17139,17 +17533,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1782 = { +var devToolsConfig$jscomp$inline_1806 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2264 = { - bundleType: devToolsConfig$jscomp$inline_1782.bundleType, - version: devToolsConfig$jscomp$inline_1782.version, - rendererPackageName: devToolsConfig$jscomp$inline_1782.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1782.rendererConfig, +var internals$jscomp$inline_2255 = { + bundleType: devToolsConfig$jscomp$inline_1806.bundleType, + version: devToolsConfig$jscomp$inline_1806.version, + rendererPackageName: devToolsConfig$jscomp$inline_1806.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1806.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17165,26 +17559,26 @@ var internals$jscomp$inline_2264 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1782.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1806.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2265 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2256 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2265.isDisabled && - hook$jscomp$inline_2265.supportsFiber + !hook$jscomp$inline_2256.isDisabled && + hook$jscomp$inline_2256.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2265.inject( - internals$jscomp$inline_2264 + (rendererID = hook$jscomp$inline_2256.inject( + internals$jscomp$inline_2255 )), - (injectedHook = hook$jscomp$inline_2265); + (injectedHook = hook$jscomp$inline_2256); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17194,9 +17588,7 @@ ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) { var root = this._internalRoot; if (null === root) throw Error(formatProdErrorMessage(409)); - var current = root.current, - lane = requestUpdateLane(); - updateContainerImpl(current, lane, children, root, null, null); + updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () { @@ -17204,8 +17596,7 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); - updateContainerImpl(root.current, 2, null, root, null, null); + updateContainerSync(null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -17249,6 +17640,105 @@ function wwwOnCaughtError(error, errorInfo) { null != errorInfo.componentStack ? errorInfo.componentStack : "" }) && defaultOnCaughtError(error); } +function noopOnRecoverableError() {} +function legacyCreateRootFromDOMContainer( + container, + initialChildren, + parentComponent, + callback, + isHydrationContainer +) { + if (isHydrationContainer) { + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root$325); + originalCallback.call(instance); + }; + } + var root$325 = createHydrationContainer( + initialChildren, + callback, + container, + 0, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$325; + container[internalContainerInstanceKey] = root$325.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + flushSyncWork$1(); + return root$325; + } + clearContainer(container); + if ("function" === typeof callback) { + var originalCallback$326 = callback; + callback = function () { + var instance = getPublicRootInstance(root$327); + originalCallback$326.call(instance); + }; + } + var root$327 = createFiberRoot( + container, + 0, + !1, + null, + null, + !1, + !1, + "", + wwwOnUncaughtError, + wwwOnCaughtError, + noopOnRecoverableError, + null, + null + ); + container._reactRootContainer = root$327; + container[internalContainerInstanceKey] = root$327.current; + listenToAllSupportedEvents( + 8 === container.nodeType ? container.parentNode : container + ); + updateContainerSync(initialChildren, root$327, parentComponent, callback); + flushSyncWork$1(); + return root$327; +} +function legacyRenderSubtreeIntoContainer( + parentComponent, + children, + container, + forceHydrate, + callback +) { + var maybeRoot = container._reactRootContainer; + if (maybeRoot) { + var root = maybeRoot; + if ("function" === typeof callback) { + var originalCallback = callback; + callback = function () { + var instance = getPublicRootInstance(root); + originalCallback.call(instance); + }; + } + updateContainer(children, root, parentComponent, callback); + } else + root = legacyCreateRootFromDOMContainer( + container, + children, + parentComponent, + callback, + forceHydrate + ); + return getPublicRootInstance(root); +} assign(Internals, { ReactBrowserEventEmitter: { isEnabled: function () { @@ -17400,17 +17890,7 @@ exports.findDOMNode = function (componentOrElement) { ? componentOrElement : findHostInstance(componentOrElement); }; -exports.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f(); - } -}; +exports.flushSync = flushSync; exports.focusWithin = function (hostRoot, selectors) { hostRoot = findFiberRootForHostRoot(hostRoot); selectors = findPaths(hostRoot, selectors); @@ -17492,11 +17972,11 @@ exports.hydrateRoot = function (container, initialChildren, options) { void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState)); - initialChildren = createFiberRoot( + initialChildren = createHydrationContainer( + initialChildren, + null, container, 1, - !0, - initialChildren, null != options ? options : null, isStrictMode, concurrentUpdatesByDefaultOverride, @@ -17507,15 +17987,6 @@ exports.hydrateRoot = function (container, initialChildren, options) { transitionCallbacks, formState ); - initialChildren.context = getContextForSubtree(null); - options = initialChildren.current; - isStrictMode = requestUpdateLane(); - concurrentUpdatesByDefaultOverride = createUpdate(isStrictMode); - concurrentUpdatesByDefaultOverride.callback = null; - enqueueUpdate(options, concurrentUpdatesByDefaultOverride, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); - ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); @@ -17646,18 +18117,34 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.render = function () { - throw Error(formatProdErrorMessage(509)); +exports.render = function (element, container, callback) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return legacyRenderSubtreeIntoContainer( + null, + element, + container, + !1, + callback + ); }; exports.requestFormReset = function (form) { Internals.d.r(form); }; -exports.unmountComponentAtNode = function () { - throw Error(formatProdErrorMessage(509)); -}; -exports.unstable_batchedUpdates = function (fn, a) { - return fn(a); +exports.unmountComponentAtNode = function (container) { + if (disableLegacyMode) throw Error(formatProdErrorMessage(509)); + if (!isValidContainerLegacy(container)) + throw Error(formatProdErrorMessage(299)); + return container._reactRootContainer + ? (updateContainerSync(null, container._reactRootContainer, null, null), + flushSyncWork$1(), + (container._reactRootContainer = null), + (container[internalContainerInstanceKey] = null), + !0) + : !1; }; +exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_createEventHandle = function (type, options) { function eventHandle(target, callback) { if ("function" !== typeof callback) @@ -17694,4 +18181,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-f0e8164410-20240614"; +exports.version = "19.0.0-www-classic-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 66edd1edef..7ffbecbd97 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -16857,14 +16857,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1770 = React.version; if ( - "19.0.0-www-modern-f0e8164410-20240614" !== + "19.0.0-www-modern-88959fd54a-20240614" !== isomorphicReactPackageVersion$jscomp$inline_1770 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1770, - "19.0.0-www-modern-f0e8164410-20240614" + "19.0.0-www-modern-88959fd54a-20240614" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16883,7 +16883,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1772 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2246 = { @@ -16913,7 +16913,7 @@ var internals$jscomp$inline_2246 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2247 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17435,4 +17435,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-f0e8164410-20240614"; +exports.version = "19.0.0-www-modern-88959fd54a-20240614"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index fc01eea99e..c0e0f7cfcc 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -285,6 +285,9 @@ __DEV__ && return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -2231,6 +2234,10 @@ __DEV__ && scheduleImmediateTask(processRootScheduleInMicrotask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); + !disableLegacyMode && + ReactSharedInternals.isBatchingLegacy && + 0 === root.tag && + (ReactSharedInternals.didScheduleLegacyUpdate = !0); } function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -2238,7 +2245,7 @@ __DEV__ && do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( @@ -3889,7 +3896,15 @@ __DEV__ && thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -4172,8 +4187,9 @@ __DEV__ && currentlyRenderingFiber$1 = null; hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + null === current || + (current.flags & 31457280) === (workInProgress.flags & 31457280) || + (!disableLegacyMode && 0 === (current.mode & 1)) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5746,6 +5762,124 @@ __DEV__ && ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + if ( + "contextType" in ctor && + null !== context && + (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(ctor) + ) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = + void 0 === context + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof context + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; + error$jscomp$0( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(ctor) || "Component", + addendum + ); + } + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + addendum = new ctor(props, context); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + addendum = new ctor(props, context); + } finally { + setIsStrictModeForDevtools(!1); + } + } + props = workInProgress.memoizedState = + null !== addendum.state && void 0 !== addendum.state + ? addendum.state + : null; + addendum.updater = classComponentUpdater; + workInProgress.stateNode = addendum; + addendum._reactInternals = workInProgress; + addendum._reactInternalInstance = fakeInternalInstance; + "function" === typeof ctor.getDerivedStateFromProps && + null === props && + ((props = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUninitializedState.has(props) || + (didWarnAboutUninitializedState.add(props), + error$jscomp$0( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + props, + null === addendum.state ? "null" : "undefined", + props + ))); + if ( + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof addendum.getSnapshotBeforeUpdate + ) { + var foundWillReceivePropsName = (props = null), + foundWillUpdateName = null; + "function" === typeof addendum.componentWillMount && + !0 !== addendum.componentWillMount.__suppressDeprecationWarning + ? (props = "componentWillMount") + : "function" === typeof addendum.UNSAFE_componentWillMount && + (props = "UNSAFE_componentWillMount"); + "function" === typeof addendum.componentWillReceiveProps && + !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning + ? (foundWillReceivePropsName = "componentWillReceiveProps") + : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && + (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); + "function" === typeof addendum.componentWillUpdate && + !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof addendum.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if ( + null !== props || + null !== foundWillReceivePropsName || + null !== foundWillUpdateName + ) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + ctor = + "function" === typeof ctor.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName), + error$jscomp$0( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _componentName, + ctor, + null !== props ? "\n " + props : "", + null !== foundWillReceivePropsName + ? "\n " + foundWillReceivePropsName + : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return addendum; + } function callComponentWillReceiveProps( workInProgress, instance, @@ -5772,6 +5906,192 @@ __DEV__ && null )); } + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode, + name = getComponentNameFromType(ctor) || "Component"; + instance.render || + (ctor.prototype && "function" === typeof ctor.prototype.render + ? error$jscomp$0( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + name + ) + : error$jscomp$0( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + name + )); + !instance.getInitialState || + instance.getInitialState.isReactClassApproved || + instance.state || + error$jscomp$0( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + name + ); + instance.getDefaultProps && + !instance.getDefaultProps.isReactClassApproved && + error$jscomp$0( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + name + ); + instance.propTypes && + error$jscomp$0( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + name + ); + instance.contextType && + error$jscomp$0( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + name + ); + instance.contextTypes && + error$jscomp$0( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + name + ); + ctor.contextType && + ctor.contextTypes && + !didWarnAboutContextTypeAndContextTypes.has(ctor) && + (didWarnAboutContextTypeAndContextTypes.add(ctor), + error$jscomp$0( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + name + )); + "function" === typeof instance.componentShouldUpdate && + error$jscomp$0( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + name + ); + ctor.prototype && + ctor.prototype.isPureReactComponent && + "undefined" !== typeof instance.shouldComponentUpdate && + error$jscomp$0( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(ctor) || "A pure component" + ); + "function" === typeof instance.componentDidUnmount && + error$jscomp$0( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + name + ); + "function" === typeof instance.componentDidReceiveProps && + error$jscomp$0( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + name + ); + "function" === typeof instance.componentWillRecieveProps && + error$jscomp$0( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + name + ); + "function" === typeof instance.UNSAFE_componentWillRecieveProps && + error$jscomp$0( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + name + ); + var hasMutatedProps = instance.props !== newProps; + void 0 !== instance.props && + hasMutatedProps && + error$jscomp$0( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + name + ); + instance.defaultProps && + error$jscomp$0( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + name, + name + ); + "function" !== typeof instance.getSnapshotBeforeUpdate || + "function" === typeof instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor), + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(ctor) + )); + "function" === typeof instance.getDerivedStateFromProps && + error$jscomp$0( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof instance.getDerivedStateFromError && + error$jscomp$0( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + name + ); + "function" === typeof ctor.getSnapshotBeforeUpdate && + error$jscomp$0( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + name + ); + (hasMutatedProps = instance.state) && + ("object" !== typeof hasMutatedProps || isArrayImpl(hasMutatedProps)) && + error$jscomp$0("%s.state: must be set to an object or null", name); + "function" === typeof instance.getChildContext && + "object" !== typeof ctor.childContextTypes && + error$jscomp$0( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + name + ); + instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + name = ctor.contextType; + "object" === typeof name && null !== name + ? (instance.context = readContext(name)) + : ((name = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (instance.context = getMaskedContext(workInProgress, name))); + instance.state === newProps && + ((name = getComponentNameFromType(ctor) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(name) || + (didWarnAboutDirectlyAssigningPropsToState.add(name), + error$jscomp$0( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + name + ))); + workInProgress.mode & 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 && + (error$jscomp$0( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + } function resolveClassComponentProps( Component, baseProps, @@ -5902,6 +6222,36 @@ __DEV__ && )); }); } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } function throwException( root, returnFiber, @@ -5916,81 +6266,115 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - isHydrating && (didSuspendOrErrorDEV = !0); + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 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))); + isHydrating && + (disableLegacyMode || sourceFiber.mode & 1) && + (didSuspendOrErrorDEV = !0); enableDebugTracing && sourceFiber.mode & 4 && - ((sourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(sourceFiber, value)); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ((currentSourceFiber = + getComponentNameFromFiber(sourceFiber) || "Unknown"), + logComponentSuspended(currentSourceFiber, value)); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = RootSuspended); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } throw Error( "Unexpected Suspense handler tag (" + - sourceFiber.tag + + currentSourceFiber.tag + "). This is a bug in React." ); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." + ); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( (didSuspendOrErrorDEV = !0), - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && queueHydrationError( createCapturedValueAtFiber( @@ -6015,10 +6399,10 @@ __DEV__ && (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -6026,7 +6410,7 @@ __DEV__ && (workInProgressRootExitStatus = RootErrored)), !1 ); - var error = createCapturedValueAtFiber( + 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 } @@ -6034,56 +6418,58 @@ __DEV__ && sourceFiber ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [error]) - : workInProgressRootConcurrentErrors.push(error); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), + (returnFiber.lanes |= root), (root = createRootErrorUpdate( - sourceFiber.stateNode, - value, + returnFiber.stateNode, + sourceFiber, root )), - enqueueCapturedUpdate(sourceFiber, root), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (error = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== error && - "function" === typeof error.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === + typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(error))))) + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks( @@ -6416,30 +6802,36 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + else + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -6603,7 +6995,7 @@ __DEV__ && return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -6642,570 +7034,214 @@ __DEV__ && ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - lane = !1; - state = emptyContextObject; - var context = Component.contextType; - if ( - "contextType" in Component && - null !== context && - (void 0 === context || context.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) - ) { - didWarnAboutInvalidateContextType.add(Component); - var addendum = - void 0 === context - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; - error$jscomp$0( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - addendum - ); - } - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((state = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (lane = Component.contextTypes), - (context = (lane = null !== lane && void 0 !== lane) - ? getMaskedContext(workInProgress, state) - : emptyContextObject)); - addendum = new Component(nextProps, context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - addendum = new Component(nextProps, context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - var state$jscomp$0 = (workInProgress.memoizedState = - null !== addendum.state && void 0 !== addendum.state - ? addendum.state - : null); - addendum.updater = classComponentUpdater; - workInProgress.stateNode = addendum; - addendum._reactInternals = workInProgress; - addendum._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state$jscomp$0 && - ((state$jscomp$0 = - getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state$jscomp$0) || - (didWarnAboutUninitializedState.add(state$jscomp$0), - error$jscomp$0( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state$jscomp$0, - null === addendum.state ? "null" : "undefined", - state$jscomp$0 - ))); - if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof addendum.getSnapshotBeforeUpdate - ) { - var foundWillReceivePropsName = (state$jscomp$0 = null), - foundWillUpdateName = null; - "function" === typeof addendum.componentWillMount && - !0 !== addendum.componentWillMount.__suppressDeprecationWarning - ? (state$jscomp$0 = "componentWillMount") - : "function" === typeof addendum.UNSAFE_componentWillMount && - (state$jscomp$0 = "UNSAFE_componentWillMount"); - "function" === typeof addendum.componentWillReceiveProps && - !0 !== addendum.componentWillReceiveProps.__suppressDeprecationWarning - ? (foundWillReceivePropsName = "componentWillReceiveProps") - : "function" === typeof addendum.UNSAFE_componentWillReceiveProps && - (foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"); - "function" === typeof addendum.componentWillUpdate && - !0 !== addendum.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof addendum.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if ( - null !== state$jscomp$0 || - null !== foundWillReceivePropsName || - null !== foundWillUpdateName - ) { - addendum = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(addendum) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(addendum), - error$jscomp$0( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - addendum, - newApiName, - null !== state$jscomp$0 ? "\n " + state$jscomp$0 : "", - null !== foundWillReceivePropsName - ? "\n " + foundWillReceivePropsName - : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); - } - } - lane && - ((lane = workInProgress.stateNode), - (lane.__reactInternalMemoizedUnmaskedChildContext = state), - (lane.__reactInternalMemoizedMaskedChildContext = context)); + if (null === workInProgress.stateNode) + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + constructClassInstance(workInProgress, Component, nextProps), + mountClassInstance(workInProgress, Component, nextProps, renderLanes), + (state = !0); + else if (null === current) { state = workInProgress.stateNode; - lane = getComponentNameFromType(Component) || "Component"; - state.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? error$jscomp$0( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - lane - ) - : error$jscomp$0( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - lane - )); - !state.getInitialState || - state.getInitialState.isReactClassApproved || - state.state || - error$jscomp$0( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - lane - ); - state.getDefaultProps && - !state.getDefaultProps.isReactClassApproved && - error$jscomp$0( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - lane - ); - state.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - lane - ); - state.contextType && - error$jscomp$0( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - lane - ); - state.contextTypes && - error$jscomp$0( - "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", - lane - ); - Component.contextType && - Component.contextTypes && - !didWarnAboutContextTypeAndContextTypes.has(Component) && - (didWarnAboutContextTypeAndContextTypes.add(Component), - error$jscomp$0( - "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", - lane - )); - "function" === typeof state.componentShouldUpdate && - error$jscomp$0( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - lane - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof state.shouldComponentUpdate && - error$jscomp$0( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof state.componentDidUnmount && - error$jscomp$0( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - lane - ); - "function" === typeof state.componentDidReceiveProps && - error$jscomp$0( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - lane - ); - "function" === typeof state.componentWillRecieveProps && - error$jscomp$0( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - lane - ); - "function" === typeof state.UNSAFE_componentWillRecieveProps && - error$jscomp$0( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - lane - ); - context = state.props !== nextProps; - void 0 !== state.props && - context && - error$jscomp$0( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - lane - ); - state.defaultProps && - error$jscomp$0( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - lane, - lane - ); - "function" !== typeof state.getSnapshotBeforeUpdate || - "function" === typeof state.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof state.getDerivedStateFromProps && - error$jscomp$0( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof state.getDerivedStateFromError && - error$jscomp$0( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - lane - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - error$jscomp$0( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - lane - ); - (context = state.state) && - ("object" !== typeof context || isArrayImpl(context)) && - error$jscomp$0("%s.state: must be set to an object or null", lane); - "function" === typeof state.getChildContext && - "object" !== typeof Component.childContextTypes && - error$jscomp$0( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - lane - ); - state = workInProgress.stateNode; - state.props = nextProps; - state.state = workInProgress.memoizedState; - state.refs = {}; - initializeUpdateQueue(workInProgress); - lane = Component.contextType; - "object" === typeof lane && null !== lane - ? (state.context = readContext(lane)) - : ((lane = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (state.context = getMaskedContext(workInProgress, lane))); - state.state === nextProps && - ((lane = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(lane) || - (didWarnAboutDirectlyAssigningPropsToState.add(lane), - error$jscomp$0( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - lane - ))); - workInProgress.mode & 8 && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - state - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - state - ); - state.state = workInProgress.memoizedState; - lane = Component.getDerivedStateFromProps; - "function" === typeof lane && - (applyDerivedStateFromProps( - workInProgress, - Component, - lane, - nextProps - ), - (state.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof state.getSnapshotBeforeUpdate || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ((lane = state.state), - "function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount(), - lane !== state.state && - (error$jscomp$0( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - state, - state.state, - null - )), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state.state = workInProgress.memoizedState)); - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); - state = !0; - } else if (null === current$jscomp$0) - (state = workInProgress.stateNode), - (foundWillUpdateName = workInProgress.memoizedProps), - (lane = resolveClassComponentProps( - Component, - foundWillUpdateName, - workInProgress.type === workInProgress.elementType - )), - (state.props = lane), - (state$jscomp$0 = state.context), - (context = Component.contextType), - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (context = getMaskedContext(workInProgress, context))), - (foundWillReceivePropsName = Component.getDerivedStateFromProps), - (addendum = - "function" === typeof foundWillReceivePropsName || - "function" === typeof state.getSnapshotBeforeUpdate), - (foundWillUpdateName = - workInProgress.pendingProps !== foundWillUpdateName), - addendum || - ("function" !== typeof state.UNSAFE_componentWillReceiveProps && - "function" !== typeof state.componentWillReceiveProps) || - ((foundWillUpdateName || state$jscomp$0 !== context) && - callComponentWillReceiveProps( - workInProgress, - state, - nextProps, - context - )), - (hasForceUpdate = !1), - (newApiName = workInProgress.memoizedState), - (state.state = newApiName), - processUpdateQueue(workInProgress, nextProps, state, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (state$jscomp$0 = workInProgress.memoizedState), - foundWillUpdateName || - newApiName !== state$jscomp$0 || - didPerformWorkStackCursor.current || - hasForceUpdate - ? ("function" === typeof foundWillReceivePropsName && - (applyDerivedStateFromProps( - workInProgress, - Component, - foundWillReceivePropsName, - nextProps - ), - (state$jscomp$0 = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - newApiName, - state$jscomp$0, - context - )) - ? (addendum || - ("function" !== typeof state.UNSAFE_componentWillMount && - "function" !== typeof state.componentWillMount) || - ("function" === typeof state.componentWillMount && - state.componentWillMount(), - "function" === typeof state.UNSAFE_componentWillMount && - state.UNSAFE_componentWillMount()), - "function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = state$jscomp$0)), - (state.props = nextProps), - (state.state = state$jscomp$0), - (state.context = context), - (state = lane)) - : ("function" === typeof state.componentDidMount && - (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && - (workInProgress.flags |= 67108864), - (state = !1)); - else { - state = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - lane = workInProgress.memoizedProps; - context = resolveClassComponentProps( + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps( Component, - lane, + unresolvedOldProps, workInProgress.type === workInProgress.elementType ); - state.props = context; - addendum = workInProgress.pendingProps; - foundWillUpdateName = state.context; - state$jscomp$0 = Component.contextType; - "object" === typeof state$jscomp$0 && null !== state$jscomp$0 - ? (state$jscomp$0 = readContext(state$jscomp$0)) - : ((state$jscomp$0 = isContextProvider(Component) + state.props = lane; + var oldContext = state.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor$1.current), - (state$jscomp$0 = getMaskedContext( - workInProgress, - state$jscomp$0 - ))); - newApiName = Component.getDerivedStateFromProps; - (foundWillReceivePropsName = - "function" === typeof newApiName || - "function" === typeof state.getSnapshotBeforeUpdate) || + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof state.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + hasNewLifecycles || ("function" !== typeof state.UNSAFE_componentWillReceiveProps && "function" !== typeof state.componentWillReceiveProps) || - ((lane !== addendum || foundWillUpdateName !== state$jscomp$0) && + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, state, nextProps, - state$jscomp$0 + contextType )); hasForceUpdate = !1; - foundWillUpdateName = workInProgress.memoizedState; - state.state = foundWillUpdateName; + var oldState = workInProgress.memoizedState; + state.state = oldState; processUpdateQueue(workInProgress, nextProps, state, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - lane !== addendum || - foundWillUpdateName !== newState || + oldContext = workInProgress.memoizedState; + unresolvedOldProps || + oldState !== oldContext || didPerformWorkStackCursor.current || - hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof newApiName && + hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps( workInProgress, Component, - newApiName, + getDerivedStateFromProps, nextProps ), - (newState = workInProgress.memoizedState)), - (context = + (oldContext = workInProgress.memoizedState)), + (lane = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + lane, nextProps, - foundWillUpdateName, + oldState, + oldContext, + contextType + )) + ? (hasNewLifecycles || + ("function" !== typeof state.UNSAFE_componentWillMount && + "function" !== typeof state.componentWillMount) || + ("function" === typeof state.componentWillMount && + state.componentWillMount(), + "function" === typeof state.UNSAFE_componentWillMount && + state.UNSAFE_componentWillMount()), + "function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (state.props = nextProps), + (state.state = oldContext), + (state.context = contextType), + (state = lane)) + : ("function" === typeof state.componentDidMount && + (workInProgress.flags |= 4194308), + 0 !== (workInProgress.mode & 16) && + (workInProgress.flags |= 67108864), + (state = !1)); + } else { + state = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + lane = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( + Component, + lane, + workInProgress.type === workInProgress.elementType + ); + state.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = state.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext + ? (oldContext = readContext(oldContext)) + : ((oldContext = isContextProvider(Component) + ? previousContext + : contextStackCursor$1.current), + (oldContext = getMaskedContext(workInProgress, oldContext))); + oldState = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = + "function" === typeof oldState || + "function" === typeof state.getSnapshotBeforeUpdate) || + ("function" !== typeof state.UNSAFE_componentWillReceiveProps && + "function" !== typeof state.componentWillReceiveProps) || + ((lane !== hasNewLifecycles || unresolvedOldProps !== oldContext) && + callComponentWillReceiveProps( + workInProgress, + state, + nextProps, + oldContext + )); + hasForceUpdate = !1; + unresolvedOldProps = workInProgress.memoizedState; + state.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, state, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + lane !== hasNewLifecycles || + unresolvedOldProps !== newState || + didPerformWorkStackCursor.current || + hasForceUpdate || + (enableLazyContextPropagation && + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof oldState && + (applyDerivedStateFromProps( + workInProgress, + Component, + oldState, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType, + nextProps, + unresolvedOldProps, newState, - state$jscomp$0 + oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (foundWillReceivePropsName || + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (getDerivedStateFromProps || ("function" !== typeof state.UNSAFE_componentWillUpdate && "function" !== typeof state.componentWillUpdate) || ("function" === typeof state.componentWillUpdate && - state.componentWillUpdate( - nextProps, - newState, - state$jscomp$0 - ), + state.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof state.UNSAFE_componentWillUpdate && state.UNSAFE_componentWillUpdate( nextProps, newState, - state$jscomp$0 + oldContext )), "function" === typeof state.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof state.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), (state.props = nextProps), (state.state = newState), - (state.context = state$jscomp$0), - (state = context)) + (state.context = oldContext), + (state = contextType)) : ("function" !== typeof state.componentDidUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof state.getSnapshotBeforeUpdate || - (lane === current$jscomp$0.memoizedProps && - foundWillUpdateName === current$jscomp$0.memoizedState) || + (lane === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (state = !1)); } - context = state; - markRef(current$jscomp$0, workInProgress); - lane = 0 !== (workInProgress.flags & 128); - if (context || lane) { - context = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (lane && "function" !== typeof Component.getDerivedStateFromError) - (addendum = null), (profilerStartTime = -1); - else { - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - addendum = callRenderInDEV(context); - if (workInProgress.mode & 8) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(context); - } finally { - setIsStrictModeForDevtools(!1); - } - } - enableSchedulingProfiler && markComponentRenderStopped(); - } - workInProgress.flags |= 1; - null !== current$jscomp$0 && lane - ? ((lane = addendum), - (workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lane, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - addendum, - renderLanes - ); - workInProgress.memoizedState = context.state; - _instance && invalidateContextProvider(workInProgress, Component, !0); - current$jscomp$0 = workInProgress.child; - } else - _instance && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - )); + current = finishClassComponent( + current, + workInProgress, + Component, + state, + _instance, + renderLanes + ); Component = workInProgress.stateNode; state && Component.props !== nextProps && @@ -7215,7 +7251,76 @@ __DEV__ && getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { + markRef(current$jscomp$0, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && + invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ) + ); + shouldUpdate = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if ( + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ) { + var nextChildren = null; + profilerStartTime = -1; + } else { + enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + nextChildren = callRenderInDEV(shouldUpdate); + if (workInProgress.mode & 8) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(shouldUpdate); + } finally { + setIsStrictModeForDevtools(!1); + } + } + enableSchedulingProfiler && markComponentRenderStopped(); + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((didCaptureError = nextChildren), + (workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + didCaptureError, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -7375,18 +7480,18 @@ __DEV__ && ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = showFallback.updateQueue), - null === renderLanes + (current = showFallback.updateQueue), + null === current ? (showFallback.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -7436,9 +7541,11 @@ __DEV__ && : (reuseSuspenseHandlerOnStack(workInProgress), (showFallback = nextProps.fallback), (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - nextInstance + nextInstance, + 0, + null )), (showFallback = createFiberFromFragment( showFallback, @@ -7451,12 +7558,13 @@ __DEV__ && (showFallback.return = workInProgress), (nextProps.sibling = showFallback), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), @@ -7588,7 +7696,7 @@ __DEV__ && )), registerSuspenseInstanceRetry(nextInstance, workInProgress), (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), supportsHydration && ((nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(nextInstance)), @@ -7598,13 +7706,13 @@ __DEV__ && (didSuspendOrErrorDEV = !1), (hydrationDiffRootDEV = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && (warnIfNotHydrating(), (idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress))), (workInProgress = mountSuspensePrimaryChildren( workInProgress, @@ -7619,12 +7727,30 @@ __DEV__ && nextInstance = workInProgress.mode; JSCompiler_temp$jscomp$0 = current.child; didSuspend = JSCompiler_temp$jscomp$0.sibling; - nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { + var primaryChildProps = { mode: "hidden", children: nextProps.children - }); - nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + }; + disableLegacyMode || + 0 !== (nextInstance & 1) || + workInProgress.child === JSCompiler_temp$jscomp$0 + ? ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + primaryChildProps + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = primaryChildProps), + workInProgress.mode & 2 && + ((nextProps.actualDuration = 0), + (nextProps.actualStartTime = -1), + (nextProps.selfBaseDuration = + JSCompiler_temp$jscomp$0.selfBaseDuration), + (nextProps.treeBaseDuration = + JSCompiler_temp$jscomp$0.treeBaseDuration)), + (workInProgress.deletions = null)); null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7658,36 +7784,33 @@ __DEV__ && cachePool: JSCompiler_temp$jscomp$0 })); showFallback.memoizedState = nextInstance; - if ( - enableTransitionTracing && + enableTransitionTracing && ((nextInstance = enableTransitionTracing ? transitionStack.current : null), - null !== nextInstance) - ) { - JSCompiler_temp$jscomp$0 = enableTransitionTracing - ? markerInstanceStack.current - : null; - didSuspend = showFallback.updateQueue; - var currentOffscreenQueue = current.updateQueue; - null === didSuspend - ? (showFallback.updateQueue = { - transitions: nextInstance, - markerInstances: JSCompiler_temp$jscomp$0, - retryQueue: null - }) - : didSuspend === currentOffscreenQueue - ? (showFallback.updateQueue = { - transitions: nextInstance, - markerInstances: JSCompiler_temp$jscomp$0, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((didSuspend.transitions = nextInstance), - (didSuspend.markerInstances = JSCompiler_temp$jscomp$0)); - } + null !== nextInstance && + ((JSCompiler_temp$jscomp$0 = enableTransitionTracing + ? markerInstanceStack.current + : null), + (didSuspend = showFallback.updateQueue), + (primaryChildProps = current.updateQueue), + null === didSuspend + ? (showFallback.updateQueue = { + transitions: nextInstance, + markerInstances: JSCompiler_temp$jscomp$0, + retryQueue: null + }) + : didSuspend === primaryChildProps + ? (showFallback.updateQueue = { + transitions: nextInstance, + markerInstances: JSCompiler_temp$jscomp$0, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((didSuspend.transitions = nextInstance), + (didSuspend.markerInstances = JSCompiler_temp$jscomp$0)))); showFallback.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -7697,28 +7820,33 @@ __DEV__ && return nextProps; } pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -7729,26 +7857,37 @@ __DEV__ && fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || + 0 !== (mode & 1) || + null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren), + workInProgress.mode & 2 && + ((progressedPrimaryFragment.actualDuration = 0), + (progressedPrimaryFragment.actualStartTime = -1), + (progressedPrimaryFragment.selfBaseDuration = 0), + (progressedPrimaryFragment.treeBaseDuration = 0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); - } function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -7927,59 +8066,69 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + null === current || + ((current.alternate = null), + (workInProgress.alternate = null), + (workInProgress.flags |= 2)); + } function bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -8224,8 +8373,10 @@ __DEV__ && switch (workInProgress.tag) { case 16: a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), (workInProgress.type = current), "function" === typeof current) ) @@ -8829,6 +8980,52 @@ __DEV__ && workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, returnFiber, prevSibling); + mountClassInstance( + workInProgress, + returnFiber, + prevSibling, + renderLanes + ); + return finishClassComponent( + null, + workInProgress, + returnFiber, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ); case 19: return updateSuspenseListComponent( current, @@ -9777,6 +9974,8 @@ __DEV__ && var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -10157,6 +10356,11 @@ __DEV__ && bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(workInProgress); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor, workInProgress); nextResource = workInProgress.memoizedState; @@ -10284,14 +10488,14 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -10327,6 +10531,8 @@ __DEV__ && bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error( "Unknown unit of work tag (" + @@ -10487,20 +10693,30 @@ __DEV__ && (executionContext & CommitContext) !== NoContext ); } - function callComponentWillUnmountWithTimer(current, instance) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + try { + if ( + ((instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + )), + (instance.state = current.memoizedState), + shouldProfile(current)) + ) + try { + startLayoutEffectTimer(), instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + else instance.componentWillUnmount(); + } catch (error$7) { + captureCommitPhaseError(current, nearestMountedAncestor, error$7); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -11143,30 +11359,40 @@ __DEV__ && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevState = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevState) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevState; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else + recursivelyTraverseLayoutEffects( + finishedRoot, + finishedWork, + committedLanes + ); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -11641,21 +11867,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11672,15 +11892,21 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -12181,15 +12407,17 @@ __DEV__ && safelyDetachRef(current, current.return); suspenseCallback = null !== finishedWork.memoizedState; retryQueue = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + if (disableLegacyMode || finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12205,7 +12433,8 @@ __DEV__ && null === current || retryQueue || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), supportsMutation && (null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode)) @@ -12425,18 +12654,12 @@ __DEV__ && case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -12815,12 +13038,20 @@ __DEV__ && committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -12943,12 +13174,21 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -13353,6 +13593,76 @@ __DEV__ && ))); } } + function invokeLayoutEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Layout | HasEffect, fiber); + } catch (error$42) { + captureCommitPhaseError(fiber, fiber.return, error$42); + } + break; + case 1: + var instance = fiber.stateNode; + if ("function" === typeof instance.componentDidMount) + try { + instance.componentDidMount(); + } catch (error$43) { + captureCommitPhaseError(fiber, fiber.return, error$43); + } + } + } + function invokePassiveEffectMountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListMount(Passive | HasEffect, fiber); + } catch (error$44) { + captureCommitPhaseError(fiber, fiber.return, error$44); + } + } + } + function invokeLayoutEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Layout | HasEffect, + fiber, + fiber.return + ); + } catch (error$45) { + captureCommitPhaseError(fiber, fiber.return, error$45); + } + break; + case 1: + var instance = fiber.stateNode; + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount(fiber, fiber.return, instance); + } + } + function invokePassiveEffectUnmountInDEV(fiber) { + switch (fiber.tag) { + case 0: + case 11: + case 15: + try { + commitHookEffectListUnmount( + Passive | HasEffect, + fiber, + fiber.return + ); + } catch (error$46) { + captureCommitPhaseError(fiber, fiber.return, error$46); + } + } + } function findFiberRootForHostRoot(hostRoot) { var maybeFiber = getInstanceFromNode(hostRoot); if (null != maybeFiber) { @@ -13504,6 +13814,16 @@ __DEV__ && return commitHook(); }); } + function isLegacyActEnvironment() { + var isReactActEnvironmentGlobal = + "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT + ? IS_REACT_ACT_ENVIRONMENT + : void 0, + jestIsDefined = "undefined" !== typeof jest; + return ( + warnsIfNotActing && jestIsDefined && !1 !== isReactActEnvironmentGlobal + ); + } function isConcurrentActEnvironment() { var isReactActEnvironmentGlobal = "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT @@ -13590,16 +13910,21 @@ __DEV__ && boundaries )); } + function resetRenderTimer() { + workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; + } function requestUpdateLane(fiber) { + var mode = fiber.mode; + if (!disableLegacyMode && 0 === (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), + mode = ReactSharedInternals.T; + return null !== mode + ? (mode._updatedFibers || (mode._updatedFibers = new Set()), + mode._updatedFibers.add(fiber), (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane()) : resolveUpdatePriority(); @@ -13644,10 +13969,10 @@ __DEV__ && "Unknown"; didWarnAboutUpdateInRenderForAnotherComponent.has(root) || (didWarnAboutUpdateInRenderForAnotherComponent.add(root), - (lane = getComponentNameFromFiber(fiber) || "Unknown"), + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), error$jscomp$0( "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", - lane, + fiber, root, root )); @@ -13662,20 +13987,21 @@ __DEV__ && } else { isDevToolsPresent && addFiberToLanesMap(root, fiber, lane); warnIfUpdatesNotWrappedWithActDEV(fiber); - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now$1()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index = 31 - clz32(lane), - transitions = transitionLanesMap[index]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now$1()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index = 31 - clz32(lane), + transitions = transitionLanesMap[index]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index] = transitions; + } } root === workInProgressRoot && ((executionContext & RenderContext) === NoContext && @@ -13687,6 +14013,13 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + executionContext !== NoContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + ReactSharedInternals.isBatchingLegacy || + (resetRenderTimer(), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -13920,7 +14253,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$42) { + } catch (error$47) { return !1; } } @@ -13976,7 +14309,7 @@ __DEV__ && currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { + if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -14229,8 +14562,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$43) { - handleThrow(root, thrownValue$43); + } catch (thrownValue$48) { + handleThrow(root, thrownValue$48); } while (1); lanes && root.shellSuspendCounter++; @@ -14269,7 +14602,7 @@ __DEV__ && movePendingFibersToMemoized(root, lanes); } workInProgressTransitions = getTransitionsForLanes(root, lanes); - workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; + resetRenderTimer(); prepareFreshStack(root, lanes); } enableDebugTracing && logRenderStarted(lanes); @@ -14378,8 +14711,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$44) { - handleThrow(root, thrownValue$44); + } catch (thrownValue$49) { + handleThrow(root, thrownValue$49); } while (1); resetContextDependencies(); @@ -14523,9 +14856,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$45) { + } catch (error$50) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$45); + throw ((workInProgress = returnFiber), error$50); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -14748,7 +15081,7 @@ __DEV__ && (rootWithPassiveNestedUpdates = null)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); + transitions || commitDoubleInvokeEffectsInDEV(root, !1); onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); @@ -14767,7 +15100,9 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -14890,7 +15225,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); - commitDoubleInvokeEffectsInDEV(root); + commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(!1); if (enableTransitionTracing) { @@ -15019,7 +15354,8 @@ __DEV__ && : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); - isConcurrentActEnvironment() && + (disableLegacyMode || 0 !== root.tag) && + isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && error$jscomp$0( "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" @@ -15037,7 +15373,12 @@ __DEV__ && ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) + ? claimNextRetryLane() + : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -15148,17 +15489,52 @@ __DEV__ && reconnectPassiveEffects(root, fiber, 0, null, !1); setIsStrictModeForDevtools(!1); } - function commitDoubleInvokeEffectsInDEV(root) { - var doubleInvokeEffects = !0; - root.current.mode & 24 || (doubleInvokeEffects = !1); - recursivelyTraverseAndDoubleInvokeEffectsInDEV( - root, - root.current, - doubleInvokeEffects - ); + function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { + disableLegacyMode || 0 !== root.tag + ? ((hasPassiveEffects = !0), + (!disableLegacyMode && 1 !== root.tag) || + root.current.mode & 24 || + (hasPassiveEffects = !1), + recursivelyTraverseAndDoubleInvokeEffectsInDEV( + root, + root.current, + hasPassiveEffects + )) + : runWithFiberInDEV( + root.current, + legacyCommitDoubleInvokeEffectsInDEV, + root.current, + hasPassiveEffects + ); + } + function legacyCommitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectUnmountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, invokePassiveEffectUnmountInDEV); + invokeEffectsInDev(fiber, 67108864, invokeLayoutEffectMountInDEV); + hasPassiveEffects && + invokeEffectsInDev(fiber, 134217728, 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))); + } } function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { - if ((executionContext & RenderContext) === NoContext) { + if ( + (executionContext & RenderContext) === NoContext && + (disableLegacyMode || fiber.mode & 1) + ) { var tag = fiber.tag; if ( 3 === tag || @@ -15194,8 +15570,15 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - isConcurrentActEnvironment() && - null === ReactSharedInternals.actQueue && + if (disableLegacyMode || fiber.mode & 1) { + if (!isConcurrentActEnvironment()) return; + } else if ( + !isLegacyActEnvironment() || + executionContext !== NoContext || + (0 !== fiber.tag && 11 !== fiber.tag && 15 !== fiber.tag) + ) + return; + null === ReactSharedInternals.actQueue && runWithFiberInDEV(fiber, function () { error$jscomp$0( "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", @@ -15582,10 +15965,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -15810,7 +16195,7 @@ __DEV__ && onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -15850,16 +16235,26 @@ __DEV__ && for ( this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], - tag = 0; - 31 > tag; - tag++ + identifierPrefix = 0; + 31 > identifierPrefix; + identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); - this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) + containerInfo.push(new Set()); + if (disableLegacyMode) + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + else + switch (tag) { + case 1: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case 0: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + } } function createFiberRoot( containerInfo, @@ -15889,11 +16284,13 @@ __DEV__ && containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isDevToolsPresent && (hydrationCallbacks |= 2); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isDevToolsPresent && (tag |= 2); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -16077,6 +16474,7 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -16131,9 +16529,9 @@ __DEV__ && scheduleTimeout = $$$config.scheduleTimeout, cancelTimeout = $$$config.cancelTimeout, noTimeout = $$$config.noTimeout, - isPrimaryRenderer = $$$config.isPrimaryRenderer; - $$$config.warnsIfNotActing; - var supportsMutation = $$$config.supportsMutation, + isPrimaryRenderer = $$$config.isPrimaryRenderer, + warnsIfNotActing = $$$config.warnsIfNotActing, + supportsMutation = $$$config.supportsMutation, supportsPersistence = $$$config.supportsPersistence, supportsHydration = $$$config.supportsHydration, getInstanceFromNode = $$$config.getInstanceFromNode, @@ -18164,9 +18562,7 @@ __DEV__ && ensureRootIsScheduled(fiber); (executionContext & (RenderContext | CommitContext)) === NoContext && - ((workInProgressRootRenderTargetTime = - now$1() + RENDER_TIMEOUT_MS), - flushSyncWorkAcrossRoots_impl(!1)); + (resetRenderTimer(), flushSyncWorkAcrossRoots_impl(!1)); } } break; @@ -18178,7 +18574,18 @@ __DEV__ && } }; exports.batchedUpdates = function (fn, a) { - return fn(a); + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + executionContext !== NoContext || + ReactSharedInternals.isBatchingLegacy || + (resetRenderTimer(), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } }; exports.createComponentSelector = function (component) { return { $$typeof: COMPONENT_TYPE, value: component }; @@ -18262,7 +18669,7 @@ __DEV__ && try { testStringCoercion(key); var JSCompiler_inline_result = !1; - } catch (e$46) { + } catch (e$51) { JSCompiler_inline_result = !0; } JSCompiler_inline_result && @@ -18342,8 +18749,7 @@ __DEV__ && } finally { setCurrentUpdatePriority(previousPriority), (ReactSharedInternals.T = prevTransition), - executionContext === NoContext && - (workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS); + executionContext === NoContext && resetRenderTimer(); } }; exports.findAllNodes = findAllNodes; @@ -18469,6 +18875,11 @@ __DEV__ && }; exports.flushPassiveEffects = flushPassiveEffects; exports.flushSyncFromReconciler = function (fn) { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + (executionContext & (RenderContext | CommitContext)) !== NoContext || + flushPassiveEffects(); var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactSharedInternals.T, @@ -18581,7 +18992,7 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); }; exports.isAlreadyRendering = function () { diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index b9994fb8fc..bf3d329fae 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -18371,7 +18371,7 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); }; exports.isAlreadyRendering = function () { diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index 10c2f8b8ff..be465e2b5c 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -145,6 +145,9 @@ module.exports = function ($$$config) { return "SuspenseList"; case 25: return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; case 1: case 0: case 14: @@ -510,6 +513,10 @@ module.exports = function ($$$config) { type = type.childContextTypes; return null !== type && void 0 !== type; } + function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor$1); + } function pushTopLevelContextObject(fiber, context, didChange) { if (contextStackCursor$1.current !== emptyContextObject) throw Error(formatProdErrorMessage(168)); @@ -1082,7 +1089,7 @@ module.exports = function ($$$config) { do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { var workInProgressRootRenderLanes$16 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$16 = getNextLanes( @@ -2319,7 +2326,15 @@ module.exports = function ($$$config) { thenableState$1 = null; return firstChildFiber; } catch (x) { - if (x === SuspenseException) throw x; + if ( + x === SuspenseException || + (!disableLegacyMode && + 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; @@ -3348,7 +3363,7 @@ module.exports = function ($$$config) { switch (provider.tag) { case 24: case 3: - var lane = requestUpdateLane(); + var lane = requestUpdateLane(provider); fiber = createUpdate(lane); var root = enqueueUpdate(provider, fiber, lane); null !== root && @@ -3366,7 +3381,7 @@ module.exports = function ($$$config) { } } function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); + var lane = requestUpdateLane(fiber); action = { lane: lane, revertLane: 0, @@ -3383,7 +3398,7 @@ module.exports = function ($$$config) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), update = { lane: lane, revertLane: 0, @@ -3502,6 +3517,34 @@ module.exports = function ($$$config) { ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : !0; } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = !1, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context + ? (context = readContext(context)) + : ((unmaskedContext = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (isLegacyContextConsumer = ctor.contextTypes), + (context = (isLegacyContextConsumer = + null !== isLegacyContextConsumer && + void 0 !== isLegacyContextConsumer) + ? getMaskedContext(workInProgress, unmaskedContext) + : emptyContextObject)); + ctor = new ctor(props, context); + workInProgress.memoizedState = + null !== ctor.state && void 0 !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return ctor; + } function callComponentWillReceiveProps( workInProgress, instance, @@ -3516,6 +3559,45 @@ module.exports = function ($$$config) { instance.state !== workInProgress && classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = {}; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType + ? (instance.context = readContext(contextType)) + : ((contextType = isContextProvider(ctor) + ? previousContext + : contextStackCursor$1.current), + (instance.context = getMaskedContext(workInProgress, contextType))); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), + (instance.state = workInProgress.memoizedState)); + "function" === typeof ctor.getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ((ctor = instance.state), + "function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount(), + ctor !== instance.state && + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + ), + processUpdateQueue(workInProgress, newProps, instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (instance.state = workInProgress.memoizedState)); + "function" === typeof instance.componentDidMount && + (workInProgress.flags |= 4194308); + } function resolveClassComponentProps( Component, baseProps, @@ -3613,6 +3695,36 @@ module.exports = function ($$$config) { }); }); } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + return ( + suspenseBoundary === returnFiber + ? (suspenseBoundary.flags |= 65536) + : ((suspenseBoundary.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)), + suspenseBoundary + ); + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } function throwException( root, returnFiber, @@ -3626,71 +3738,100 @@ module.exports = function ($$$config) { "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && propagateParentContextChanges( - returnFiber, + currentSourceFiber, sourceFiber, rootRenderLanes, !0 - )); - sourceFiber = suspenseHandlerStackCursor.current; - if (null !== sourceFiber) { - switch (sourceFiber.tag) { + ); + } + currentSourceFiber = sourceFiber.tag; + disableLegacyMode || + 0 !== (sourceFiber.mode & 1) || + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) + : ((sourceFiber.updateQueue = null), + (sourceFiber.memoizedState = null))); + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: - return ( + if (disableLegacyMode || sourceFiber.mode & 1) null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === sourceFiber.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (sourceFiber.flags &= -257), - (sourceFiber.flags |= 65536), - (sourceFiber.lanes = rootRenderLanes), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? (sourceFiber.updateQueue = new Set([value])) - : returnFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 + (workInProgressRootExitStatus = 3); + currentSourceFiber.flags &= -257; + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes ); + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + (disableLegacyMode || currentSourceFiber.mode & 1) && + attachPingListener(root, value, rootRenderLanes)); + return !1; case 22: - return ( - (sourceFiber.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (sourceFiber.flags |= 16384) - : ((returnFiber = sourceFiber.updateQueue), - null === returnFiber - ? ((returnFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (sourceFiber.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([value])) - : sourceFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); + if (disableLegacyMode || currentSourceFiber.mode & 1) + return ( + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (currentSourceFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } - throw Error(formatProdErrorMessage(435, sourceFiber.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + if (disableLegacyMode || 1 === root.tag) + return ( + attachPingListener(root, value, rootRenderLanes), + renderDidSuspendDelayIfPossible(), + !1 + ); + value = Error(formatProdErrorMessage(426)); } - if (isHydrating) + if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) return ( - (returnFiber = suspenseHandlerStackCursor.current), - null !== returnFiber - ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), - (returnFiber.flags |= 65536), - (returnFiber.lanes = rootRenderLanes), + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), value !== HydrationMismatchException && ((root = Error(formatProdErrorMessage(422), { cause: value })), queueHydrationError( @@ -3707,10 +3848,10 @@ module.exports = function ($$$config) { (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), (root.lanes |= rootRenderLanes), - (value = createCapturedValueAtFiber(value, sourceFiber)), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), (rootRenderLanes = createRootErrorUpdate( root.stateNode, - value, + sourceFiber, rootRenderLanes )), enqueueCapturedUpdate(root, rootRenderLanes), @@ -3718,56 +3859,62 @@ module.exports = function ($$$config) { (workInProgressRootExitStatus = 2)), !1 ); - var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); - wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wrapperError]) - : workInProgressRootConcurrentErrors.push(wrapperError); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; - value = createCapturedValueAtFiber(value, sourceFiber); - sourceFiber = returnFiber; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); do { - switch (sourceFiber.tag) { + switch (returnFiber.tag) { case 3: return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (root = rootRenderLanes & -rootRenderLanes), - (sourceFiber.lanes |= root), - (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), - enqueueCapturedUpdate(sourceFiber, root), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: if ( - ((returnFiber = sourceFiber.type), - (wrapperError = sourceFiber.stateNode), - 0 === (sourceFiber.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== wrapperError && - "function" === typeof wrapperError.componentDidCatch && + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has( - wrapperError + currentSourceFiber ))))) ) return ( - (sourceFiber.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (sourceFiber.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - sourceFiber, - value + returnFiber, + sourceFiber ), - enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - sourceFiber = sourceFiber.return; - } while (null !== sourceFiber); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -4075,30 +4222,36 @@ module.exports = function ($$$config) { renderLanes ); } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null, - null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null, + null + ), null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) - ); + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) + ); + else + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && pushTransition(workInProgress, null, null), + reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); } else if (null !== prevState) { nextProps = prevState.cachePool; nextIsDetached = null; @@ -4233,7 +4386,7 @@ module.exports = function ($$$config) { return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -4244,129 +4397,47 @@ module.exports = function ($$$config) { pushContextProvider(workInProgress); } else hasContext = !1; prepareToReadContext(workInProgress, renderLanes); - if (null === workInProgress.stateNode) { - var isLegacyContextConsumer = !1, - unmaskedContext = emptyContextObject; - var context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((unmaskedContext = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (isLegacyContextConsumer = Component.contextTypes), - (context = (isLegacyContextConsumer = - null !== isLegacyContextConsumer && - void 0 !== isLegacyContextConsumer) - ? getMaskedContext(workInProgress, unmaskedContext) - : emptyContextObject)); - var instance = new Component(nextProps, context); - workInProgress.memoizedState = - null !== instance.state && void 0 !== instance.state - ? instance.state - : null; - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - instance._reactInternals = workInProgress; - isLegacyContextConsumer && - ((isLegacyContextConsumer = workInProgress.stateNode), - (isLegacyContextConsumer.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (isLegacyContextConsumer.__reactInternalMemoizedMaskedChildContext = - context)); - unmaskedContext = workInProgress.stateNode; - unmaskedContext.props = nextProps; - unmaskedContext.state = workInProgress.memoizedState; - unmaskedContext.refs = {}; - initializeUpdateQueue(workInProgress); - isLegacyContextConsumer = Component.contextType; - "object" === typeof isLegacyContextConsumer && - null !== isLegacyContextConsumer - ? (unmaskedContext.context = readContext(isLegacyContextConsumer)) - : ((isLegacyContextConsumer = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current), - (unmaskedContext.context = getMaskedContext( - workInProgress, - isLegacyContextConsumer - ))); - unmaskedContext.state = workInProgress.memoizedState; - isLegacyContextConsumer = Component.getDerivedStateFromProps; - "function" === typeof isLegacyContextConsumer && - (applyDerivedStateFromProps( - 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, - isLegacyContextConsumer, - nextProps - ), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate || - ("function" !== typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ((isLegacyContextConsumer = unmaskedContext.state), - "function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount(), - isLegacyContextConsumer !== unmaskedContext.state && - classComponentUpdater.enqueueReplaceState( - unmaskedContext, - unmaskedContext.state, - null - ), - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ), - suspendIfUpdateReadFromEntangledAsyncAction(), - (unmaskedContext.state = workInProgress.memoizedState)); - "function" === typeof unmaskedContext.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current$jscomp$0) { - unmaskedContext = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - isLegacyContextConsumer = resolveClassComponentProps( - Component, - unresolvedOldProps, - workInProgress.type === workInProgress.elementType - ); - unmaskedContext.props = isLegacyContextConsumer; - var oldContext = unmaskedContext.context; - context = Component.contextType; - "object" === typeof context && null !== context - ? (context = readContext(context)) - : ((context = isContextProvider(Component) + unresolvedOldProps, + workInProgress.type === workInProgress.elementType + ); + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType + ? (contextType = readContext(contextType)) + : ((contextType = isContextProvider(Component) ? previousContext : contextStackCursor$1.current), - (context = getMaskedContext(workInProgress, context))); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - instance = - "function" === typeof getDerivedStateFromProps || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate; + (contextType = getMaskedContext(workInProgress, contextType))); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = + "function" === typeof getDerivedStateFromProps || + "function" === typeof instance.getSnapshotBeforeUpdate; unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== context) && + hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, - context + contextType )); hasForceUpdate = !1; var oldState = workInProgress.memoizedState; - unmaskedContext.state = oldState; - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ); + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); oldContext = workInProgress.memoizedState; unresolvedOldProps || @@ -4381,51 +4452,49 @@ module.exports = function ($$$config) { nextProps ), (oldContext = workInProgress.memoizedState)), - (isLegacyContextConsumer = + (oldProps = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - isLegacyContextConsumer, + oldProps, nextProps, oldState, oldContext, - context + contextType )) - ? (instance || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillMount && - "function" !== typeof unmaskedContext.componentWillMount) || - ("function" === typeof unmaskedContext.componentWillMount && - unmaskedContext.componentWillMount(), - "function" === - typeof unmaskedContext.UNSAFE_componentWillMount && - unmaskedContext.UNSAFE_componentWillMount()), - "function" === typeof unmaskedContext.componentDidMount && + ? (hasNewLifecycles || + ("function" !== typeof instance.UNSAFE_componentWillMount && + "function" !== typeof instance.componentWillMount) || + ("function" === typeof instance.componentWillMount && + instance.componentWillMount(), + "function" === typeof instance.UNSAFE_componentWillMount && + instance.UNSAFE_componentWillMount()), + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308)) - : ("function" === typeof unmaskedContext.componentDidMount && + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = oldContext), - (unmaskedContext.context = context), - (nextProps = isLegacyContextConsumer)) - : ("function" === typeof unmaskedContext.componentDidMount && + (instance.props = nextProps), + (instance.state = oldContext), + (instance.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308), (nextProps = !1)); } else { - unmaskedContext = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - isLegacyContextConsumer = workInProgress.memoizedProps; - context = resolveClassComponentProps( + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = resolveClassComponentProps( Component, - isLegacyContextConsumer, + oldProps, workInProgress.type === workInProgress.elementType ); - unmaskedContext.props = context; - instance = workInProgress.pendingProps; - unresolvedOldProps = unmaskedContext.context; + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + unresolvedOldProps = instance.context; oldContext = Component.contextType; "object" === typeof oldContext && null !== oldContext ? (oldContext = readContext(oldContext)) @@ -4436,37 +4505,30 @@ module.exports = function ($$$config) { oldState = Component.getDerivedStateFromProps; (getDerivedStateFromProps = "function" === typeof oldState || - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate) || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillReceiveProps && - "function" !== typeof unmaskedContext.componentWillReceiveProps) || - ((isLegacyContextConsumer !== instance || - unresolvedOldProps !== oldContext) && + "function" === typeof instance.getSnapshotBeforeUpdate) || + ("function" !== typeof instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof instance.componentWillReceiveProps) || + ((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) && callComponentWillReceiveProps( workInProgress, - unmaskedContext, + instance, nextProps, oldContext )); hasForceUpdate = !1; unresolvedOldProps = workInProgress.memoizedState; - unmaskedContext.state = unresolvedOldProps; - processUpdateQueue( - workInProgress, - nextProps, - unmaskedContext, - renderLanes - ); + instance.state = unresolvedOldProps; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); var newState = workInProgress.memoizedState; - isLegacyContextConsumer !== instance || + oldProps !== hasNewLifecycles || unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && (applyDerivedStateFromProps( workInProgress, @@ -4475,106 +4537,118 @@ module.exports = function ($$$config) { nextProps ), (newState = workInProgress.memoizedState)), - (context = + (contextType = hasForceUpdate || checkShouldComponentUpdate( workInProgress, Component, - context, + contextType, nextProps, unresolvedOldProps, newState, oldContext ) || (enableLazyContextPropagation && - null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || - ("function" !== - typeof unmaskedContext.UNSAFE_componentWillUpdate && - "function" !== typeof unmaskedContext.componentWillUpdate) || - ("function" === typeof unmaskedContext.componentWillUpdate && - unmaskedContext.componentWillUpdate( - nextProps, - newState, - oldContext - ), - "function" === - typeof unmaskedContext.UNSAFE_componentWillUpdate && - unmaskedContext.UNSAFE_componentWillUpdate( + ("function" !== typeof instance.UNSAFE_componentWillUpdate && + "function" !== typeof instance.componentWillUpdate) || + ("function" === typeof instance.componentWillUpdate && + instance.componentWillUpdate(nextProps, newState, oldContext), + "function" === typeof instance.UNSAFE_componentWillUpdate && + instance.UNSAFE_componentWillUpdate( nextProps, newState, oldContext )), - "function" === typeof unmaskedContext.componentDidUpdate && + "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), - "function" === typeof unmaskedContext.getSnapshotBeforeUpdate && + "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), - (unmaskedContext.props = nextProps), - (unmaskedContext.state = newState), - (unmaskedContext.context = oldContext), - (nextProps = context)) - : ("function" !== typeof unmaskedContext.componentDidUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + (instance.props = nextProps), + (instance.state = newState), + (instance.context = oldContext), + (nextProps = contextType)) + : ("function" !== typeof instance.componentDidUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 4), - "function" !== typeof unmaskedContext.getSnapshotBeforeUpdate || - (isLegacyContextConsumer === current$jscomp$0.memoizedProps && - unresolvedOldProps === current$jscomp$0.memoizedState) || + "function" !== typeof instance.getSnapshotBeforeUpdate || + (oldProps === current.memoizedProps && + unresolvedOldProps === current.memoizedState) || (workInProgress.flags |= 1024), (nextProps = !1)); } - unmaskedContext = nextProps; + return finishClassComponent( + current, + workInProgress, + Component, + nextProps, + hasContext, + renderLanes + ); + } + function finishClassComponent( + current$jscomp$0, + workInProgress, + Component, + shouldUpdate, + hasContext, + renderLanes + ) { markRef(current$jscomp$0, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - unmaskedContext || nextProps - ? ((unmaskedContext = workInProgress.stateNode), - (current = workInProgress), - (isLegacyContextConsumer = - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? null - : unmaskedContext.render()), - (workInProgress.flags |= 1), - null !== current$jscomp$0 && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - isLegacyContextConsumer, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - isLegacyContextConsumer, - renderLanes - ), - (workInProgress.memoizedState = unmaskedContext.state), - hasContext && invalidateContextProvider(workInProgress, Component, !0), - (current$jscomp$0 = workInProgress.child)) - : (hasContext && invalidateContextProvider(workInProgress, Component, !1), - (current$jscomp$0 = bailoutOnAlreadyFinishedWork( + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) + return ( + hasContext && invalidateContextProvider(workInProgress, Component, !1), + bailoutOnAlreadyFinishedWork( current$jscomp$0, workInProgress, renderLanes - ))); - return current$jscomp$0; + ) + ); + shouldUpdate = workInProgress.stateNode; + current = workInProgress; + var nextChildren = + didCaptureError && + "function" !== typeof Component.getDerivedStateFromError + ? null + : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current$jscomp$0 && didCaptureError + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + nextChildren, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + nextChildren, + renderLanes + ); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, !0); + return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; @@ -4694,18 +4768,18 @@ module.exports = function ($$$config) { ? transitionStack.current : null), null !== workInProgress && - ((current = enableTransitionTracing + ((renderLanes = enableTransitionTracing ? markerInstanceStack.current : null), - (renderLanes = showFallback.updateQueue), - null === renderLanes + (current = showFallback.updateQueue), + null === current ? (showFallback.updateQueue = { transitions: workInProgress, - markerInstances: current, + markerInstances: renderLanes, retryQueue: null }) - : ((renderLanes.transitions = workInProgress), - (renderLanes.markerInstances = current)))), + : ((current.transitions = workInProgress), + (current.markerInstances = renderLanes)))), nextProps ); if ("number" === typeof nextProps.unstable_expectedLoadTime) @@ -4755,9 +4829,11 @@ module.exports = function ($$$config) { : (reuseSuspenseHandlerOnStack(workInProgress), (showFallback = nextProps.fallback), (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( + (nextProps = createFiberFromOffscreen( { mode: "visible", children: nextProps.children }, - nextInstance + nextInstance, + 0, + null )), (showFallback = createFiberFromFragment( showFallback, @@ -4770,12 +4846,13 @@ module.exports = function ($$$config) { (showFallback.return = workInProgress), (nextProps.sibling = showFallback), (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), (nextProps = workInProgress.child), (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), @@ -4888,7 +4965,7 @@ module.exports = function ($$$config) { )), registerSuspenseInstanceRetry(nextInstance, workInProgress), (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), + : ((renderLanes = JSCompiler_temp$jscomp$0.treeContext), supportsHydration && ((nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(nextInstance)), @@ -4896,12 +4973,12 @@ module.exports = function ($$$config) { (isHydrating = !0), (hydrationErrors = null), (rootOrSingletonContext = !1), - null !== current && + null !== renderLanes && ((idStack[idStackIndex++] = treeContextId), (idStack[idStackIndex++] = treeContextOverflow), (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), + (treeContextId = renderLanes.id), + (treeContextOverflow = renderLanes.overflow), (treeContextProvider = workInProgress))), (workInProgress = mountSuspensePrimaryChildren( workInProgress, @@ -4916,11 +4993,20 @@ module.exports = function ($$$config) { nextInstance = workInProgress.mode; JSCompiler_temp$jscomp$0 = current.child; didSuspend = JSCompiler_temp$jscomp$0.sibling; - nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - }); - nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + var primaryChildProps = { mode: "hidden", children: nextProps.children }; + disableLegacyMode || + 0 !== (nextInstance & 1) || + workInProgress.child === JSCompiler_temp$jscomp$0 + ? ((nextProps = createWorkInProgress( + JSCompiler_temp$jscomp$0, + primaryChildProps + )), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280)) + : ((nextProps = workInProgress.child), + (nextProps.childLanes = 0), + (nextProps.pendingProps = primaryChildProps), + (workInProgress.deletions = null)); null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -4954,36 +5040,33 @@ module.exports = function ($$$config) { cachePool: JSCompiler_temp$jscomp$0 })); showFallback.memoizedState = nextInstance; - if ( - enableTransitionTracing && + enableTransitionTracing && ((nextInstance = enableTransitionTracing ? transitionStack.current : null), - null !== nextInstance) - ) { - JSCompiler_temp$jscomp$0 = enableTransitionTracing - ? markerInstanceStack.current - : null; - didSuspend = showFallback.updateQueue; - var currentOffscreenQueue = current.updateQueue; - null === didSuspend - ? (showFallback.updateQueue = { - transitions: nextInstance, - markerInstances: JSCompiler_temp$jscomp$0, - retryQueue: null - }) - : didSuspend === currentOffscreenQueue - ? (showFallback.updateQueue = { - transitions: nextInstance, - markerInstances: JSCompiler_temp$jscomp$0, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((didSuspend.transitions = nextInstance), - (didSuspend.markerInstances = JSCompiler_temp$jscomp$0)); - } + null !== nextInstance && + ((JSCompiler_temp$jscomp$0 = enableTransitionTracing + ? markerInstanceStack.current + : null), + (didSuspend = showFallback.updateQueue), + (primaryChildProps = current.updateQueue), + null === didSuspend + ? (showFallback.updateQueue = { + transitions: nextInstance, + markerInstances: JSCompiler_temp$jscomp$0, + retryQueue: null + }) + : didSuspend === primaryChildProps + ? (showFallback.updateQueue = { + transitions: nextInstance, + markerInstances: JSCompiler_temp$jscomp$0, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((didSuspend.transitions = nextInstance), + (didSuspend.markerInstances = JSCompiler_temp$jscomp$0)))); showFallback.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -4993,27 +5076,32 @@ module.exports = function ($$$config) { return nextProps; } pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { + JSCompiler_temp = current.child; + current = JSCompiler_temp.sibling; + JSCompiler_temp = createWorkInProgress(JSCompiler_temp, { mode: "visible", children: nextProps.children }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; + disableLegacyMode || + 0 !== (workInProgress.mode & 1) || + (JSCompiler_temp.lanes = renderLanes); + JSCompiler_temp.return = workInProgress; + JSCompiler_temp.sibling = null; null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp + ((renderLanes = workInProgress.deletions), + null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; + : renderLanes.push(current)); + workInProgress.child = JSCompiler_temp; workInProgress.memoizedState = null; - return renderLanes; + return JSCompiler_temp; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( + primaryChildren = createFiberFromOffscreen( { mode: "visible", children: primaryChildren }, - workInProgress.mode + workInProgress.mode, + 0, + null ); primaryChildren.return = workInProgress; return (workInProgress.child = primaryChildren); @@ -5024,26 +5112,30 @@ module.exports = function ($$$config) { fallbackChildren, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { mode: "hidden", children: primaryChildren }; + disableLegacyMode || 0 !== (mode & 1) || null === progressedPrimaryFragment + ? (progressedPrimaryFragment = createFiberFromOffscreen( + primaryChildren, + mode, + 0, + null + )) + : ((progressedPrimaryFragment.childLanes = 0), + (progressedPrimaryFragment.pendingProps = primaryChildren)); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, renderLanes, null ); - primaryChildren.return = workInProgress; + progressedPrimaryFragment.return = workInProgress; fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; return fallbackChildren; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); - } function retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -5121,58 +5213,69 @@ module.exports = function ($$$config) { nextProps &= 1; } push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; + if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + else workInProgress.memoizedState = null; return workInProgress.child; } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + disableLegacyMode || + 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; @@ -5349,11 +5452,12 @@ module.exports = function ($$$config) { workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: + var elementType = workInProgress.elementType; a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); var props = workInProgress.pendingProps; - current = workInProgress.elementType; - var init = current._init; - current = init(current._payload); + current = elementType._init; + current = current(elementType._payload); workInProgress.type = current; if ("function" === typeof current) shouldConstruct(current) @@ -5380,7 +5484,8 @@ module.exports = function ($$$config) { else { if (void 0 !== current && null !== current) if ( - ((init = current.$$typeof), init === REACT_FORWARD_REF_TYPE) + ((elementType = current.$$typeof), + elementType === REACT_FORWARD_REF_TYPE) ) { props = disableDefaultPropsExceptForClasses ? props @@ -5394,7 +5499,7 @@ module.exports = function ($$$config) { renderLanes ); break a; - } else if (init === REACT_MEMO_TYPE) { + } else if (elementType === REACT_MEMO_TYPE) { props = disableDefaultPropsExceptForClasses ? props : resolveDefaultPropsOnNonClassComponent(current, props); @@ -5420,24 +5525,24 @@ module.exports = function ($$$config) { case 0: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), updateFunctionComponent( current, workInProgress, props, - init, + elementType, renderLanes ) ); case 1: return ( (props = workInProgress.type), - (init = resolveClassComponentProps( + (elementType = resolveClassComponentProps( props, workInProgress.pendingProps, workInProgress.elementType === props @@ -5446,7 +5551,7 @@ module.exports = function ($$$config) { current, workInProgress, props, - init, + elementType, renderLanes ) ); @@ -5455,8 +5560,8 @@ module.exports = function ($$$config) { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - props = init.element; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -5465,19 +5570,19 @@ module.exports = function ($$$config) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); nextProps = nextState.cache; pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); nextProps = nextState.element; - if (supportsHydration && init.isDehydrated) + if (supportsHydration && elementType.isDehydrated) if ( - ((init = { + ((elementType = { element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { workInProgress = mountHostRootWithoutHydrating( @@ -5602,7 +5707,7 @@ module.exports = function ($$$config) { workInProgress.pendingProps, contextStackCursor.current ); - if ((init = props = nextHydratableInstance)) + if ((elementType = props = nextHydratableInstance)) (props = canHydrateInstance( props, workInProgress.type, @@ -5614,22 +5719,22 @@ module.exports = function ($$$config) { (hydrationParentFiber = workInProgress), (nextHydratableInstance = getFirstHydratableChild(props)), (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); + (elementType = !0)) + : (elementType = !1); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); - init = workInProgress.type; + elementType = workInProgress.type; nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; props = nextProps.children; - shouldSetTextContent(init, nextProps) + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && - shouldSetTextContent(init, nextState) && + shouldSetTextContent(elementType, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((elementType = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -5638,12 +5743,12 @@ module.exports = function ($$$config) { renderLanes )), isPrimaryRenderer - ? (HostTransitionContext._currentValue = init) - : (HostTransitionContext._currentValue2 = init), + ? (HostTransitionContext._currentValue = elementType) + : (HostTransitionContext._currentValue2 = elementType), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== elementType && propagateContextChange( workInProgress, HostTransitionContext, @@ -5695,13 +5800,19 @@ module.exports = function ($$$config) { case 11: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses || workInProgress.elementType === props - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - updateForwardRef(current, workInProgress, props, init, renderLanes) + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + updateForwardRef( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 7: return ( @@ -5738,14 +5849,14 @@ module.exports = function ($$$config) { props = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + elementType = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextState = init.value; + nextState = elementType.value; pushProvider(workInProgress, props, nextState); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextState)) { if ( - nextProps.children === init.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -5759,7 +5870,7 @@ module.exports = function ($$$config) { reconcileChildren( current, workInProgress, - init.children, + elementType.children, renderLanes ); workInProgress = workInProgress.child; @@ -5767,13 +5878,13 @@ module.exports = function ($$$config) { return workInProgress; case 9: return ( - (init = enableRenderableContext + (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (props = props(init)), + (elementType = readContext(elementType)), + (props = props(elementType)), (workInProgress.flags |= 1), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5781,14 +5892,20 @@ module.exports = function ($$$config) { case 14: return ( (props = workInProgress.type), - (init = workInProgress.pendingProps), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props, init)), - (init = disableDefaultPropsExceptForClasses - ? init - : resolveDefaultPropsOnNonClassComponent(props.type, init)), - updateMemoComponent(current, workInProgress, props, init, renderLanes) + (elementType = workInProgress.pendingProps), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props, elementType)), + (elementType = disableDefaultPropsExceptForClasses + ? elementType + : resolveDefaultPropsOnNonClassComponent(props.type, elementType)), + updateMemoComponent( + current, + workInProgress, + props, + elementType, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -5798,6 +5915,47 @@ module.exports = function ($$$config) { workInProgress.pendingProps, renderLanes ); + case 17: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 1; + isContextProvider(props) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, props, elementType); + mountClassInstance(workInProgress, props, elementType, renderLanes); + return finishClassComponent( + null, + workInProgress, + props, + !0, + current, + renderLanes + ); + case 28: + if (disableLegacyMode) break; + props = workInProgress.type; + elementType = resolveClassComponentProps( + props, + workInProgress.pendingProps, + workInProgress.elementType === props + ); + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + workInProgress.tag = 0; + return updateFunctionComponent( + null, + workInProgress, + props, + elementType, + renderLanes + ); case 19: return updateSuspenseListComponent( current, @@ -5824,34 +5982,38 @@ module.exports = function ($$$config) { prepareToReadContext(workInProgress, renderLanes), (props = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((elementType = peekCacheFromPool()), + null === elementType && + ((elementType = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (elementType.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { parent: props, cache: init }), + null !== nextProps && + (elementType.pooledCacheLanes |= renderLanes), + (elementType = nextProps)), + (workInProgress.memoizedState = { + parent: props, + cache: elementType + }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, elementType)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (elementType = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== props - ? ((init = { parent: props, cache: props }), - (workInProgress.memoizedState = init), + elementType.parent !== props + ? ((elementType = { parent: props, cache: props }), + (workInProgress.memoizedState = elementType), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), + elementType), pushProvider(workInProgress, CacheContext, props)) : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), - props !== init.cache && + props !== elementType.cache && propagateContextChange( workInProgress, CacheContext, @@ -6392,44 +6554,44 @@ module.exports = function ($$$config) { needsVisibilityToggle = needsVisibilityToggle.sibling; } else if (supportsPersistence) - for (var node$106 = workInProgress.child; null !== node$106; ) { - if (5 === node$106.tag) { - var instance = node$106.stateNode; + for (var node$114 = workInProgress.child; null !== node$114; ) { + if (5 === node$114.tag) { + var instance = node$114.stateNode; needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance( instance, - node$106.type, - node$106.memoizedProps + node$114.type, + node$114.memoizedProps )); appendInitialChild(parent, instance); - } else if (6 === node$106.tag) - (instance = node$106.stateNode), + } else if (6 === node$114.tag) + (instance = node$114.stateNode), needsVisibilityToggle && isHidden && (instance = cloneHiddenTextInstance( instance, - node$106.memoizedProps + node$114.memoizedProps )), appendInitialChild(parent, instance); - else if (4 !== node$106.tag) - if (22 === node$106.tag && null !== node$106.memoizedState) - (instance = node$106.child), - null !== instance && (instance.return = node$106), - appendAllChildren(parent, node$106, !0, !0); - else if (null !== node$106.child) { - node$106.child.return = node$106; - node$106 = node$106.child; + else if (4 !== node$114.tag) + if (22 === node$114.tag && null !== node$114.memoizedState) + (instance = node$114.child), + null !== instance && (instance.return = node$114), + appendAllChildren(parent, node$114, !0, !0); + else if (null !== node$114.child) { + node$114.child.return = node$114; + node$114 = node$114.child; continue; } - if (node$106 === workInProgress) break; - for (; null === node$106.sibling; ) { - if (null === node$106.return || node$106.return === workInProgress) + if (node$114 === workInProgress) break; + for (; null === node$114.sibling; ) { + if (null === node$114.return || node$114.return === workInProgress) return; - node$106 = node$106.return; + node$114 = node$114.return; } - node$106.sibling.return = node$106.return; - node$106 = node$106.sibling; + node$114.sibling.return = node$114.return; + node$114 = node$114.sibling; } } function appendAllChildrenToContainer( @@ -6502,31 +6664,31 @@ module.exports = function ($$$config) { current.memoizedProps !== newProps && markUpdate(workInProgress); else if (supportsPersistence) { var currentInstance = current.stateNode, - oldProps$109 = current.memoizedProps; + oldProps$117 = current.memoizedProps; if ( (current = doesRequireClone(current, workInProgress)) || - oldProps$109 !== newProps + oldProps$117 !== newProps ) { var currentHostContext = contextStackCursor.current; - oldProps$109 = cloneInstance( + oldProps$117 = cloneInstance( currentInstance, type, - oldProps$109, + oldProps$117, newProps, !current, null ); - oldProps$109 === currentInstance + oldProps$117 === currentInstance ? (workInProgress.stateNode = currentInstance) : (finalizeInitialChildren( - oldProps$109, + oldProps$117, type, newProps, currentHostContext ) && markUpdate(workInProgress), - (workInProgress.stateNode = oldProps$109), + (workInProgress.stateNode = oldProps$117), current - ? appendAllChildren(oldProps$109, workInProgress, !1, !1) + ? appendAllChildren(oldProps$117, workInProgress, !1, !1) : markUpdate(workInProgress)); } else workInProgress.stateNode = currentInstance; } @@ -6576,15 +6738,15 @@ module.exports = function ($$$config) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$111 = null; null !== lastTailNode; ) + for (var lastTailNode$119 = null; null !== lastTailNode; ) null !== lastTailNode.alternate && - (lastTailNode$111 = lastTailNode), + (lastTailNode$119 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$111 + null === lastTailNode$119 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$111.sibling = null); + : (lastTailNode$119.sibling = null); } } function bubbleProperties(completedWork) { @@ -6594,19 +6756,19 @@ module.exports = function ($$$config) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$112 = completedWork.child; null !== child$112; ) - (newChildLanes |= child$112.lanes | child$112.childLanes), - (subtreeFlags |= child$112.subtreeFlags & 31457280), - (subtreeFlags |= child$112.flags & 31457280), - (child$112.return = completedWork), - (child$112 = child$112.sibling); + for (var child$120 = completedWork.child; null !== child$120; ) + (newChildLanes |= child$120.lanes | child$120.childLanes), + (subtreeFlags |= child$120.subtreeFlags & 31457280), + (subtreeFlags |= child$120.flags & 31457280), + (child$120.return = completedWork), + (child$120 = child$120.sibling); else - for (child$112 = completedWork.child; null !== child$112; ) - (newChildLanes |= child$112.lanes | child$112.childLanes), - (subtreeFlags |= child$112.subtreeFlags), - (subtreeFlags |= child$112.flags), - (child$112.return = completedWork), - (child$112 = child$112.sibling); + for (child$120 = completedWork.child; null !== child$120; ) + (newChildLanes |= child$120.lanes | child$120.childLanes), + (subtreeFlags |= child$120.subtreeFlags), + (subtreeFlags |= child$120.flags), + (child$120.return = completedWork), + (child$120 = child$120.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6615,6 +6777,8 @@ module.exports = function ($$$config) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { + case 28: + if (disableLegacyMode) break; case 16: case 15: case 0: @@ -6627,8 +6791,7 @@ module.exports = function ($$$config) { return bubbleProperties(workInProgress), null; case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)), + isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null ); @@ -6883,11 +7046,11 @@ module.exports = function ($$$config) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (nextResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$125 = null; + var cache$133 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$125 = newProps.memoizedState.cachePool.pool); - cache$125 !== nextResource && (newProps.flags |= 2048); + (cache$133 = newProps.memoizedState.cachePool.pool); + cache$133 !== nextResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6917,14 +7080,19 @@ module.exports = function ($$$config) { bubbleProperties(workInProgress), null ); + case 17: + if (disableLegacyMode) break; + isContextProvider(workInProgress.type) && popContext(); + bubbleProperties(workInProgress); + return null; case 19: pop(suspenseStackCursor); nextResource = workInProgress.memoizedState; if (null === nextResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$125 = nextResource.rendering; - if (null === cache$125) + cache$133 = nextResource.rendering; + if (null === cache$133) if (newProps) cutOffTailIfNeeded(nextResource, !1); else { if ( @@ -6932,11 +7100,11 @@ module.exports = function ($$$config) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$125 = findFirstSuspended(current); - if (null !== cache$125) { + cache$133 = findFirstSuspended(current); + if (null !== cache$133) { workInProgress.flags |= 128; cutOffTailIfNeeded(nextResource, !1); - current = cache$125.updateQueue; + current = cache$133.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6965,7 +7133,7 @@ module.exports = function ($$$config) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$125)), null !== current)) { + if (((current = findFirstSuspended(cache$133)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6975,7 +7143,7 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !0), null === nextResource.tail && "hidden" === nextResource.tailMode && - !cache$125.alternate && + !cache$133.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -6988,13 +7156,13 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !1), (workInProgress.lanes = 4194304)); nextResource.isBackwards - ? ((cache$125.sibling = workInProgress.child), - (workInProgress.child = cache$125)) + ? ((cache$133.sibling = workInProgress.child), + (workInProgress.child = cache$133)) : ((current = nextResource.last), null !== current - ? (current.sibling = cache$125) - : (workInProgress.child = cache$125), - (nextResource.last = cache$125)); + ? (current.sibling = cache$133) + : (workInProgress.child = cache$133), + (nextResource.last = cache$133)); } if (null !== nextResource.tail) return ( @@ -7038,14 +7206,14 @@ module.exports = function ($$$config) { ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - newProps - ? 0 !== (renderLanes & 536870912) && + !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + ? bubbleProperties(workInProgress) + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && workInProgress.subtreeFlags & 6 && - (workInProgress.flags |= 8192)) - : bubbleProperties(workInProgress), + (workInProgress.flags |= 8192)), (renderLanes = workInProgress.updateQueue), null !== renderLanes && scheduleRetryEffect(workInProgress, renderLanes.retryQueue), @@ -7081,6 +7249,8 @@ module.exports = function ($$$config) { bubbleProperties(workInProgress)), null ); + case 29: + if (!disableLegacyMode) return null; } throw Error(formatProdErrorMessage(156, workInProgress.tag)); } @@ -7089,8 +7259,7 @@ module.exports = function ($$$config) { switch (workInProgress.tag) { case 1: return ( - isContextProvider(workInProgress.type) && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)), + isContextProvider(workInProgress.type) && popContext(), (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), @@ -7173,9 +7342,7 @@ module.exports = function ($$$config) { switch (interruptedWork.tag) { case 1: current = interruptedWork.type.childContextTypes; - null !== current && - void 0 !== current && - (pop(didPerformWorkStackCursor), pop(contextStackCursor$1)); + null !== current && void 0 !== current && popContext(); break; case 3: popProvider(CacheContext); @@ -7273,8 +7440,8 @@ module.exports = function ($$$config) { else if ("function" === typeof ref) try { ref(null); - } catch (error$142) { - captureCommitPhaseError(current, nearestMountedAncestor, error$142); + } catch (error$151) { + captureCommitPhaseError(current, nearestMountedAncestor, error$151); } else ref.current = null; } @@ -7497,11 +7664,11 @@ module.exports = function ($$$config) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$143) { + } catch (error$152) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$143 + error$152 ); } } @@ -7552,26 +7719,30 @@ module.exports = function ($$$config) { commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevProps = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevProps) { - current = - (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && - !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } + if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), + !prevProps) + ) { + current = + (null !== current && null !== current.memoizedState) || + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && + !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) @@ -8044,15 +8215,21 @@ module.exports = function ($$$config) { break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || - null !== deletedFiber.memoizedState; - recursivelyTraverseDeletionEffects( - finishedRoot, - nearestMountedAncestor, - deletedFiber - ); - offscreenSubtreeWasHidden = prevHostParent; + disableLegacyMode || deletedFiber.mode & 1 + ? ((offscreenSubtreeWasHidden = + (prevHostParent = offscreenSubtreeWasHidden) || + null !== deletedFiber.memoizedState), + recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ), + (offscreenSubtreeWasHidden = prevHostParent)) + : recursivelyTraverseDeletionEffects( + finishedRoot, + nearestMountedAncestor, + deletedFiber + ); break; default: recursivelyTraverseDeletionEffects( @@ -8064,19 +8241,19 @@ module.exports = function ($$$config) { } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (supportsHydration && null === finishedWork.memoizedState) { - var current$154 = finishedWork.alternate; + var current$163 = finishedWork.alternate; if ( - null !== current$154 && - ((current$154 = current$154.memoizedState), - null !== current$154 && - ((current$154 = current$154.dehydrated), null !== current$154)) + null !== current$163 && + ((current$163 = current$163.memoizedState), + null !== current$163 && + ((current$163 = current$163.dehydrated), null !== current$163)) ) try { - commitHydratedSuspenseInstance(current$154); + commitHydratedSuspenseInstance(current$163); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$154); + onHydrated && onHydrated(current$163); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8195,11 +8372,11 @@ module.exports = function ($$$config) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$156) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$156 + error$165 ); } } @@ -8277,11 +8454,11 @@ module.exports = function ($$$config) { finishedWork.memoizedProps, finishedWork ); - } catch (error$157) { + } catch (error$166) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$157 + error$166 ); } break; @@ -8313,11 +8490,11 @@ module.exports = function ($$$config) { root = finishedWork.stateNode; try { resetTextContent(root); - } catch (error$158) { + } catch (error$167) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$158 + error$167 ); } } @@ -8327,11 +8504,11 @@ module.exports = function ($$$config) { props = finishedWork.type; try { commitUpdate(root, props, current, hoistableRoot, finishedWork); - } catch (error$160) { + } catch (error$169) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$160 + error$169 ); } } @@ -8349,11 +8526,11 @@ module.exports = function ($$$config) { current = null !== current ? current.memoizedProps : root; try { commitTextUpdate(flags, current, root); - } catch (error$161) { + } catch (error$170) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$161 + error$170 ); } } @@ -8376,11 +8553,11 @@ module.exports = function ($$$config) { ) try { commitHydratedContainer(root.containerInfo); - } catch (error$162) { + } catch (error$171) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$162 + error$171 ); } if (supportsPersistence) { @@ -8388,11 +8565,11 @@ module.exports = function ($$$config) { current = root.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$163) { + } catch (error$172) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$172 ); } } @@ -8417,11 +8594,11 @@ module.exports = function ($$$config) { current = current.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$167) { + } catch (error$176) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$167 + error$176 ); } } @@ -8445,11 +8622,11 @@ module.exports = function ($$$config) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$168) { + } catch (error$177) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$168 + error$177 ); } flags = finishedWork.updateQueue; @@ -8464,14 +8641,17 @@ module.exports = function ($$$config) { safelyDetachRef(current, current.return); suspenseCallback = null !== finishedWork.memoizedState; retryQueue = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + if (disableLegacyMode || finishedWork.mode & 1) { + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8487,7 +8667,8 @@ module.exports = function ($$$config) { null === current || retryQueue || root || - recursivelyTraverseDisappearLayoutEffects(finishedWork)), + ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + recursivelyTraverseDisappearLayoutEffects(finishedWork))), supportsMutation && (null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode)) @@ -8521,11 +8702,11 @@ module.exports = function ($$$config) { suspenseCallback ? hideTextInstance(props) : unhideTextInstance(props, root.memoizedProps); - } catch (error$145) { + } catch (error$154) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$145 + error$154 ); } } else if ( @@ -8611,21 +8792,21 @@ module.exports = function ($$$config) { break; } case 5: - var parent$146 = JSCompiler_inline_result.stateNode; + var parent$155 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (resetTextContent(parent$146), + (resetTextContent(parent$155), (JSCompiler_inline_result.flags &= -33)); - var before$147 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$147, parent$146); + var before$156 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$156, parent$155); break; case 3: case 4: - var parent$148 = JSCompiler_inline_result.stateNode.containerInfo, - before$149 = getHostSibling(finishedWork); + var parent$157 = JSCompiler_inline_result.stateNode.containerInfo, + before$158 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$149, - parent$148 + before$158, + parent$157 ); break; default: @@ -8706,7 +8887,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$172 = parentFiber.alternate, + var current$181 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -8734,16 +8915,16 @@ module.exports = function ($$$config) { } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$172 = finishedWork.updateQueue; - if (null !== current$172) { - var hiddenCallbacks = current$172.shared.hiddenCallbacks; + current$181 = finishedWork.updateQueue; + if (null !== current$181) { + var hiddenCallbacks = current$181.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$172.shared.hiddenCallbacks = null, current$172 = 0; - current$172 < hiddenCallbacks.length; - current$172++ + current$181.shared.hiddenCallbacks = null, current$181 = 0; + current$181 < hiddenCallbacks.length; + current$181++ ) - callCallback(hiddenCallbacks[current$172], finishedRoot); + callCallback(hiddenCallbacks[current$181], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8759,7 +8940,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$172 && + null === current$181 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -9001,10 +9182,18 @@ module.exports = function ($$$config) { committedLanes, committedTransitions ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -9102,9 +9291,9 @@ module.exports = function ($$$config) { ); break; case 22: - var instance$178 = finishedWork.stateNode; + var instance$187 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$178._visibility & 4 + ? instance$187._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9112,11 +9301,20 @@ module.exports = function ($$$config) { committedTransitions, includeWorkInProgressEffects ) - : recursivelyTraverseAtomicPassiveEffects( + : disableLegacyMode || finishedWork.mode & 1 + ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, finishedWork ) - : ((instance$178._visibility |= 4), + : ((instance$187._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$187._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9129,7 +9327,7 @@ module.exports = function ($$$config) { commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$178 + instance$187 ); break; case 24: @@ -9655,14 +9853,19 @@ module.exports = function ($$$config) { boundaries )); } - function requestUpdateLane() { - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== ReactSharedInternals.T) { - var actionScopeLane = currentEntangledLane; - return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); - } - return resolveUpdatePriority(); + function resetRenderTimer() { + workInProgressRootRenderTargetTime = now() + 500; + } + function requestUpdateLane(fiber) { + fiber = fiber.mode; + return disableLegacyMode || 0 !== (fiber & 1) + ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== ReactSharedInternals.T + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : resolveUpdatePriority() + : 2; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -9687,20 +9890,21 @@ module.exports = function ($$$config) { ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { - if ( - enableTransitionTracing && - ((fiber = ReactSharedInternals.T), - null !== fiber && - null != fiber.name && - (-1 === fiber.startTime && (fiber.startTime = now()), - enableTransitionTracing)) - ) { - var transitionLanesMap = root.transitionLanes, - index$10 = 31 - clz32(lane), - transitions = transitionLanesMap[index$10]; - null === transitions && (transitions = new Set()); - transitions.add(fiber); - transitionLanesMap[index$10] = transitions; + if (enableTransitionTracing) { + var transition = ReactSharedInternals.T; + if ( + null !== transition && + null != transition.name && + (-1 === transition.startTime && (transition.startTime = now()), + enableTransitionTracing) + ) { + var transitionLanesMap = root.transitionLanes, + index$10 = 31 - clz32(lane), + transitions = transitionLanesMap[index$10]; + null === transitions && (transitions = new Set()); + transitions.add(transition); + transitionLanesMap[index$10] = transitions; + } } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -9712,6 +9916,12 @@ module.exports = function ($$$config) { workInProgressDeferredLane )); ensureRootIsScheduled(root); + 2 !== lane || + 0 !== executionContext || + disableLegacyMode || + 0 !== (fiber.mode & 1) || + (resetRenderTimer(), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); } } function performConcurrentWorkOnRoot(root, didTimeout) { @@ -9980,7 +10190,7 @@ module.exports = function ($$$config) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { + if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { var originallyAttemptedLanes = lanes, errorRetryLanes = getLanesToRetrySynchronouslyOnError( root, @@ -10184,8 +10394,8 @@ module.exports = function ($$$config) { } workLoopSync(); break; - } catch (thrownValue$192) { - handleThrow(root, thrownValue$192); + } catch (thrownValue$201) { + handleThrow(root, thrownValue$201); } while (1); lanes && root.shellSuspendCounter++; @@ -10209,7 +10419,7 @@ module.exports = function ($$$config) { prevAsyncDispatcher = pushAsyncDispatcher(); if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) (workInProgressTransitions = getTransitionsForLanes(root, lanes)), - (workInProgressRootRenderTargetTime = now() + 500), + resetRenderTimer(), prepareFreshStack(root, lanes); a: do try { @@ -10300,8 +10510,8 @@ module.exports = function ($$$config) { } workLoopConcurrent(); break; - } catch (thrownValue$194) { - handleThrow(root, thrownValue$194); + } catch (thrownValue$203) { + handleThrow(root, thrownValue$203); } while (1); resetContextDependencies(); @@ -10536,12 +10746,12 @@ module.exports = function ($$$config) { setCurrentUpdatePriority(2); var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$200 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$209 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$200 && afterActiveInstanceBlur(); + shouldFireAfterActiveInstanceBlur$209 && afterActiveInstanceBlur(); resetAfterCommit(root.containerInfo); root.current = finishedWork; commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); @@ -10569,7 +10779,9 @@ module.exports = function ($$$config) { renderPriorityLevel(remainingLanes.value, { componentStack: remainingLanes.stack }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + 0 === (pendingPassiveEffectsLanes & 3) || + (!disableLegacyMode && 0 === root.tag) || + flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || @@ -10751,7 +10963,10 @@ module.exports = function ($$$config) { ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { - 0 === retryLane && (retryLane = claimNextRetryLane()); + 0 === retryLane && + ((retryLane = boundaryFiber.mode), + (retryLane = + disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -10941,10 +11156,12 @@ module.exports = function ($$$config) { ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 24; - enableDO_NOT_USE_disableStrictPassiveEffect && - pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + mode |= 8; + if (disableLegacyMode || 0 !== (mode & 1)) + (mode |= 16), + enableDO_NOT_USE_disableStrictPassiveEffect && + pendingProps.DO_NOT_USE_disableStrictPassiveEffect && + (mode |= 64); break; case REACT_PROFILER_TYPE: return ( @@ -11118,7 +11335,7 @@ module.exports = function ($$$config) { onRecoverableError, formState ) { - this.tag = 1; + this.tag = disableLegacyMode ? 1 : tag; this.containerInfo = containerInfo; this.finishedWork = this.pingCache = @@ -11192,10 +11409,12 @@ module.exports = function ($$$config) { containerInfo.hydrationCallbacks = hydrationCallbacks; enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); - hydrationCallbacks = 1; - !0 === isStrictMode && (hydrationCallbacks |= 24); - concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32); - isStrictMode = createFiber(3, null, null, hydrationCallbacks); + disableLegacyMode || 1 === tag + ? ((tag = 1), + !0 === isStrictMode && (tag |= 24), + concurrentUpdatesByDefaultOverride && (tag |= 32)) + : (tag = 0); + isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -11331,6 +11550,7 @@ module.exports = function ($$$config) { disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -11911,7 +12131,7 @@ module.exports = function ($$$config) { }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.payload = payload; void 0 !== callback && @@ -11924,7 +12144,7 @@ module.exports = function ($$$config) { }, enqueueReplaceState: function (inst, payload, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 1; update.payload = payload; @@ -11938,7 +12158,7 @@ module.exports = function ($$$config) { }, enqueueForceUpdate: function (inst, callback) { inst = inst._reactInternals; - var lane = requestUpdateLane(), + var lane = requestUpdateLane(inst), update = createUpdate(lane); update.tag = 2; void 0 !== callback && @@ -12107,7 +12327,7 @@ module.exports = function ($$$config) { }; exports.attemptHydrationAtCurrentPriority = function (fiber) { if (13 === fiber.tag) { - var lane = requestUpdateLane(), + var lane = requestUpdateLane(fiber), root = enqueueConcurrentRenderForLane(fiber, lane); null !== root && scheduleUpdateOnFiber(root, fiber, lane); markRetryLaneIfNotHydrated(fiber, lane); @@ -12128,8 +12348,7 @@ module.exports = function ($$$config) { } ensureRootIsScheduled(fiber); 0 === (executionContext & 6) && - ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(!1)); + (resetRenderTimer(), flushSyncWorkAcrossRoots_impl(!1)); } } break; @@ -12141,7 +12360,17 @@ module.exports = function ($$$config) { } }; exports.batchedUpdates = function (fn, a) { - return fn(a); + if (disableLegacyMode) return fn(a); + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + (executionContext = prevExecutionContext), + 0 === executionContext && + (resetRenderTimer(), + disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + } }; exports.createComponentSelector = function (component) { return { $$typeof: COMPONENT_TYPE, value: component }; @@ -12209,7 +12438,7 @@ module.exports = function ($$$config) { ); initialChildren.context = getContextForSubtree(null); containerInfo = initialChildren.current; - tag = requestUpdateLane(); + tag = requestUpdateLane(containerInfo); hydrationCallbacks = createUpdate(tag); hydrationCallbacks.callback = void 0 !== callback && null !== callback ? callback : null; @@ -12272,8 +12501,7 @@ module.exports = function ($$$config) { } finally { setCurrentUpdatePriority(previousPriority), (ReactSharedInternals.T = prevTransition), - 0 === executionContext && - (workInProgressRootRenderTargetTime = now() + 500); + 0 === executionContext && resetRenderTimer(); } }; exports.findAllNodes = findAllNodes; @@ -12355,6 +12583,11 @@ module.exports = function ($$$config) { }; exports.flushPassiveEffects = flushPassiveEffects; exports.flushSyncFromReconciler = function (fn) { + null === rootWithPendingPassiveEffects || + disableLegacyMode || + 0 !== rootWithPendingPassiveEffects.tag || + 0 !== (executionContext & 6) || + flushPassiveEffects(); var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactSharedInternals.T, @@ -12463,7 +12696,7 @@ module.exports = function ($$$config) { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }; if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) devToolsConfig = !1; @@ -12537,7 +12770,7 @@ module.exports = function ($$$config) { callback ) { var current = container.current, - lane = requestUpdateLane(); + lane = requestUpdateLane(current); updateContainerImpl( current, lane, diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index 4face5e294..e09320ed1f 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -12188,7 +12188,7 @@ module.exports = function ($$$config) { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }; if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) devToolsConfig = !1; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 0f3a44c9ef..ee30d84efe 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -14712,14 +14712,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-classic-88959fd54a-20240614" }); })({ findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 1, - version: "19.0.0-www-classic-f0e8164410-20240614", + version: "19.0.0-www-classic-88959fd54a-20240614", rendererPackageName: "react-test-renderer" }); exports._Scheduler = Scheduler; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index e62d0ae64d..3d8a175e4d 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -14712,14 +14712,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-f0e8164410-20240614" + reconcilerVersion: "19.0.0-www-modern-88959fd54a-20240614" }); })({ findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 1, - version: "19.0.0-www-modern-f0e8164410-20240614", + version: "19.0.0-www-modern-88959fd54a-20240614", rendererPackageName: "react-test-renderer" }); exports._Scheduler = Scheduler; diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index 63d6ebc8a2..788801bded 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.0.0-www-classic-f0e8164410-20240614 \ No newline at end of file +19.0.0-www-classic-88959fd54a-20240614 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index 834e9f180a..b359517b82 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.0.0-www-modern-f0e8164410-20240614 \ No newline at end of file +19.0.0-www-modern-88959fd54a-20240614 \ No newline at end of file